root/trunk/gli/gli4gs3.sh @ 13027

Revision 13027, 12.8 KB (checked in by mdewsnip, 14 years ago)

No longer uses the -wget option.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
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) 2006, 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) 2006, 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) 2006, 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) 2006, 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 ----
48## may be already set or manually entered here
49gsdl3path=$gsdl3path
50
51# Some users may set the above line manually
52if [ "x$gsdl3path" = "x" ]; then
53    # Check the environment variable first
54    if [ "x$GSDL3SRCHOME" != "x" ]; then
55    gsdl3path=$GSDL3SRCHOME
56
57    # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone 3
58    else
59    gsdl3path=`(cd .. && pwd)`
60    fi
61fi
62
63# Check that the Greenstone 3 installation looks OK
64if [ "$glilang" = "es" ]; then
65    echo "Revisando GSDL3: $gsdl3path"
66elif [ "$glilang" = "fr" ]; then
67    echo "Vérification de GSDL3: $gsdl3path"
68elif [ "$glilang" = "ru" ]; then
69    echo "ðÒÏ×ÅÒËÁ GSDL3: $gsdl3path"
70else
71    echo "Checking GSDL3: $gsdl3path"
72fi
73if [ ! -f "${gsdl3path}/gs3-setup.sh" ] ; then
74    echo
75    if [ "$glilang" = "es" ]; then
76    echo "No se pudo encontrar la instalación de Greenstone 3 o está incompleta."
77        echo "Trate de reinstalar Greenstone 3 y a continuación ejecute nuevamente"
78    echo "este guión."
79    elif [ "$glilang" = "fr" ]; then
80    echo "L'installation de Greenstone 3 est introuvable ou incomplète."
81    echo "Essayez de réinstaller Greenstone 3 et exécutez ce script à nouveau."
82    elif [ "$glilang" = "ru" ]; then
83    echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone 3 ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
84    echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone 3, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
85    else
86    echo "The Greenstone 3 installation could not be found, or is incomplete."
87    echo "Try reinstalling Greenstone 3 then running this script again."
88    fi
89    exit 1
90fi
91
92# Setup Greenstone 3, unless it has already been done
93if [ "x$GSDL3HOME" = "x" -o "x$GSDL3SRCHOME" = "x" ]; then
94    cd "$gsdl3path"
95    . gs3-setup.sh
96    cd "$thisdir"
97fi
98
99
100##  ---- Determine GSDLHOME ----
101## may be already set, or manually entered here.
102gsdlpath=$gsdlpath
103
104# Some users may set the above line manually
105if [ "x$gsdlpath" = "x" ]; then
106    # Check the environment variable first
107    if [ "x$GSDLHOME" != "x" ]; then
108    gsdlpath=$GSDLHOME
109
110    # If it is not set, assume that the gs2build subdirectory of Greenstone 3 exists
111    else
112    gsdlpath=$GSDL3SRCHOME/gs2build
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 [ "x$GSDLHOME" = "x" ]; then
147    cd "$gsdlpath"
148    . setup.bash
149    cd "$thisdir"
150fi
151
152
153##  ---- Check Perl exists ----
154perlpath=
155
156# Some users may set the above line manually
157if [ "x$perlpath" = "x" ]; 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 [ "x$javapath" = "x" ]; then
203
204    # If it is set, use the JAVA_HOME environment variable
205    if [ "x$JAVA_HOME" != "x" ]; 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 --
248`$javapath -classpath . CheckJavaVersion > /dev/null`
249if [ $? -ne 2 ] ; then
250    echo
251    if [ "$glilang" = "es" ]; then
252    echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
253    echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
254    echo "la Interfaz de la Biblioteca Digital Greenstone. Por favor instale "
255    echo "una nueva versión del Ambiente de Ejecución Java (versión 1.4 o "
256    echo "posterior) y ejecute nuevamente este guión."
257    elif [ "$glilang" = "fr" ]; then
258    echo "La version de Java Runtime Environment que vous avez installée est"
259    echo "trop vielle pour faire fonctionner Greenstone Librarian Interface."
260    echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
261    echo "récente) et redémarrez le script."
262    elif [ "$glilang" = "ru" ]; then
263    echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
264    echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ ÉÎÔÅÒÆÅÊÓÏÍ Greenstone. ðÏÖÁÌÕÊÓÔÁ, "
265    echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
266    echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
267    else
268    echo "The version of the Java Runtime Environment you have installed is too"
269    echo "old to run the Greenstone Librarian Interface. Please install a new"
270    echo "version of the JRE (version 1.4 or newer) and rerun this script."
271    fi
272    exit 1
273fi
274
275## ---- Check that the GLI has been compiled ----
276if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
277    echo
278    if [ "$glilang" = "es" ]; then
279    echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
280    echo "(por medio de makegli.sh) antes de ejecutar este guión."
281    elif [ "$glilang" = "fr" ]; then
282    echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
283    echo "avant d'exécuter ce script."
284    elif [ "$glilang" = "ru" ]; then
285    echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
286    echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
287    else
288    echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
289    echo "before running this script."
290    fi
291    exit 1
292fi
293
294## ---- Finally, run the GLI ----
295echo
296if [ "$glilang" = "es" ]; then
297    echo "Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
298elif [ "$glilang" = "fr" ]; then
299    echo "Exécution de Greenstone Librarian Interface"
300elif [ "$glilang" = "ru" ]; then
301    echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
302else
303    echo "Running the Greenstone Librarian Interface..."
304fi
305
306stop_gli=0
307while [ "$stop_gli" = "0" ] ; do
308
309# Other arguments you can provide to GLI to work around memory limitations, or debug
310# -Xms<number>M    To set minimum memory (by default 32MB)
311# -Xmx<number>M    To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
312# -verbose:gc      To set garbage collection messages
313# -Xincgc          For incremental garbage collection (significantly slows performance)
314# -Xprof           Function call profiling
315# -Xloggc:<file>   Write garbage collection log
316
317    $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl $GSDLHOME -gsdlos $GSDLOS -gsdl3 $GSDL3HOME -gsdl3src $GSDL3SRCHOME $*
318    exit_status=$?
319
320  if [ "$exit_status" != "2" ] ; then
321    stop_gli=1
322  else
323    echo
324    if [ "$glilang" = "es" ]; then
325        echo "Restarting/Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
326    elif [ "$glilang" = "fr" ]; then
327        echo "Restarting/Exécution de Greenstone Librarian Interface"
328    elif [ "$glilang" = "ru" ]; then
329        echo "Restarting/ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
330    else
331        echo "Restarting the Greenstone Librarian Interface..."
332    fi
333
334  fi
335done
336
337if [ "$glilang" = "es" ]; then
338    echo "¡Hecho!"
339elif [ "$glilang" = "fr" ]; then
340    echo "Terminé!"
341elif [ "$glilang" = "ru" ]; then
342    echo "÷ÙÐÏÌÎÅÎÏ!"
343else
344    echo "Done!"
345fi
Note: See TracBrowser for help on using the browser.