source: genapp/sbin/install-perl-stable

Last change on this file was 857, checked in by ehb, 6 years ago

install help mod

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/bash
2
3export GENAPP="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
4echo genapp base directory is $GENAPP
5
6CPUS=`grep processor /proc/cpuinfo | wc -l`
7CPUS2=$(($CPUS * 2))
8
9printf '%80s\n' | tr ' ' -
10echo "Note: you can provide a -j argument to this command if you want to parallel compile perl."
11echo "      e.g. -j4 for 4 simultaneous processes working on the compilation"
12echo "      Just press control-c and restart if you wish to do this."
13printf '%80s\n' | tr ' ' -
14echo "Your system appears to have $CPUS processors, so you could probably do a -j$CPUS or even a -j$CPUS2 compile.";
15printf '%80s\n' | tr ' ' -
16sleep 2
17
18# is perl installed
19
20PERL=`which perl`
21if [ "$PERL" ]; then 
22    PV=`perl -e 'print $];'`
23    if (( $(echo "$PV >= 5.018" | bc -l) )); then
24      printf "you already have a perl version > 5.18 installed\n";
25      exit;
26    fi
27fi
28
29CC=`which cc 2> /dev/null`;
30if [ -z "$CC" ]; then 
31   echo 
32   echo "You need to have development tools such as a C compilier installed"
33   echo "  For RedHat/Centos: \$ sudo yum -y groupinstall 'Development tools'"
34   echo "  For Ubuntu       : \$ sudo apt-get -y install build-essential"
35   exit
36fi
37
38PERL_GET="http://www.cpan.org/src/perl-5.18.4.tar.bz2"
39
40cd $GENAPP && mkdir tmp perl 2> /dev/null
41sudo chmod a+rwx tmp && \
42cd tmp && \
43 rm -fr perl* && \
44curl -o perl.tar.bz2 $PERL_GET && \
45tar jxf perl.tar.bz2 && cd perl-5*/ && \
46./Configure -Dprefix=$GENAPP/perl -des && \
47make $*  && \
48make $* test && \
49make install
Note: See TracBrowser for help on using the repository browser.