source: gli/stable/client-gli.sh@ 19562

Last change on this file since 19562 was 19403, checked in by ak19, 15 years ago

3 changes. 1. Moved gli.sh's logic for finding and setting GSDLHOME (and GSDL3SRCHOME and GSDL3HOME) into a separate bashfile: findgsdl.sh. 2. This script is now called by both gli.sh and client-gli.sh, since client-gli can from now on use the same logic to locate a local GS installation. The only difference is that if GSDLHOME is not found, then client-gli runs as before: no Download panel. 3. client-gli.sh will no longer be looking for a gs2build directory located inside a client-gli checkout, but instead search for a local GSDLHOME (including in the directory directly above, in case client-gli.sh is run from a normal GS checkout. IF a GSDLHOME is found (and perl too), then client-gli will enable the Download panel, and use the local GSDLHOME to do any downloading.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 6.3 KB
Line 
1#!/bin/sh
2glilang=en
3
4if [ "x$PROGNAME" = "x" ] ; then
5 PROGNAME="Greenstone"
6 if [ "$glilang" = "es" ]; then
7 PROGFULLNAME="Biblioteca Digital Greenstone"
8 elif [ "$glilang" = "fr" ]; then
9 PROGFULLNAME="Bibliothécaire Greenstone"
10 elif [ "$glilang" = "ru" ]; then
11 PROGFULLNAME="ÉÎÔÅÒÆÅÊÓ Greenstone"
12 else
13 PROGFULLNAME="Greenstone Digital Library"
14 fi
15 else
16 PROGFULLNAME=$PROGNAME
17fi
18
19if [ "x$PROGABBR" = "x" ] ; then
20 PROGABBR="GLI"
21fi
22
23if [ "x$PROGNAME_EN" = "x" ] ; then
24 PROGNAME_EN="Greenstone Librarian Interface"
25fi
26
27# we're running GLI (or FLI) in client mode
28GLIMODE="client"
29
30
31echo
32if [ "$glilang" = "es" ]; then
33 echo "Interfaz de la $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
34 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
35 echo "La Interfaz de la $PROGNAME NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
36 echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
37 echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
38elif [ "$glilang" = "fr" ]; then
39 echo "Interface du $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
40 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
41 echo "$PROGABBR est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
42 echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
43elif [ "$glilang" = "ru" ]; then
44 echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
45 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
46 echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
47 echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
48else
49 echo "$PROGNAME Librarian Interface ($PROGABBR)"
50 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
51 echo "$PROGABBR comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
52 echo "This is free software, and you are welcome to redistribute it"
53fi
54echo
55
56## -------- Run the Greenstone Librarian Interface --------
57# Need to run this script from its own directory instead of whichever directory it may be called from
58#currentdir=$(cd `dirname "$0"` && pwd)
59thisdir="`dirname \"$0\"`"
60thisdir="`cd \"$thisdir\" && pwd`"
61cd "$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.
71source ./findgsdl.sh
72local_gs="false"
73if [ "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
82fi
83
84
85## ---- findJava ----
86# call the script with source, so that we have the variables it sets ($javapath)
87exit_status=0
88source ./findjava.sh
89exit_status=$?
90if [ "$exit_status" -eq 1 ]; then
91 exit 1;
92fi
93
94## ---- Check that the GLI has been compiled ----
95if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
96 echo
97 if [ "$glilang" = "es" ]; then
98 echo "Usted necesita compilar la Interfaz de la $PROGFULLNAME"
99 echo "(por medio de makegli.sh) antes de ejecutar este guión."
100 elif [ "$glilang" = "fr" ]; then
101 echo "Vous devez compiler le $PROGNAME Interface (en utilisant makegli.sh)"
102 echo "avant d'exécuter ce script."
103 elif [ "$glilang" = "ru" ]; then
104 echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME"
105 echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
106 else
107 echo "You need to compile the $PROGNAME Librarian Interface (using makegli.sh)"
108 echo "before running this script."
109 fi
110 exit 1
111fi
112
113
114## ---- Finally, run the GLI ----
115echo
116if [ "$glilang" = "es" ]; then
117 echo "Ejecutando la Interfaz de la $PROGFULLNAME..."
118elif [ "$glilang" = "fr" ]; then
119 echo "Exécution de $PROGNAME Librarian Interface"
120elif [ "$glilang" = "ru" ]; then
121 echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME..."
122else
123 echo "Running the $PROGNAME Librarian Interface..."
124fi
125
126# Other arguments you can provide to GLI to work around memory limitations, or debug
127# -Xms<number>M To set minimum memory (by default 32MB)
128# -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
129# -verbose:gc To set garbage collection messages
130# -Xincgc For incremental garbage collection (significantly slows performance)
131# -Xprof Function call profiling
132# -Xloggc:<file> Write garbage collection log
133
134# GS2 only requires -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar. GS3 requires more but it doesn't conflict with GS2:
135if [ "$local_gs" = "false" ]; then
136 echo "Since there's no GSDLHOME, client-GLI's download panel will be deactivated."
137 echo
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 $*
139else
140 gsdlos=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
141 # check for running bash under cygwin
142 if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ; then
143 gsdlos=windows
144 fi
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 $*
149fi
150
151if [ "$glilang" = "es" ]; then
152 echo "¡Hecho!"
153elif [ "$glilang" = "fr" ]; then
154 echo "Terminé!"
155elif [ "$glilang" = "ru" ]; then
156 echo "÷ÙÐÏÌÎÅÎÏ!"
157else
158 echo "Done!"
159fi
Note: See TracBrowser for help on using the repository browser.