- Timestamp:
- 2009-05-12T13:25:00+12:00 (15 years ago)
- Location:
- gli/trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/client-gli.sh
r19392 r19403 24 24 PROGNAME_EN="Greenstone Librarian Interface" 25 25 fi 26 27 # we're running GLI (or FLI) in client mode 28 GLIMODE="client" 26 29 27 30 … … 57 60 thisdir="`cd \"$thisdir\" && pwd`" 58 61 cd "$thisdir" 62 63 ## ---- Determine GSDLHOME to see if the download panel can be enabled ---- 64 # Need to source a script in order to inherit the env vars it has set. 65 # Try to detect a local GSDLHOME installation (need gs2build). If none can 66 # be found, then client-gli won't have a download panel. We're calling 67 # findgsdl.bat purely for knowing if there's a GSDLHOME around and to set and 68 # use that for downloading. If there IS a local GSDLHOME, then we can download 69 # (and build) locally, but ONLY if we have perl. Else downloading and building 70 # will have to be done remotely anyway. If Perl is found, PERLPATH will be set. 71 source ./findgsdl.sh 72 local_gs="false" 73 if [ "x$GSDLHOME" != "x" ] ; then 74 # GSDLHOME set, test for perl 75 # no need to source the findperl script since it does not set env vars 76 exit_status=0 77 ./findperl.sh 78 exit_status=$? 79 if [ "$exit_status" -ne 1 ]; then 80 local_gs="true" 81 fi 82 fi 83 59 84 60 85 ## ---- findJava ---- … … 108 133 109 134 # GS2 only requires -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar. GS3 requires more but it doesn't conflict with GS2: 110 if [ ! -d "${thisdir}/gs2build" ]; then 135 if [ "$local_gs" = "false" ]; then 136 echo "Since there's no GSDLHOME, client-GLI's download panel will be deactivated." 137 echo 111 138 $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone $* 112 139 else 113 140 gsdlos=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 114 # check for running bash under cygwin141 # check for running bash under cygwin 115 142 if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ; then 116 143 gsdlos=windows 117 144 fi 118 $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "${thisdir}/gs2build" -gsdlos $gsdlos $* 145 echo "Perl and GSDLHOME ($GSDLHOME) detected." 146 echo "Downloading is enabled." 147 echo 148 $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "$GSDLHOME" -gsdlos $gsdlos $* 119 149 fi 120 150 -
gli/trunk/findjava.sh
r19355 r19403 1 2 1 # We will already be in the correct folder (GLI folder), which would 3 2 # contain a compiled up search4j if this GLI is part of an installation. … … 10 9 MIN_DISPLAY_VERSION=${1}; 11 10 12 echo "JAVAHOME: $JAVA_HOME"13 11 if [ "x$JAVA_HOME" = "x" -o ! -f "$JAVA_HOME/bin/java" ]; then 14 12 return no_java "$MIN_DISPLAY_VERSION" -
gli/trunk/gli.sh
r19392 r19403 1 1 #!/bin/bash 2 3 # Function that, when given gsdlpath as parameter, will return the4 # version of greenstone that is to run (2 or 3). If things are not,5 # this program will exit here.6 function get_version {7 # first parameter is value of gsdlpath8 if [ -f "${1}/gs3-setup.sh" ]; then9 return 310 elif [ -f "${1}/setup.bash" ]; then11 return 212 else13 echo "Error: can't determine which Greenstone version is being run."14 exit 115 fi16 }17 18 # Function that is passed the following paramters (in order):19 # - the gsdlpath (GS3 home, GS2 home or gs2build for GS3),20 # - the version of greenstone that's running, and21 # - the language GLI is set to22 # and checks the installation.23 # If things are not right, this program will exit here.24 function check_installation {25 # Check that the Greenstone installation looks OK26 if [ "$3" = "es" ]; then27 echo "Revisando GSDL$2: $1"28 elif [ "$3" = "fr" ]; then29 echo "Vérification de GSDL$2: $1"30 elif [ "$3" = "ru" ]; then31 echo "ðÒÏ×ÅÒËÁ GSDL$2: $1"32 else33 echo "Checking GSDL$2: $1"34 fi35 # even if we are only checking for gs2build (gsdl2path), we still36 # need the file setup.bash to exist in the following condition:37 if [ ! -f "${1}/gs3-setup.sh" -a ! -f "${1}/setup.bash" ] ; then38 echo39 if [ "$3" = "es" ]; then40 echo "No se pudo encontrar la instalación de Greenstone $2 o está incompleta."41 echo "Trate de reinstalar Greenstone $2 y a continuación ejecute nuevamente"42 echo "este guión."43 elif [ "$3" = "fr" ]; then44 echo "L'installation de Greenstone $2 est introuvable ou incomplète."45 echo "Essayez de réinstaller Greenstone $2 et exécutez ce script à nouveau."46 elif [ "$3" = "ru" ]; then47 echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone $_version ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."48 echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone $2, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."49 else50 echo "The Greenstone $2 installation could not be found, or is incomplete."51 echo "Try reinstalling Greenstone $2 then running this script again."52 fi53 exit 154 fi55 }56 2 57 3 glilang=en … … 75 21 if [ "x$PROGNAME_EN" = "x" ] ; then 76 22 PROGNAME_EN="Greenstone Librarian Interface" 23 fi 24 25 if [ "x$GLIMODE" = "x" ] ; then 26 GLIMODE="local" 77 27 fi 78 28 … … 111 61 112 62 ## ---- Determine GSDLHOME ---- 113 ## gsdlpath can be either Greenstone 3 or Greenstone 2 114 gsdlpath= 115 # Some users may set the above line manually 116 117 118 # This variable is set automatically: 119 _version= 120 if [ "x$gsdlpath" != "x" ]; then 121 get_version "$gsdlpath" 122 _version=$? 123 # otherwise $gsdlpath is not yet set 124 else 125 # Check the environment variable first 126 # Check whether environment variables for both GS2 and GS3 are set 127 # and if so, warn the user that we have defaulted to GS3 128 if [ "x$GSDLHOME" != "x" -a "x$GSDL3SRCHOME" != "x" ]; then 129 # _version not set, but both env vars set, so default to 3 130 _version=3 131 gsdlpath=$GSDL3SRCHOME 132 echo "Both Greenstone 2 and Greenstone 3 environments are set." 133 echo "It is assumed you want to run Greenstone 3." 134 echo "If you want to run Greenstone 2, please unset the" 135 echo "environment variable GSDL3SRCHOME before running GLI." 136 echo "" 137 elif [ "x$GSDL3SRCHOME" != "x" ]; then 138 echo "Only gsdl3srchome set" 139 gsdlpath=$GSDL3SRCHOME 140 _version=3 141 echo "$gsdlpath" 142 elif [ "x$GSDLHOME" != "x" ]; then 143 gsdlpath=$GSDLHOME 144 _version=2 145 # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone 146 else 147 gsdlpath=`(cd .. && pwd)` 148 # Still need to find what version we are running: 149 # GS3 main directory contains file gs3-setup.sh, GS2 only setup.bash 150 get_version "$gsdlpath" 151 _version=$? 152 fi 63 # need to source a script in order to inherit the env vars it has set 64 # Exit on error code (non-zero) 65 exit_status=0 66 source ./findgsdl.sh 67 exit_status=$? 68 if [ "$exit_status" -eq 1 ]; then 69 exit 1; 153 70 fi 154 71 155 echo "Greenstone version found: $_version"156 157 # Check that the main Greenstone installation for the version we're running looks OK158 check_installation "$gsdlpath" "$_version" "$glilang"159 160 161 # Need to source the correct setup file depending on whether we are running162 # gs3 or gs2163 # If we're running version GS2164 if [ "$_version" -eq 2 ]; then165 # Setup Greenstone 2, unless it has already been done166 if [ "x$GSDLHOME" = "x" ]; then167 cd "$gsdlpath"168 . ./setup.bash169 cd "$thisdir"170 fi171 # else, if we're running GS3172 elif [ "$_version" -eq 3 ]; then173 # Setup Greenstone 3, unless it has already been done174 if [ "x$GSDL3HOME" = "x" -o "x$GSDL3SRCHOME" = "x" ]; then175 cd "$gsdlpath"176 . ./gs3-setup.sh177 cd "$thisdir"178 fi179 180 ## if Greenstone version 3 is running, we want to set gsdl2path181 ## ---- Determine GSDLHOME ----182 ## may be already set, or manually entered here.183 gsdl2path=184 185 # Some users may set the above line manually186 if [ "x$gsdl2path" = "x" ]; then187 # Check the environment variable first188 if [ "x$GSDLHOME" != "x" ]; then189 echo "GSDLHOME environment variable is set to $GSDLHOME."190 echo "Will use this to find build scripts."191 gsdl2path=$GSDLHOME192 # If it is not set, assume that the gs2build subdirectory of Greenstone 3 exists193 else194 gsdl2path=$GSDL3SRCHOME/gs2build195 fi196 fi197 # Check that Greenstone 3's Greenstone 2 stuff looks OK (in gs2build)198 check_installation "$gsdl2path" "" "$glilang"199 200 # Setup Greenstone 3's gs2build, unless it has already been done201 if [ "x$GSDLHOME" = "x" ]; then202 cd "$gsdl2path"203 . ./setup.bash204 cd "$thisdir"205 fi206 207 else208 echo "Greenstone version unknown."209 exit 1210 fi211 212 echo213 if [ "x$GSDL3SRCHOME" != "x" ]; then214 echo "GSDL3SRCHOME is: $GSDL3SRCHOME"215 fi216 if [ "x$GSDL3HOME" != "x" ]; then217 echo "GSDL3HOME is: $GSDL3HOME"218 fi219 if [ "x$GSDLHOME" != "x" ]; then220 echo "GSDLHOME is: $GSDLHOME"221 fi222 echo223 224 72 ## ---- find perl ---- 73 # no need to source the findperl script since it does not set env vars 225 74 exit_status=0 226 75 ./findperl.sh
Note:
See TracChangeset
for help on using the changeset viewer.