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