source: trunk/gli/gli.sh@ 6955

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

Added some missing translations from the second addendum.

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