Changeset 6702
- Timestamp:
- 2004-02-03T12:28:09+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/gli.sh
r6670 r6702 1 1 #!/bin/sh 2 glilang= 2 3 3 4 echo 4 echo 'Greenstone Librarian Interface (GLI)' 5 echo 'Copyright (C) 2004, New Zealand Digital Library Project, University Of Waikato' 6 echo 'GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt' 7 echo 'This is free software, and you are welcome to redistribute it' 5 if [ "$glilang" == "ru" ]; then 6 else 7 echo 'Greenstone Librarian Interface (GLI)' 8 echo 'Copyright (C) 2004, New Zealand Digital Library Project, University Of Waikato' 9 echo 'GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt' 10 echo 'This is free software, and you are welcome to redistribute it' 11 fi 8 12 echo 9 13 … … 13 17 thisdir=`pwd` 14 18 if [ ! -f "${thisdir}/gli.sh" ]; then 15 echo "This script must be run from the directory in which it resides." 19 if [ "$glilang" == "ru" ]; then 20 echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ" 21 else 22 echo "This script must be run from the directory in which it resides." 23 fi 16 24 exit 1 17 25 fi … … 36 44 37 45 # Check that the Greenstone installation looks OK 38 echo "Checking GSDL: $gsdlpath" 46 if [ "$glilang" == "ru" ]; then 47 echo "ðÒÏ×ÅÒËÁ GSDL: $gsdlpath" 48 else 49 echo "Checking GSDL: $gsdlpath" 50 fi 39 51 if [ ! -f "${gsdlpath}/setup.bash" ] ; then 40 52 echo 41 echo "The Greenstone installation could not be found, or is incomplete." 42 echo "Try reinstalling Greenstone then running this script again." 53 if [ "$glilang" == "ru" ]; then 54 echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ." 55 echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á." 56 else 57 echo "The Greenstone installation could not be found, or is incomplete." 58 echo "Try reinstalling Greenstone then running this script again." 59 fi 43 60 exit 1 44 61 fi … … 62 79 63 80 # Check that a Perl executable has been found 64 echo "Checking Perl: $perlpath" 81 if [ "$glilang" == "ru" ]; then 82 echo "ðÒÏ×ÅÒËÁ Perl: $perlpath" 83 else 84 echo "Checking Perl: $perlpath" 85 fi 65 86 if [ ! -x "$perlpath" ] ; then 66 87 echo 67 echo "The Greenstone Librarian Interface requires perl in order to operate," 68 echo "but perl could not be detected on your system. Please ensure that perl" 69 echo "is installed and is on your search path, then rerun this script." 88 if [ "$glilang" == "ru" ]; then 89 echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone ÔÒÅÂÕÅÔ Perl, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ" 90 echo "ÒÁÂÏÔÁÔØ, ÎÏ Perl ÎÅ ÂÙÌ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÏÄÔ×ÅÒÄÉÔÅ, ÞÔÏ " 91 echo "Perl ÕÓÔÁÎÏ×ÌÅÎ É ÎÁÈÏÄÉÔÓÑ ÎÁ ×ÁÛÅÍ ÐÕÔÉ ÐÏÉÓËÁ, ÚÁÔÅÍ ÐÏ×ÔÏÒÎÏ××ÅÄÉÔÅ" 92 echo "ÜÔÏÔ ÓËÒÉÐÔ." 93 else 94 echo "The Greenstone Librarian Interface requires perl in order to operate," 95 echo "but perl could not be detected on your system. Please ensure that perl" 96 echo "is installed and is on your search path, then rerun this script." 97 fi 70 98 exit 1 71 99 fi … … 89 117 90 118 # Check that a Java executable has been found 91 echo "Checking Java: $javapath" 119 if [ "$glilang" == "ru" ]; then 120 echo "ðÒÏ×ÅÒËÁ Java: $javapath" 121 else 122 echo "Checking Java: $javapath" 123 fi 92 124 if [ ! -x "$javapath" ]; then 93 125 echo 94 echo "Failed to locate an appropriate version of Java. You must install a" 95 echo "Java Runtime Environment (version 1.4 or greater) before running the" 96 echo "Greenstone Librarian Interface." 126 if [ "$glilang" == "ru" ]; then 127 echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java." 128 echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)" 129 echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ Greenstone." 130 else 131 echo "Failed to locate an appropriate version of Java. You must install a" 132 echo "Java Runtime Environment (version 1.4 or greater) before running the" 133 echo "Greenstone Librarian Interface." 134 fi 97 135 exit 1 98 136 fi … … 113 151 if [ $jok -eq 0 ] ; then 114 152 echo 115 echo "The version of the Java Runtime Environment you have installed is too" 116 echo "old to run the Greenstone Librarian Interface. Please install a new" 117 echo "version of the JRE (version 1.4 or newer) and rerun this script." 118 exit 1 119 fi 120 121 ## ---- Check WGet exists ---- 122 wgetpath= 123 124 wok="NoWGet" 125 126 # Commented out until after UNESCO release 127 # Some users may set the above line manually 128 #if [ "$wgetpath" == "" ]; then 129 # # Check if WGet is on the search path 130 # wgetpath=`which wget 2> /dev/null` 131 #fi 132 133 # Check that a WGet executable has been found 134 #echo "Checking WGet: $wgetpath" 135 #if [ ! -x "$wgetpath" ]; then 136 # echo 137 # echo "Failed to locate an appropriate version of WGet. Web mirroring will" 138 # echo "be disabled. Greenstone Librarian Interface requires WGet installed" 139 # echo "in order to fully access this feature." 140 #else 141 ## -- Check the version of WGet is new enough (1.9 or higher) to run properly -- 142 # wgetversion=`$wgetpath --version 2>&1 | sed -n 's/^GNU Wget \(.*\)/\1/p'` 143 # wvmajor=`echo $wgetversion | sed -n 's/^\([0-9]*\).*$/\1/p'` 144 # wvminor=`echo $wgetversion | sed -n 's/^[0-9]*\.\(.*\)$/\1/p'` 145 146 # wok="WGet1.9" 147 # if [ $wvmajor -lt 1 ] ; then 148 # wok="<WGet1.9" 149 # fi 150 # if [ $wvmajor -eq 1 ] && [ $wvminor -lt 9 ] ; then 151 # wok="<WGet1.9" 152 # fi 153 # if [ $wok == "<WGet1.9" ] ; then 154 # echo 155 # echo "The version of the WGet you have installed has a known bug when" 156 # echo "mirroring files which contain encoded characters such as space and" 157 # echo "tilde in their URL. While this shouldn't be a problem, we recommend" 158 # echo "installing WGet 1.9 or higher." 159 # fi 160 #fi 153 if [ "$glilang" == "ru" ]; then 154 echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ," 155 echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ ÉÎÔÅÒÆÅÊÓÏÍ Greenstone. ðÏÖÁÌÕÊÓÔÁ, " 156 echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É" 157 echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ" 158 else 159 echo "The version of the Java Runtime Environment you have installed is too" 160 echo "old to run the Greenstone Librarian Interface. Please install a new" 161 echo "version of the JRE (version 1.4 or newer) and rerun this script." 162 fi 163 exit 1 164 fi 161 165 162 166 ## ---- Check that the GLI has been compiled ---- 163 167 if [ ! -f "classes/org/greenstone/gatherer/Gatherer.class" ] && [ ! -f "GLI.jar" ]; then 164 168 echo 165 echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)" 166 echo "before running this script." 169 if [ "$glilang" == "ru" ]; then 170 echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone" 171 echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ" 172 else 173 echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)" 174 echo "before running this script." 175 fi 167 176 exit 1 168 177 fi 169 178 170 179 if [ "$1" == "-test" ]; then 171 echo "Testing class: $2" 172 echo "arguments $*" 180 if [ "$glilang" == "ru" ]; then 181 else 182 echo "Testing class: $2" 183 echo "arguments $*" 184 fi 173 185 java -classpath classes/:GLI.jar:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar $2 $3 174 exit 1186 exit 0 175 187 fi 176 188 177 189 ## ---- Finally, run the GLI ---- 178 190 echo 179 echo "Running the Greenstone Librarian Interface..." 191 if [ "$glilang" == "ru" ]; then 192 echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..." 193 else 194 echo "Running the Greenstone Librarian Interface..." 195 fi 180 196 181 197 # Other arguments you can provide to GLI to work around memory limitations, or debug … … 189 205 java -classpath classes/:GLI.jar:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar org.greenstone.gatherer.Gatherer -gsdl $GSDLHOME -wget $wok$wgetpath $* 190 206 191 echo "Done!" 207 if [ "$glilang" == "ru" ]; then 208 echo "÷ÙÐÏÌÎÅÎÏ!" 209 else 210 echo "Done!" 211 fi
Note:
See TracChangeset
for help on using the changeset viewer.