source: trunk/gli/gli.sh@ 7044

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

Added in the missing strings from the second addendum.

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