source: trunk/gli/gli.sh@ 4956

Last change on this file since 4956 was 4956, checked in by mdewsnip, 21 years ago

Fixed "has been compiled" test.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1#!/bin/sh
2
3
4## -- Run the Greenstone Librarian Interface --
5
6# Script must be run from within the directory in which it lives
7thisdir=`pwd`
8if [ ! -f "${thisdir}/gli.sh" ]; then
9 echo "This script must be run from the directory in which it resides."
10 exit 1
11fi
12
13
14## -- Determine GSDLHOME --
15gsdlhome=/research/mdewsnip/gsdl
16
17# Some users may set the above line manually
18if [ "$gsdlhome" == "" ]; then
19 # Check the environment variable first
20 if [ "$GSDLHOME" != "" ]; then
21 gsdlhome=$GSDLHOME
22
23 # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone
24 else
25 pushd .. > /dev/null
26 gsdlhome=`pwd`
27 popd > /dev/null
28 fi
29fi
30
31# Check that the Greenstone installation looks OK
32if [ ! -x "${gsdlhome}/setup.bash" ] ; then
33 echo "The Greenstone installation at ${gsdlhome} does not"
34 echo "appear to be complete. Try reinstalling Greenstone then running"
35 echo "this script again."
36 exit 1
37fi
38
39# Setup Greenstone
40pushd $gsdlhome > /dev/null
41source setup.bash
42echo
43popd > /dev/null
44
45
46## -- Check Perl exists --
47perlpath=
48
49# Some users may set the above line manually
50if [ "$perlpath" == "" ]; then
51 # Try to find it on the search path
52 perlpath=`which perl 2> /dev/null`
53fi
54
55if [ ! -x "$perlpath" ] ; then
56 echo "The Greestone Librarian Interface requires perl in order to operate but"
57 echo "this installation could not detect perl on your system. Please ensure"
58 echo "that perl is installed and is on your search path, then rerun this"
59 echo "script."
60 exit 1
61fi
62
63
64## -- Check Java exists --
65javapath=
66
67# Some users may set the above line manually
68if [ "$javapath" == "" ]; then
69 # Check the environment variable first
70 if [ "$JAVAHOME" != "" ]; then
71 javapath="$JAVAHOME/bin/java"
72
73 # If it is not set, hope it is on the search path
74 else
75 javapath=`which java 2> /dev/null`
76 fi
77fi
78
79if [ ! -x "$javapath" ]; then
80 echo "Failed to locate Java. You must install a Java Runtime Environment"
81 echo "(version 1.4 or greater) before running the Greenstone Librarian Interface."
82 exit 1
83fi
84
85
86## -- Check the version of Java is new enough (1.4.0 or higher) to run the GLI --
87javaversion=`$javapath -version 2>&1 | sed -n 's/^java version \"\(.*\)\"/\1/p'`
88jvmajor=`echo $javaversion | sed -n 's/^\([0-9]*\).*$/\1/p'`
89jvminor=`echo $javaversion | sed -n 's/^[0-9]*\.\([0-9]*\).*$/\1/p'`
90
91jok=1
92if [ $jvmajor -lt 1 ] ; then
93 jok=0
94fi
95if [ $jvmajor -eq 1 ] && [ $jvminor -lt 4 ] ; then
96 jok=0
97fi
98if [ $jok -eq 0 ] ; then
99 echo "The version of the Java Runtime Environment you have installed is too"
100 echo "old to run the Greenstone Librarian Interface. Please install a new version"
101 echo "of the JRE (version 1.4 or newer) and rerun this script."
102 exit 1
103fi
104
105
106## -- Check that the GLI has been compiled --
107if [ ! -f "classes/org/greenstone/gatherer/Gatherer.class" ]; then
108 echo "You need to compile the Greenstone Librarian Interface using makegli.sh"
109 echo "before running this script."
110 exit 1
111fi
112
113
114## -- Finally, run the GLI --
115
116echo "Running the Greenstone Librarian Interface..."
117
118# -Xms32M To set minimum memory
119# -Xmx32M To set maximum memory
120# -verbose:gc To set garbage collection messages
121# -Xincgc For incremental garbage collection
122# -Xprof Function call profiling
123# -Xloggc:<file> Write garbage collection log
124
125java -cp classes/:GLI.jar:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar org.greenstone.gatherer.Gatherer -gsdl $GSDLHOME $*
126
127echo "Done!"
Note: See TracBrowser for help on using the repository browser.