source: trunk/gli/gli4gs3.sh@ 13027

Last change on this file since 13027 was 13027, checked in by mdewsnip, 18 years ago

No longer uses the -wget option.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 12.8 KB
RevLine 
[7328]1#!/bin/sh
2glilang=en
3
4echo
[12287]5if [ "$glilang" = "es" ]; then
[7328]6 echo "Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)"
[12453]7 echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
[7328]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"
[12287]11elif [ "$glilang" = "fr" ]; then
[7328]12 echo "Interface du Bibliothécaire Greenstone (Greenstone Librarian Interface - GLI)"
[12453]13 echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
[7328]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"
[12287]16elif [ "$glilang" = "ru" ]; then
[7328]17 echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone (Greenstone Librarian Interface - GLI)"
[12453]18 echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
[7328]19 echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
20 echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
21else
22 echo "Greenstone Librarian Interface (GLI)"
[12453]23 echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
[7328]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
[12287]34 if [ "$glilang" = "es" ]; then
[7328]35 echo "Este guión deberá ejecutarse desde el directorio en el que reside."
[12287]36 elif [ "$glilang" = "fr" ]; then
[7328]37 echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
[12287]38 elif [ "$glilang" = "ru" ]; then
[7328]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
[8065]47## ---- Determine GSDL3HOME ----
[9891]48## may be already set or manually entered here
49gsdl3path=$gsdl3path
[7328]50
51# Some users may set the above line manually
[12287]52if [ "x$gsdl3path" = "x" ]; then
[7328]53 # Check the environment variable first
[12287]54 if [ "x$GSDL3SRCHOME" != "x" ]; then
[10331]55 gsdl3path=$GSDL3SRCHOME
[7328]56
[8065]57 # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone 3
[7328]58 else
[12287]59 gsdl3path=`(cd .. && pwd)`
[7328]60 fi
61fi
62
[8065]63# Check that the Greenstone 3 installation looks OK
[12287]64if [ "$glilang" = "es" ]; then
[7328]65 echo "Revisando GSDL3: $gsdl3path"
[12287]66elif [ "$glilang" = "fr" ]; then
[7328]67 echo "Vérification de GSDL3: $gsdl3path"
[12287]68elif [ "$glilang" = "ru" ]; then
[7328]69 echo "ðÒÏ×ÅÒËÁ GSDL3: $gsdl3path"
70else
71 echo "Checking GSDL3: $gsdl3path"
72fi
73if [ ! -f "${gsdl3path}/gs3-setup.sh" ] ; then
74 echo
[12287]75 if [ "$glilang" = "es" ]; then
[8065]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."
[12287]79 elif [ "$glilang" = "fr" ]; then
[8065]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."
[12287]82 elif [ "$glilang" = "ru" ]; then
[8065]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
[12287]93if [ "x$GSDL3HOME" = "x" -o "x$GSDL3SRCHOME" = "x" ]; then
94 cd "$gsdl3path"
95 . gs3-setup.sh
96 cd "$thisdir"
[8065]97fi
98
99
100## ---- Determine GSDLHOME ----
[9891]101## may be already set, or manually entered here.
102gsdlpath=$gsdlpath
[8065]103
104# Some users may set the above line manually
[12287]105if [ "x$gsdlpath" = "x" ]; then
[8065]106 # Check the environment variable first
[12287]107 if [ "x$GSDLHOME" != "x" ]; then
[8065]108 gsdlpath=$GSDLHOME
109
[9382]110 # If it is not set, assume that the gs2build subdirectory of Greenstone 3 exists
[8065]111 else
[10331]112 gsdlpath=$GSDL3SRCHOME/gs2build
[8065]113 fi
114fi
115
116# Check that the Greenstone installation looks OK
[12287]117if [ "$glilang" = "es" ]; then
[8065]118 echo "Revisando GSDL: $gsdlpath"
[12287]119elif [ "$glilang" = "fr" ]; then
[8065]120 echo "Vérification de GSDL: $gsdlpath"
[12287]121elif [ "$glilang" = "ru" ]; then
[8065]122 echo "ðÒÏ×ÅÒËÁ GSDL: $gsdlpath"
123else
124 echo "Checking GSDL: $gsdlpath"
125fi
126if [ ! -f "${gsdlpath}/setup.bash" ] ; then
127 echo
[12287]128 if [ "$glilang" = "es" ]; then
[7328]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."
[12287]132 elif [ "$glilang" = "fr" ]; then
[7328]133 echo "L'installation de Greenstone est introuvable ou incomplète."
134 echo "Essayez de réinstaller Greenstone et exécutez ce script à nouveau."
[12287]135 elif [ "$glilang" = "ru" ]; then
[7328]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
[12287]146if [ "x$GSDLHOME" = "x" ]; then
147 cd "$gsdlpath"
148 . setup.bash
149 cd "$thisdir"
[7328]150fi
151
152
153## ---- Check Perl exists ----
154perlpath=
155
156# Some users may set the above line manually
[12287]157if [ "x$perlpath" = "x" ]; then
[7328]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
[12287]163if [ "$glilang" = "es" ]; then
[7328]164 echo "Revisando Perl: $perlpath"
[12287]165elif [ "$glilang" = "fr" ]; then
[7328]166 echo "Vérification de Perl: $perlpath"
[12287]167elif [ "$glilang" = "ru" ]; then
[7328]168 echo "ðÒÏ×ÅÒËÁ Perl: $perlpath"
169else
170 echo "Checking Perl: $perlpath"
171fi
172if [ ! -x "$perlpath" ] ; then
173 echo
[12287]174 if [ "$glilang" = "es" ]; then
[7328]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."
[12287]179 elif [ "$glilang" = "fr" ]; then
[7328]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."
[12287]184 elif [ "$glilang" = "ru" ]; then
[7328]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
[12287]202if [ "x$javapath" = "x" ]; then
[7328]203
204 # If it is set, use the JAVA_HOME environment variable
[12287]205 if [ "x$JAVA_HOME" != "x" ]; then
[7328]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
[12287]215if [ "$glilang" = "es" ]; then
[7328]216 echo "Revisando Java: $javapath"
[12287]217elif [ "$glilang" = "fr" ]; then
[7328]218 echo "Vérification de Java: $javapath"
[12287]219elif [ "$glilang" = "ru" ]; then
[7328]220 echo "ðÒÏ×ÅÒËÁ Java: $javapath"
221else
222 echo "Checking Java: $javapath"
223fi
224if [ ! -x "$javapath" ]; then
225 echo
[12287]226 if [ "$glilang" = "es" ]; then
[7328]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."
[12287]230 elif [ "$glilang" = "fr" ]; then
[7328]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."
[12287]234 elif [ "$glilang" = "ru" ]; then
[7328]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 --
[9382]248`$javapath -classpath . CheckJavaVersion > /dev/null`
[8901]249if [ $? -ne 2 ] ; then
[7328]250 echo
[12287]251 if [ "$glilang" = "es" ]; then
[7328]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."
[12287]257 elif [ "$glilang" = "fr" ]; then
[7328]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."
[12287]262 elif [ "$glilang" = "ru" ]; then
[7328]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 ----
[7853]276if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
[7328]277 echo
[12287]278 if [ "$glilang" = "es" ]; then
[7328]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."
[12287]281 elif [ "$glilang" = "fr" ]; then
[7328]282 echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
283 echo "avant d'exécuter ce script."
[12287]284 elif [ "$glilang" = "ru" ]; then
[7328]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
[12287]296if [ "$glilang" = "es" ]; then
[7328]297 echo "Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
[12287]298elif [ "$glilang" = "fr" ]; then
[7328]299 echo "Exécution de Greenstone Librarian Interface"
[12287]300elif [ "$glilang" = "ru" ]; then
[7328]301 echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
302else
303 echo "Running the Greenstone Librarian Interface..."
304fi
305
[12287]306stop_gli=0
307while [ "$stop_gli" = "0" ] ; do
308
[7328]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
[13027]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 $*
[12287]318 exit_status=$?
[7328]319
[12287]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
[7328]338 echo "¡Hecho!"
[12287]339elif [ "$glilang" = "fr" ]; then
[7328]340 echo "Terminé!"
[12287]341elif [ "$glilang" = "ru" ]; then
[7328]342 echo "÷ÙÐÏÌÎÅÎÏ!"
343else
344 echo "Done!"
[8065]345fi
Note: See TracBrowser for help on using the repository browser.