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

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

Some echo statement fine-tuning

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