source: tags/gsdl-2_52-distribution/gli/gli4gs3.sh@ 8390

Last change on this file since 8390 was 8254, checked in by mdewsnip, 20 years ago

Removed the crazy jp.jar file. This contained one class: SteppedComboBox, containing hard-wired references to the Gatherer class. Worse, we don't have the source code to this... it should have been part of the GLI, not a separate library.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 13.0 KB
Line 
1#!/bin/sh
2glilang=en
3
4echo
5if [ "$glilang" == "es" ]; then
6 echo "Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)"
7 echo "Copyright (C) 2004, New Zealand Digital Library Project, University Of Waikato"
8 echo "La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
9 echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
10 echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
11elif [ "$glilang" == "fr" ]; then
12 echo "Interface du Bibliothécaire Greenstone (Greenstone Librarian Interface - GLI)"
13 echo "Copyright (C) 2004, New Zealand Digital Library Project, University Of Waikato"
14 echo "GLI est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
15 echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
16elif [ "$glilang" == "ru" ]; then
17 echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone (Greenstone Librarian Interface - GLI)"
18 echo "Copyright (C) 2004, New Zealand Digital Library Project, University Of Waikato"
19 echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
20 echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
21else
22 echo "Greenstone Librarian Interface (GLI)"
23 echo "Copyright (C) 2004, New Zealand Digital Library Project, University Of Waikato"
24 echo "GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
25 echo "This is free software, and you are welcome to redistribute it"
26fi
27echo
28
29## -------- Run the Greenstone Librarian Interface --------
30
31# This script must be run from within the directory in which it lives
32thisdir=`pwd`
33if [ ! -f "${thisdir}/gli4gs3.sh" ]; then
34 if [ "$glilang" == "es" ]; then
35 echo "Este guión deberá ejecutarse desde el directorio en el que reside."
36 elif [ "$glilang" == "fr" ]; then
37 echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
38 elif [ "$glilang" == "ru" ]; then
39 echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
40 else
41 echo "This script must be run from the directory in which it resides."
42 fi
43 exit 1
44fi
45
46
47## ---- Determine GSDL3HOME ----
48gsdl3path=
49
50# Some users may set the above line manually
51if [ "$gsdl3path" == "" ]; then
52 # Check the environment variable first
53 if [ "$GSDL3HOME" != "" ]; then
54 gsdl3path=$GSDL3HOME
55
56 # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone 3
57 else
58 pushd .. > /dev/null
59 gsdl3path=`pwd`
60 popd > /dev/null
61 fi
62fi
63
64# Check that the Greenstone 3 installation looks OK
65if [ "$glilang" == "es" ]; then
66 echo "Revisando GSDL3: $gsdl3path"
67elif [ "$glilang" == "fr" ]; then
68 echo "Vérification de GSDL3: $gsdl3path"
69elif [ "$glilang" == "ru" ]; then
70 echo "ðÒÏ×ÅÒËÁ GSDL3: $gsdl3path"
71else
72 echo "Checking GSDL3: $gsdl3path"
73fi
74if [ ! -f "${gsdl3path}/gs3-setup.sh" ] ; then
75 echo
76 if [ "$glilang" == "es" ]; then
77 echo "No se pudo encontrar la instalación de Greenstone 3 o está incompleta."
78 echo "Trate de reinstalar Greenstone 3 y a continuación ejecute nuevamente"
79 echo "este guión."
80 elif [ "$glilang" == "fr" ]; then
81 echo "L'installation de Greenstone 3 est introuvable ou incomplète."
82 echo "Essayez de réinstaller Greenstone 3 et exécutez ce script à nouveau."
83 elif [ "$glilang" == "ru" ]; then
84 echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone 3 ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
85 echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone 3, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
86 else
87 echo "The Greenstone 3 installation could not be found, or is incomplete."
88 echo "Try reinstalling Greenstone 3 then running this script again."
89 fi
90 exit 1
91fi
92
93# Setup Greenstone 3, unless it has already been done
94if [ "$GSDL3HOME" == "" ]; then
95 pushd $gsdl3path > /dev/null
96 source gs3-setup.sh
97 popd > /dev/null
98fi
99
100
101## ---- Determine GSDLHOME ----
102gsdlpath=
103
104# Some users may set the above line manually
105if [ "$gsdlpath" == "" ]; then
106 # Check the environment variable first
107 if [ "$GSDLHOME" != "" ]; then
108 gsdlpath=$GSDLHOME
109
110 # If it is not set, assume that the gs2extra subdirectory of Greenstone 3 exists
111 else
112 gsdlpath=$GSDL3HOME/gs2extra
113 fi
114fi
115
116# Check that the Greenstone installation looks OK
117if [ "$glilang" == "es" ]; then
118 echo "Revisando GSDL: $gsdlpath"
119elif [ "$glilang" == "fr" ]; then
120 echo "Vérification de GSDL: $gsdlpath"
121elif [ "$glilang" == "ru" ]; then
122 echo "ðÒÏ×ÅÒËÁ GSDL: $gsdlpath"
123else
124 echo "Checking GSDL: $gsdlpath"
125fi
126if [ ! -f "${gsdlpath}/setup.bash" ] ; then
127 echo
128 if [ "$glilang" == "es" ]; then
129 echo "No se pudo encontrar la instalación de Greenstone o está incompleta."
130 echo "Trate de reinstalar Greenstone y a continuación ejecute nuevamente"
131 echo "este guión."
132 elif [ "$glilang" == "fr" ]; then
133 echo "L'installation de Greenstone est introuvable ou incomplète."
134 echo "Essayez de réinstaller Greenstone et exécutez ce script à nouveau."
135 elif [ "$glilang" == "ru" ]; then
136 echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
137 echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
138 else
139 echo "The Greenstone installation could not be found, or is incomplete."
140 echo "Try reinstalling Greenstone then running this script again."
141 fi
142 exit 1
143fi
144
145# Setup Greenstone, unless it has already been done
146if [ "$GSDLHOME" == "" ]; then
147 pushd $gsdlpath > /dev/null
148 source setup.bash
149 popd > /dev/null
150fi
151
152
153## ---- Check Perl exists ----
154perlpath=
155
156# Some users may set the above line manually
157if [ "$perlpath" == "" ]; then
158 # Check if Perl is on the search path
159 perlpath=`which perl 2> /dev/null`
160fi
161
162# Check that a Perl executable has been found
163if [ "$glilang" == "es" ]; then
164 echo "Revisando Perl: $perlpath"
165elif [ "$glilang" == "fr" ]; then
166 echo "Vérification de Perl: $perlpath"
167elif [ "$glilang" == "ru" ]; then
168 echo "ðÒÏ×ÅÒËÁ Perl: $perlpath"
169else
170 echo "Checking Perl: $perlpath"
171fi
172if [ ! -x "$perlpath" ] ; then
173 echo
174 if [ "$glilang" == "es" ]; then
175 echo "La Interfaz de la Biblioteca Digital Greenstone requiere Perl para "
176 echo "poder operar, pero éste no aparece en su sistema. Por favor asegúrese "
177 echo "de que Perl está instalado y se encuentra en su ruta de búsqueda. A "
178 echo "continuación ejecute nuevamente este guión."
179 elif [ "$glilang" == "fr" ]; then
180 echo "Greenstone Librarian Interface nécessite perl pour son fonctionnement,"
181 echo "mais perl n'a pas pu être détecté dans votre système. Veuillez vous "
182 echo "assurer que perl est installé et est spécifié dans votre chemin de "
183 echo "recherche, puis redémarrez ce script."
184 elif [ "$glilang" == "ru" ]; then
185 echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone ÔÒÅÂÕÅÔ Perl, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ"
186 echo "ÒÁÂÏÔÁÔØ, ÎÏ Perl ÎÅ ÂÙÌ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÏÄÔ×ÅÒÄÉÔÅ, ÞÔÏ "
187 echo "Perl ÕÓÔÁÎÏ×ÌÅÎ É ÎÁÈÏÄÉÔÓÑ ÎÁ ×ÁÛÅÍ ÐÕÔÉ ÐÏÉÓËÁ, ÚÁÔÅÍ ÐÏ×ÔÏÒÎÏ××ÅÄÉÔÅ"
188 echo "ÜÔÏÔ ÓËÒÉÐÔ."
189 else
190 echo "The Greenstone Librarian Interface requires perl in order to operate,"
191 echo "but perl could not be detected on your system. Please ensure that perl"
192 echo "is installed and is on your search path, then rerun this script."
193 fi
194 exit 1
195fi
196
197
198## ---- Check Java exists ----
199javapath=
200
201# Some users may set the above line manually
202if [ "$javapath" == "" ]; then
203
204 # If it is set, use the JAVA_HOME environment variable
205 if [ "$JAVA_HOME" != "" ]; then
206 javapath="$JAVA_HOME/bin/java"
207
208 # Check if Java is on the search path
209 else
210 javapath=`which java 2> /dev/null`
211 fi
212fi
213
214# Check that a Java executable has been found
215if [ "$glilang" == "es" ]; then
216 echo "Revisando Java: $javapath"
217elif [ "$glilang" == "fr" ]; then
218 echo "Vérification de Java: $javapath"
219elif [ "$glilang" == "ru" ]; then
220 echo "ðÒÏ×ÅÒËÁ Java: $javapath"
221else
222 echo "Checking Java: $javapath"
223fi
224if [ ! -x "$javapath" ]; then
225 echo
226 if [ "$glilang" == "es" ]; then
227 echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
228 echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) "
229 echo "antes de correr la Interfaz de la Biblioteca Digital Greenstone."
230 elif [ "$glilang" == "fr" ]; then
231 echo "Une version adéquate de Java n'a pas pu être localisée."
232 echo "Vous devez installer un Java Runtime Environment (version 1.4 ou"
233 echo "supérieur) avant de démarrer Greenstone Librarian Interface."
234 elif [ "$glilang" == "ru" ]; then
235 echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
236 echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
237 echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ Greenstone."
238 else
239 echo "Failed to locate an appropriate version of Java. You must install a"
240 echo "Java Runtime Environment (version 1.4 or greater) before running the"
241 echo "Greenstone Librarian Interface."
242 fi
243 exit 1
244fi
245
246
247## -- Check the version of Java is new enough (1.4.0 or higher) to run the GLI --
248javaversion=`$javapath -version 2>&1 | sed -n 's/^java version \"\(.*\)\"/\1/p'`
249jvmajor=`echo $javaversion | sed -n 's/^\([0-9]*\).*$/\1/p'`
250jvminor=`echo $javaversion | sed -n 's/^[0-9]*\.\([0-9]*\).*$/\1/p'`
251
252jok=1
253if [ $jvmajor -lt 1 ] ; then
254 jok=0
255fi
256if [ $jvmajor -eq 1 ] && [ $jvminor -lt 4 ] ; then
257 jok=0
258fi
259if [ $jok -eq 0 ] ; then
260 echo
261 if [ "$glilang" == "es" ]; then
262 echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
263 echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
264 echo "la Interfaz de la Biblioteca Digital Greenstone. Por favor instale "
265 echo "una nueva versión del Ambiente de Ejecución Java (versión 1.4 o "
266 echo "posterior) y ejecute nuevamente este guión."
267 elif [ "$glilang" == "fr" ]; then
268 echo "La version de Java Runtime Environment que vous avez installée est"
269 echo "trop vielle pour faire fonctionner Greenstone Librarian Interface."
270 echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
271 echo "récente) et redémarrez le script."
272 elif [ "$glilang" == "ru" ]; then
273 echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
274 echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ ÉÎÔÅÒÆÅÊÓÏÍ Greenstone. ðÏÖÁÌÕÊÓÔÁ, "
275 echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
276 echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
277 else
278 echo "The version of the Java Runtime Environment you have installed is too"
279 echo "old to run the Greenstone Librarian Interface. Please install a new"
280 echo "version of the JRE (version 1.4 or newer) and rerun this script."
281 fi
282 exit 1
283fi
284
285## ---- Set wgetpath manually if you don't want to use the default Greenstone version -----
286wgetpath=
287
288## ---- Check that the GLI has been compiled ----
289if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
290 echo
291 if [ "$glilang" == "es" ]; then
292 echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
293 echo "(por medio de makegli.sh) antes de ejecutar este guión."
294 elif [ "$glilang" == "fr" ]; then
295 echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
296 echo "avant d'exécuter ce script."
297 elif [ "$glilang" == "ru" ]; then
298 echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
299 echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
300 else
301 echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
302 echo "before running this script."
303 fi
304 exit 1
305fi
306
307if [ "$1" == "-test" ]; then
308 if [ "$glilang" == "es" ]; then
309 echo "Clase de prueba: $2"
310 echo "Argumentos $*"
311 elif [ "$glilang" == "fr" ]; then
312 echo "Classe de test: $2"
313 echo "Arguments $*"
314 elif [ "$glilang" == "ru" ]; then
315 echo "éÓÐÙÔÁÔÅÌØÎÙÊ ËÌÁÓÓ: $2"
316 echo "ðÁÒÁÍÅÔÒÙ $*"
317 else
318 echo "Testing class: $2"
319 echo "Arguments $*"
320 fi
321 $javapath -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/mail.jar:lib/activation.jar $2 $3
322 exit 0
323fi
324
325## ---- Finally, run the GLI ----
326echo
327if [ "$glilang" == "es" ]; then
328 echo "Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
329elif [ "$glilang" == "fr" ]; then
330 echo "Exécution de Greenstone Librarian Interface"
331elif [ "$glilang" == "ru" ]; then
332 echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
333else
334 echo "Running the Greenstone Librarian Interface..."
335fi
336
337# Other arguments you can provide to GLI to work around memory limitations, or debug
338# -Xms<number>M To set minimum memory (by default 32MB)
339# -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
340# -verbose:gc To set garbage collection messages
341# -Xincgc For incremental garbage collection (significantly slows performance)
342# -Xprof Function call profiling
343# -Xloggc:<file> Write garbage collection log
344
345$javapath -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/mail.jar:lib/activation.jar org.greenstone.gatherer.GathererProg -gsdl $GSDLHOME -gsdl3 $GSDL3HOME -wget $wgetpath $*
346
347if [ "$glilang" == "es" ]; then
348 echo "¡Hecho!"
349elif [ "$glilang" == "fr" ]; then
350 echo "Terminé!"
351elif [ "$glilang" == "ru" ]; then
352 echo "÷ÙÐÏÌÎÅÎÏ!"
353else
354 echo "Done!"
355fi
Note: See TracBrowser for help on using the repository browser.