Changeset 9744


Ignore:
Timestamp:
Apr 7, 2011, 5:56:53 PM (13 years ago)
Author:
bless
Message:
  • explicitly using bash, not sh
  • easier configuration of packages (and their versions)
  • better failure handling for various cases
  • suppressed some output, e.g. from tar unpacking
  • script now always aborts on failure
File:
1 edited

Legend:

Unmodified
Added
Removed
  • bootstrap_libs

    r9737 r9744  
    1 #!/bin/sh
     1#!/bin/bash
     2
     3function catch_errors() {
     4   echo "Script aborted, because an unexpected error occured.";
     5   exit 1;
     6}
     7
     8if [ ! `which wget` ]; then
     9 echo "You need wget for this script. Please install it first, e.g., sudo apt-get install wget. Aborted."
     10 exit 1
     11fi
     12
    213mkdir build
    314
     
    617mkdir libs
    718cd libs
     19
     20# now set the error trap so that re-running the script doesn't fail
     21# on previous directory commands...
     22# this will trap any subsequent errors or commands with non-zero exit status
     23# by calling function catch_errors()
     24trap catch_errors ERR;
     25
    826
    927# apache runtime
     
    3452
    3553# boost 1.39.0
    36 wget http://switch.dl.sourceforge.net/sourceforge/boost/boost_1_39_0.tar.gz
    37 tar xvvzf boost_1_39_0.tar.gz
    38 cd boost_1_39_0
    39 ./bootstrap.sh --libdir=$PREFIX/lib --prefix=$PREFIX --with-libraries=date_time,system,thread,test,regex
     54boostpkg=boost_1_39_0
     55wget http://downloads.sourceforge.net/sourceforge/boost/${boostpkg}.tar.gz || { echo "** Failed to retrieve ${boostpkg}. Please check network connectivity or availability of the package on the server. Stop."; exit 1; }
     56echo -n "Unpacking ${boostpkg}... " &&  tar xzf ${boostpkg}.tar.gz && echo " done."
     57cd ${boostpkg}
     58echo -n "Calling bootstrap.sh ... " && ./bootstrap.sh --libdir=$PREFIX/lib --prefix=$PREFIX --with-libraries="date_time,system,thread,test,regex" >/dev/null && echo " done."
     59echo "Calling bjam. This may take a while..."
    4060./bjam install
    4161cd ..
    4262
    4363# gnu multiprecision library
    44 wget ftp://ftp.gmplib.org/pub/gmp-4.3.1/gmp-4.3.1.tar.gz
    45 tar xvvzf gmp-4.3.1.tar.gz
    46 cd gmp-4.3.1
     64gmppkg=gmp-4.3.1
     65wget ftp://ftp.gmplib.org/pub/${gmppkg}/${gmppkg}.tar.gz || { echo "** Failed to retrieve ${gmppkg}. Please check network connectivity or availability of the package on the server. Stop."; exit 1; }
     66echo -n "Unpacking ${gmppkg}... " &&  tar xzf ${gmppkg}.tar.gz  && echo " done."
     67cd ${gmppkg}
    4768./configure --prefix=$PREFIX
    4869make && make install
     
    5374make && make install
    5475
     76echo "Done."
     77
    5578export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PREFIX/lib
     79
     80# end of script
Note: See TracChangeset for help on using the changeset viewer.