#!/bin/bash # run as: ./makegs2.sh # or ./makegs2.sh gnome-lib to check out gnome-lib src from svn # NOT SUPPORTED YET: or run as ./makegs2.sh min # to check out gnome-lib minimal binary from svn (won't be working out # which minimal version is required for now, 32/64 bit, linux/darwin) gsdlhome=`pwd` echo "**** GSDLHOME: $gsdlhome" docheckout=$1 gnomelibsrc=$gsdlhome/ext/gnome-lib gnomelibbin=$gsdlhome/ext/gnome-lib-minimal gnomelib= # 1. grab gnome-lib src (or bin eventually) from svn if told to if [ "x$docheckout" = "xgnome-lib" ]; then if [ ! -d "$gnomelibsrc" ]; then echo "**** $gnomelibsrc doesn't yet exist. Checking out from SVN..." svn co http://svn.greenstone.org/gs2-extensions/gnome-lib/trunk/src ext/gnome-lib fi #elif [ "x$docheckout" = "xmin" ]; then # work out os and bit-architecture # and then can get the correct gnome-lib bin version for this from svn fi # 2. compile gnome-lib if we need to if [ -d "$gnomelibbin" ]; then echo "**** Found a gnomelib binary" gnomelib=$gnomelibbin elif [ -d "$gnomelibsrc" ]; then echo "**** Found a gnomelib src folder" gnomelib=$gnomelibsrc if [ -d "$gnomelibsrc/linux" ]; then echo "*** gnomelib already compiled up in $gnomelibsrc/linux" else echo "*** Going to compile up the $gnomelibsrc folder" cd $gnomelib ./CASCADE-MAKE.sh gnomestatus=$? if [ $gnomestatus != 0 ] ; then echo "****************************************" echo "@@@ Failed to compile up gnomelib successfully" echo "****************************************" exit -1 fi #cd $gsdlhome fi else echo "@@@@ No gnome-lib found.... Proceding to compile without it..." echo "@@@@ Assuming this is what you want (Ctrl-C to cancel compilation)" sleep 3 fi # 3. set up compiling environment to use gnome-lib, if there is a gnome-lib if [ ! -z "$gnomelib" ] ; then echo "***** gnomelib folder: $gnomelib" cd $gnomelib source devel.bash #cd $gsdlhome fi # 4. now can compile as usual, having set up the environment for wvware # chain the commands with && so it stops at that stage after an error cd $gsdlhome ./configure --enable-apache-httpd \ && make \ && make install status=$? echo "****************************************" if [ $status = 0 ] ; then # 5. Message to warn user that the env of this x-term uses gnome-lib # and GUIs may not work from this console echo "*** The environment for this console has been set to compile Greenstone with gnome-lib." echo "*** As a result, graphical applications may not work well." echo "*** In such a case, open a new console." else echo "@@@ Error compiling up Greenstone. Return status: $status" fi echo "****************************************"