source: main/trunk/greenstone3/gs3-setup.sh@ 35314

Last change on this file since 35314 was 35314, checked in by davidb, 3 years ago

Some refinement of the (echo) messages generated so the information presented in general doesn't sound quite so scary, when things are in fact still on track

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 19.4 KB
Line 
1# if this file is executed, /bin/sh is used, as we don't start with #!
2# this should work under ash, bash, zsh, ksh, sh style shells.
3
4#the purpose of this file is to check/set up the environment for greenstone3
5#sorts out:
6# - gsdl3home
7# - java
8
9# java_min_version gets passed to search4j as the minimum java version
10java_min_version=1.5.0_00
11DEBUG=false
12
13function testSource(){
14
15 if test "$0" != "`echo $0 | sed s/gs3-setup\.sh//`" ; then
16 # if $0 contains "gs3-setup.sh" we've been run... $0 is shellname if sourced.
17 # One exception is zsh has an option to set it temporarily to the script name
18 if test -z "$ZSH_NAME" ; then
19 # we aren't using zsh
20 gsdl_not_sourced=true
21 fi
22 fi
23
24 if test -n "$gsdl_not_sourced" ; then
25 echo " Error: Make sure you source this script, not execute it. Eg:"
26 echo " $ source gs3-setup.sh"
27 echo " or"
28 echo " $ . gs3-setup.sh"
29 echo " not"
30 echo " $ ./gs3-setup.sh"
31 unset gsdl_not_sourced
32 exit 1
33 fi
34
35 if test ! -f gs3-setup.sh ; then
36 echo "You must source the script from within the Greenstone home directory"
37 return 1
38 fi
39 return 0
40}
41
42# if GSDL3SRCHOME is set, then we assume that we have already sourced the
43# script so don't do it again. UNLESS, GSDL3SRCHOME doesn't match the
44# current directory in which case it was a different gs3 installation, so lets
45# do it now.
46function testAlreadySourced() {
47 if [ ! -z "$GSDL3SRCHOME" ]; then
48 localgs3sourcehome="`pwd`"
49 if [ "$GSDL3SRCHOME" = "$localgs3sourcehome" ]; then
50 echo "Your environment is already set up for Greenstone3"
51 return 1
52 fi
53 echo "Your environment was set up for Greenstone 3 in $GSDL3SRCHOME."
54 echo "Overwriting that set up for the current Greenstone 3 in $localgs3sourcehome"
55 fi
56 return 0
57}
58
59function setGS3ENV() {
60
61 echo "Setting up your environment for Greenstone3"
62 ## main greenstone environment variables ##
63 GSDL3SRCHOME="`pwd`"
64 GSDL3HOME="$GSDL3SRCHOME/web"
65 export GSDL3HOME
66 export GSDL3SRCHOME
67
68 if test "x$GSDLOS" = "x" ; then
69 GSDLOS=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
70 # check for running bash under cygwin
71 if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ; then
72 GSDLOS=windows
73 fi
74 fi
75 export GSDLOS
76 echo " - Exported GSDL3HOME=$GSDL3HOME"
77 echo " GSDL3SRCHOME=$GSDL3SRCHOME"
78 echo " GSDLOS=$GSDLOS"
79
80 #change this if external tomcat
81 TOMCAT_HOME="$GSDL3SRCHOME/packages/tomcat"
82
83 ## adjustments to users (existing) environment ##
84
85 #PATH
86 addtopath PATH "$GSDL3SRCHOME/bin/script"
87 addtopath PATH "$GSDL3SRCHOME/bin"
88 echo " - Adjusted PATH"
89 if [ "$DEBUG" = "true" ]; then
90 echo " = $PATH"
91 fi
92
93 #MANPATH
94 addtopath MANPATH "$GSDL3SRCHOME/doc/man"
95 echo " - Adjusted MANPATH"
96 if [ "$DEBUG" = "true" ]; then
97 echo " = $MANPATH"
98 fi
99
100 #CLASSPATH
101 addtopath CLASSPATH "."
102 addtopath CLASSPATH "$GSDL3HOME/WEB-INF/classes"
103 addtopath CLASSPATH "$GSDL3SRCHOME/resources/java"
104 addtopath CLASSPATH "$GSDL3SRCHOME/cp.jar"
105
106 # Greenstone JAR files
107 for JARFILE in "$GSDL3HOME/WEB-INF/lib"/*.jar; do
108 addtopath CLASSPATH "$JARFILE"
109 done
110
111 # Tomcat 5 jar files
112 if test -d "$TOMCAT_HOME"/common/endorsed ; then
113 for JARFILE in "$TOMCAT_HOME"/common/endorsed/*.jar; do
114 addtopath CLASSPATH "$JARFILE"
115 done
116 fi
117 # Tomcat 6 jar files
118 if test -d "$TOMCAT_HOME"/lib ; then
119 for JARFILE in "$TOMCAT_HOME"/lib/*.jar; do
120 addtopath CLASSPATH "$JARFILE"
121 done
122 fi
123
124 #shouldn't need these as they will have been copied to their correct locations elsewhere in the greenstone3 installation
125 #for JARFILE in "$GSDL3SRCHOME"/build/*.jar; do
126 # addtopath CLASSPATH "$JARFILE"
127 #done
128
129 echo " - Adjusted CLASSPATH"
130 if [ "$DEBUG" = "true" ]; then
131 echo " = $CLASSPATH"
132 fi
133
134 #LD_LIBRARY_PATH
135 addtopath LD_LIBRARY_PATH "$GSDL3SRCHOME/lib/jni"
136 addtopath DYLD_LIBRARY_PATH "$GSDL3SRCHOME/lib/jni"
137 echo " - Adjusted LD_LIBRARY_PATH"
138 if [ "$DEBUG" = "true" ]; then
139 echo " = $LD_LIBRARY_PATH"
140 fi
141
142 echo " - Adjusted DYLD_LIBRARY_PATH"
143 if [ "$DEBUG" = "true" ]; then
144 echo " = $DYLD_LIBRARY_PATH"
145 fi
146
147 #ImageMagick
148 #if test -d "$GSDL3SRCHOME/gs2build/bin/$GSDLOS/imagemagick" ; then
149 # addtopath PATH "$GSDL3SRCHOME/gs2build/bin/$GSDLOS/imagemagick/bin"
150 # MAGICK_HOME="$GSDL3SRCHOME/gs2build/bin/$GSDLOS/imagemagick"
151 # export MAGICK_HOME
152 # if test "$GSDLOS" = "linux"; then
153 # addtopath LD_LIBRARY_PATH "$GSDL3SRCHOME/gs2build/bin/$GSDLOS/imagemagick/lib"
154 # elif test "$GSDLOS" = "darwin"; then
155 # addtopath DYLD_LIBRARY_PATH "$GSDL3SRCHOME/gs2build/bin/$GSDLOS/imagemagick/lib"
156 # fi
157 # echo " - Setup ImageMagick"
158 #fi
159
160 #Ghostscript
161 if test -d "$GSDL3SRCHOME/gs2build/bin/$GSDLOS/ghostscript"; then
162 addtopath PATH "$GSDL3SRCHOME/gs2build/bin/$GSDLOS/ghostscript/bin"
163 GS_LIB="$GSDL3SRCHOME/gs2build/bin/$GSDLOS/ghostscript/share/ghostscript/8.63/lib"
164 export GS_LIB
165 GS_FONTPATH="$GSDL3SRCHOME/gs2build/bin/$GSDLOS/ghostscript/share/ghostscript/8.63/Resource/Font"
166 export GS_FONTPATH
167 echo " - Setup GhostScript"
168 fi
169
170 #wvWare
171 # wvWare's environment is now set up by bin/script/wvware.pl
172 # The wvware.pl script can be called from the cmdline to perform wvware tasks.
173 # GLI calls gsConvert.pl which calls wvware.pl to similarly perform wvware tasks.
174# if test -d "$GSDL3SRCHOME/gs2build/bin/$GSDLOS/wv"; then
175# if test "$GSDLOS" = "linux"; then
176# addtopath LD_LIBRARY_PATH "$GSDL3SRCHOME/gs2build/bin/$GSDLOS/wv/lib"
177# elif test "$GSDLOS" = "darwin"; then
178# addtopath DYLD_LIBRARY_PATH "$GSDL3SRCHOME/gs2build/bin/$GSDLOS/wv/lib"
179# fi
180# echo " - Setup wvWare"
181# fi
182
183}
184
185function checkJava() {
186
187 # we now include a JRE with Mac (Mountain) Lion too, because from Yosemite onwards there's no system Java on Macs
188 BUNDLED_JRE="`pwd`/packages/jre"
189 HINT=$BUNDLED_JRE
190
191 if [ "$GSDLOS" = "darwin" ]; then
192 # try $JAVA_HOME first, if it is set
193 if [ "$JAVA_HOME" != "" ] && [ -d "$JAVA_HOME" ]; then
194 HINT=$JAVA_HOME
195 elif [ ! -d "$HINT" ]; then
196 #we test for the existence of bundled_jre - will be present in binary release. Use that if it is there as we know that it works with GS
197 # but if its not there, try the following:
198 # this will print out the path to java
199 HINT=`/usr/libexec/java_home`
200 # old code used as fallback:
201 # But actually this is not valid for Mojave and Catalina
202 if [ ! -d "$HINT" ]; then
203 HINT=/System/Library/Frameworks/JavaVM.framework/Home
204 fi
205 fi
206 fi
207
208 if [ "$DEBUG" = "true" ]; then echo "**********************************************"; fi
209
210 # If the file utility exists, use it to determine the bitness of this GS3,
211 # particularly of this GS3's lib/jni/libgdbmjava.so/jnilib, since we prefer a matching java
212 # If any executable doesn't exist, the return value is 127.
213 # If file utility exists, then 0 is returned on successful execution, 1 is an error exit code
214 # Running file without arg returns 1 therefore.
215
216 # Determine the bitness of this GS3 installation, by running:
217 # `file lib/jni/libgdbmjava.so/jnilib`
218 # Output:
219 # lib/jni/libgdbmjava.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV),
220 # dynamically linked, BuildID[sha1]=5ae42cf69275408bdce97697d69e9e6fd481420d, not stripped
221 # On 32-bit linux, the output will contain "lib/jni/libgdbmjava.so: ELF 32-bit ..."
222 # Check output string contains bitness: http://stackoverflow.com/questions/229551/string-contains-in-bash
223
224 fileexists=`file 2&> /dev/null`
225
226 TESTFILE="$GSDL3SRCHOME/lib/jni/libgdbmjava.so"
227 if test "$GSDLOS" = "darwin"; then
228 TESTFILE="$GSDL3SRCHOME/lib/jni/libgdbmjava.jnilib"
229 fi
230
231 # Integer comparison, http://tldp.org/LDP/abs/html/comparison-ops.html
232 # can also use double brackets: if [[ $? > 1 ]]; then ...
233 if [ "$?" -gt "1" ]; then
234 if [ "$DEBUG" = "true" ]; then
235 echo " 'file' utility not found installed on this unix-based system."
236 echo " Unable to use 'file' utility to determine bitness of this GS3 to see if it matches that of any Java found."
237 fi
238 bitness=-1
239 elif [ ! -f "$TESTFILE" ]; then
240 # the file we want to test the bitness of, to determine GS3's bitness by, doesn't exist yet
241# echo " $TESTFILE is not found, unable to determine bitness of this Greenstone3"
242 echo " - No JNI files detected. Skipping Java bitness test"
243 bitness=-1
244 else
245 bitness=`file $TESTFILE`
246 if [[ $bitness = *"64-bit"* ]]; then
247 bitness=64
248# echo "The installed Greenstone is $bitness bit"
249 elif [[ $bitness = *"32-bit"* ]]; then
250 bitness=32
251# echo "The installed Greenstone is $bitness bit"
252 else
253 bitness=-1
254 echo "WARNING: Greenstone installation is of unknown bitness. \"$bitness\" is neither '32-bit' nor '64-bit'"
255 fi
256 echo "JNI bitness test: $bitness"
257 fi
258
259 # If search4j is present, use it to locate a java.
260 # If search4j finds a Java, then:
261 # - If its bitness doesn't match and there's a bundled jre, use the bundled jre instead.
262 # - If its bitness doesn't match and there's no bundled jre, use the java found by search4j anyway,
263 # we'll print a warning about this bitness mismatch at the end
264
265 echo ""
266 echo "Checking for Java"
267
268 javaset=false
269 if [ -x bin/search4j ] ; then
270 FOUNDJAVAHOME="`bin/search4j -d -p \"$HINT\" -m $java_min_version`"
271 javahome_retval=$?
272 FOUNDJREHOME="`bin/search4j -r -p \"$HINT\" -m $java_min_version`"
273 jrehome_retval=$?
274 fi
275
276 # 1. check the bitness of any JDK java found by search4j, and use if appropriate
277 if [ "$javahome_retval" = "0" ]; then
278 setJavaIfOK "$DEBUG" "$bitness" "$FOUNDJAVAHOME" "JDK"
279 if [ "$?" = "0" ]; then javaset="true"; fi
280 fi
281
282 # 2. check the bitness of any JRE java found by search4j, and use if appropriate
283 if [ "$javaset" != "true" ] && [ "$jrehome_retval" = "0" ]; then
284 setJavaIfOK "$DEBUG" "$bitness" "$FOUNDJREHOME" "JRE"
285 if [ "$?" = "0" ]; then javaset="true"; fi
286 fi
287
288 # 3. check the bitness of any bundled JRE, and use if appropriate
289 # For linux, the bundled JRE ought to be of a bitness matching this OS.
290 if [ "$javaset" != "true" ] && [ -d "$BUNDLED_JRE" ]; then
291 setJavaIfOK "$DEBUG" "$bitness" "$BUNDLED_JRE" "bundled JRE"
292 if [ "$?" = "0" ]; then javaset="true"; fi
293 fi
294
295
296 # 4. None of the java found so far (via search4j, bundled_jre), if any, may have matched bitness wise
297 # So, fall back to using whichever is available in sequence anyway.
298 # We'll print a warning of bitness mismatch later
299
300 if [ "$javaset" != "true" ]; then
301 # go with any JAVA_HOME else JRE_HOME that search4j found, else with any bundled JRE if present
302 if [ "$javahome_retval" = "0" ]; then
303 setupJavaAt "$FOUNDJAVAHOME" "JDK"
304 javaset=true
305 elif [ "$jrehome_retval" = "0" ]; then
306 setupJavaAt "$FOUNDJREHOME" "JRE"
307 javaset=true
308 elif [ -d "$BUNDLED_JRE" ]; then
309 # bundled JRE should be >= than minimum version of java required
310 setupJavaAt "$BUNDLED_JRE" "JRE"
311 javaset=true
312 fi
313 fi
314
315 # 5. lastly, manually check if java already setup. Could be the case if search4j didn't exist
316 if [ "$javaset" != "true" ]; then
317
318 if [ -x bin/search4j ]; then
319
320 # no suitable java could be found by search4j
321 echo " - ERROR: Failed to locate java $java_min_version or greater"
322 echo " Please set JAVA_HOME or JRE_HOME to point to an appropriate java"
323 echo " And add JAVA_HOME/bin or JRE_HOME/bin to your PATH"
324
325 else
326 # search4j wasn't present, and no bundled JRE, so check JAVA_HOME or JRE_HOME manually
327 #echo "*** Could not find an appropriate JDK or JRE java"
328 #echo "*** Attempting to use JAVA_HOME else JRE_HOME in the environment"
329 echo " - search4j' not detected. Checking for Java explicitly set through environment variables"
330 if [ "$JAVA_HOME" != "" ] && [ "`which java`" = "$JAVA_HOME/bin/java" ]; then
331 echo " - Using Java at $JAVA_HOME"
332 if [ "$DEBUG" = "true" ] ; then
333 echo " - Detected Java version: `$JAVA_HOME/bin/java -version 2>&1 | head -n 1`"
334 echo " - Note that Greenstone requires Java 1.5 or greater"
335# echo " - WARNING: Greenstone has not checked the version number of this java installation"
336# echo " The source distribution of Greenstone3 requires java 1.5 or greater"
337 # echo " (SVN users may still use java 1.4)"
338 fi
339 elif [ "$JRE_HOME" != "" ] && [ "`which java`" = "$JRE_HOME/bin/java" ]; then
340 echo " - Using java at $JRE_HOME"
341 if [ "$DEBUG" = "true" ] ; then
342 echo " - Detected Java version: `$JAVA_HOME/bin/java -version 2>&1 | head -n 1`"
343 echo " - Note that Greenstone requires Java 1.5 or greater"
344# echo " - WARNING: Greenstone has not checked the version number of this java installation"
345# echo " The source distribution of Greenstone3 requires java 1.5 or greater"
346# echo " (SVN users may still use java 1.4)"
347 fi
348 #failing all that, print a warning
349 else
350 echo " - Did not detect 'java' via JAVA_HOME or JRE_HOME"
351 echo "Testing for 'java' on PATH"
352 command -v java
353 if [ $? != 0 ] ; then
354 #no suitable java exists
355 echo " - Error: Failed to locate 'java'"
356 echo " Please set JAVA_HOME or JRE_HOME to point to an appropriate java"
357 echo " And add JAVA_HOME/bin or JRE_HOME/bin to your PATH"
358 return
359 fi
360 fi
361 fi
362 fi
363
364 # If we know the bitness of this GS3 installation, then warn if there's a mismatch
365 # with the bitness of the Java found
366
367 if [ "$bitness" != "-1" ]; then
368 if [ "$JAVA_HOME" != "" ]; then
369 JAVA_FOUND=$JAVA_HOME
370 elif [ "$JRE_HOME" != "" ]; then
371 JAVA_FOUND=$JRE_HOME
372 fi
373 checkJavaBitnessAgainstGSBitness "$JAVA_FOUND" "$bitness"
374 if [ "$?" = "1" ]; then
375 echo "*** WARNING: Detected mismatch between the bit-ness of your GS installation ($bitness bit)"
376 echo "*** and the Java found at $JAVA_FOUND/bin/java"
377 echo "*** Continuing with this Java anyway:"
378 echo "*** This will only affect MG/MGPP collections for searching, and GDBM database collections"
379 echo "*** Else set JAVA_HOME or JRE_HOME to point to an appropriate $bitness bit Java"
380 echo "*** Or recompile GS with your system Java:"
381 if [ "$JAVA_HOME" != "" ]; then
382 echo "*** JAVA_HOME at $JAVA_HOME"
383 else
384 echo "*** JRE_HOME at $JRE_HOME"
385 fi
386 fi
387 fi
388
389 if [ "$DEBUG" = "true" ]; then echo "**********************************************"; fi
390
391}
392
393# http://www.linuxjournal.com/content/return-values-bash-functions
394function setJavaIfOK {
395
396 if [ "$DEBUG" = "true" ]; then echo "Testing java at $3"; fi
397
398 DEBUG=$1
399 bitness=$2
400 PATHTOJAVA=$3
401 JDKorJRE=$4
402
403 checkJavaBitnessAgainstGSBitness "$PATHTOJAVA" "$bitness"
404 check_status=$?
405
406 isjavaset=false
407
408 if [ "$check_status" = "0" ]; then
409 # http://tldp.org/LDP/abs/html/comparison-ops.html
410 if [ "$bitness" != "-1" ] && [ "$DEBUG" = "true" ]; then
411 # java matches GS bitness
412 if [[ "$JDKorJRE" = *"bundled"* ]]; then
413 echo "*** Changing to use Greenstone's $bitness-bit $JDKorJRE at $PATHTOJAVA"
414 else
415 echo " The detected $JDKorJRE at $PATHTOJAVA is a matching $bitness bit"
416 fi
417 fi
418 setupJavaAt "$PATHTOJAVA" "$JDKorJRE"
419 isjavaset=true
420
421 elif [ "$bitness" != "-1" ] && [ "$DEBUG" = "true" ]; then
422 if [[ "$JDKorJRE" = *"bundled"* ]]; then
423 echo " The $JDKorJRE java is an incompatible bit architecture"
424 else
425 echo " The detected $JDKorJRE java is an incompatible bit architecture"
426 fi
427 fi
428
429 if [ "$isjavaset" = "true" ]; then
430 return 0 # success
431 else
432 return 1
433 fi
434}
435
436# if bitness (parameter #2) is -1, then this function returns 0 (generally meaning success).
437function checkJavaBitnessAgainstGSBitness() {
438# if [ "$DEBUG" = "true" ]; then echo "Testing bitness of java found at $java_installation"; fi
439 java_installation="$1"
440 bitness="$2"
441
442 # bitness can be -1 if the 'file' utility could not be found to determine bitness
443 # or if its output no longer prints "32-bit" or "64-bit". Should continue gracefully
444 if [ "$bitness" = "-1" ]; then
445 return 0
446 fi
447
448 # now we can actually work out if the java install's bitness matches that of GS ($bitness)
449 # java -d32 -version should return 0 if the Java is 32 bit, and 1 (failure) if the Java is 64 bit.
450 # Likewise, java -d64 -version will return 0 if the Java is 64 bit, and 1 (failure) if the Java is 32 bit.
451 `$java_installation/bin/java -d$bitness -version 2> /dev/null`
452
453 if [ "$?" = "0" ]; then
454 return 0
455 elif [ "$?" = "1" ]; then
456
457 # Newer Java's don't support -d, so result to using 'file' to determin bitness of 'java' binary
458 java_bitness=`file $java_installation/bin/java`
459 if [[ $java_bitness = *"$bitness-bit"* ]]; then
460 return 0
461 else
462 return 1
463 fi
464 else
465 echo "*** Problem determining bitness of java using java at $java_installation"
466 return $?
467 fi
468}
469
470
471function setupJavaAt() {
472
473 # check the second parameter if non-null
474 if [ -n "$2" ] && [ "$2" = "JRE" ]; then
475 export JRE_HOME="$1"
476 addtopath PATH "$JRE_HOME/bin"
477
478 # ant needs a JAVA_HOME, so set that too, to the JRE
479 export JAVA_HOME="$JRE_HOME"
480
481 BUNDLED_JRE="`pwd`/packages/jre"
482 if [[ "$JRE_HOME" = *"$BUNDLED_JRE"* ]]; then
483 msg="the bundled"
484 fi
485
486 echo " - Exported JRE_HOME and JAVA_HOME to $msg $JRE_HOME"
487 else
488 export JAVA_HOME="$1"
489 addtopath PATH "$JAVA_HOME/bin"
490 echo " - Exported JAVA_HOME to $JAVA_HOME"
491 fi
492
493
494}
495
496function pauseAndExit(){
497 echo -n "Please press any key to continue... "
498 read
499}
500
501function isinpath() {
502 for file in `echo $1 | sed 's/:/ /g'`; do
503 if [ "$file" = "$2" ]; then
504 echo true
505 return
506 fi
507 done
508 echo false
509}
510
511function addtopath() {
512 eval "PV=\$$1"
513 #echo "$1 += $2"
514 if [ "$PV" = "" ]; then
515 cmd="$1=\"$2\""
516 else
517 cmd="$1=\"$2:\$$1\""
518 fi
519 eval $cmd
520 eval "export $1"
521}
522
523# Note: use return not exit from a sourced script otherwise it kills the shell
524testSource
525if [ "$?" = "1" ]; then
526return
527fi
528
529testAlreadySourced
530if [ "$?" = "1" ]; then
531return
532fi
533
534setGS3ENV
535
536if test -e gs2build/setup.bash ; then
537 echo ""
538 echo "Sourcing gs2build/setup.bash"
539 cd gs2build ; source setup.bash ; cd ..
540fi
541
542
543if test "x$gsopt_noexts" != "x1" ; then
544 if test -e ext ; then
545 for gsdl_ext in ext/* ; do
546 if [ -d $gsdl_ext ] ; then
547 cd $gsdl_ext > /dev/null
548 if test -e gs3-setup.sh ; then
549 source ./gs3-setup.sh
550 elif test -e setup.bash ; then
551 source ./setup.bash
552 fi
553 cd ../..
554 fi
555 done
556 fi
557fi
558
559if test -e local ; then
560 if test -e local/gs3-setup.sh ; then
561 echo ""
562 echo "Sourcing local/gs3-setup.sh"
563 cd local ; source gs3-setup.sh ; cd ..
564 fi
565fi
566
567
568checkJava
569echo ""
570
571# Ant
572echo "Checking for Ant"
573#Note: No longer need to print out info about minimum version of Ant needed
574# for Greenstone3 (v1.7.1 at the time of writing this comment!), as this is
575# now explicitly tested for in the build.xml file, and an error message generated
576# if not new enough
577
578if [ -x "$GSDL3SRCHOME/packages/ant/bin/ant" ] ; then
579 ANT_HOME="$GSDL3SRCHOME/packages/ant"
580 export ANT_HOME
581 addtopath PATH "$ANT_HOME/bin"
582 echo " - Setup Greenstone ant ($GSDL3SRCHOME/packages/ant)"
583else
584 if [ "x$ANT_HOME" != "x" ] ; then
585 addtopath PATH "$ANT_HOME/bin"
586 echo " - `ant -version`"
587 else
588 which ant &> /dev/null
589 if [ "$?" = "0" ] ; then
590 echo " - System install ant detected"
591 echo " - `ant -version`"
592 else
593 echo " - WARNING: Failed to find 'ant'"
594 fi
595 fi
596fi
597
598echo "done"
599
Note: See TracBrowser for help on using the repository browser.