source: trunk/gli/gli.sh@ 7007

Last change on this file since 7007 was 7003, checked in by mdewsnip, 20 years ago

Filled in a couple of missing translations by using existing translations.

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