[4914] | 1 | #!/bin/sh
|
---|
[6752] | 2 | glilang=en
|
---|
[13251] | 3 |
|
---|
[6262] | 4 | echo
|
---|
[12286] | 5 | if [ "$glilang" = "es" ]; then
|
---|
[6959] | 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"
|
---|
[6959] | 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"
|
---|
[12286] | 11 | elif [ "$glilang" = "fr" ]; then
|
---|
[6955] | 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"
|
---|
[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"
|
---|
[12286] | 16 | elif [ "$glilang" = "ru" ]; then
|
---|
[7041] | 17 | echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone (Greenstone Librarian Interface - GLI)"
|
---|
[12453] | 18 | echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
|
---|
[7041] | 19 | echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
|
---|
| 20 | echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
|
---|
[6702] | 21 | else
|
---|
[6955] | 22 | echo "Greenstone Librarian Interface (GLI)"
|
---|
[12453] | 23 | echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
|
---|
[6955] | 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] | 26 | fi
|
---|
[6223] | 27 | echo
|
---|
[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] | 32 | thisdir=`pwd`
|
---|
| 33 | if [ ! -f "${thisdir}/gli.sh" ]; then
|
---|
[12286] | 34 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 35 | echo "Este guión deberá ejecutarse desde el directorio en el que reside."
|
---|
[12286] | 36 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 37 | echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
|
---|
[12286] | 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] | 44 | fi
|
---|
| 45 |
|
---|
[4952] | 46 |
|
---|
[5003] | 47 | ## ---- Determine GSDLHOME ----
|
---|
[6624] | 48 | gsdlpath=
|
---|
[4952] | 49 |
|
---|
| 50 | # Some users may set the above line manually
|
---|
[12286] | 51 | if [ "x$gsdlpath" = "x" ]; then
|
---|
[4952] | 52 | # Check the environment variable first
|
---|
[12286] | 53 | if [ "x$GSDLHOME" != "x" ]; 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
|
---|
[12286] | 58 | gsdlpath=`(cd .. && pwd)`
|
---|
[4952] | 59 | fi
|
---|
| 60 | fi
|
---|
| 61 |
|
---|
| 62 | # Check that the Greenstone installation looks OK
|
---|
[12286] | 63 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 64 | echo "Revisando GSDL: $gsdlpath"
|
---|
[12286] | 65 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 66 | echo "Vérification de GSDL: $gsdlpath"
|
---|
[12286] | 67 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 68 | echo "ðÒÏ×ÅÒËÁ GSDL: $gsdlpath"
|
---|
| 69 | else
|
---|
| 70 | echo "Checking GSDL: $gsdlpath"
|
---|
| 71 | fi
|
---|
[5091] | 72 | if [ ! -f "${gsdlpath}/setup.bash" ] ; then
|
---|
[5003] | 73 | echo
|
---|
[12286] | 74 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 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."
|
---|
[12286] | 78 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 79 | echo "L'installation de Greenstone est introuvable ou incomplète."
|
---|
| 80 | echo "Essayez de réinstaller Greenstone et exécutez ce script à nouveau."
|
---|
[12286] | 81 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 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
|
---|
[4952] | 88 | exit 1
|
---|
| 89 | fi
|
---|
| 90 |
|
---|
[5003] | 91 | # Setup Greenstone, unless it has already been done
|
---|
[12286] | 92 | if [ "x$GSDLHOME" = "x" ]; then
|
---|
| 93 | cd "$gsdlpath"
|
---|
| 94 | . setup.bash
|
---|
| 95 | cd "$thisdir"
|
---|
[5003] | 96 | fi
|
---|
[4952] | 97 |
|
---|
| 98 |
|
---|
[5003] | 99 | ## ---- Check Perl exists ----
|
---|
[4952] | 100 | perlpath=
|
---|
| 101 |
|
---|
| 102 | # Some users may set the above line manually
|
---|
[12286] | 103 | if [ "x$perlpath" = "x" ]; then
|
---|
[5003] | 104 | # Check if Perl is on the search path
|
---|
[4952] | 105 | perlpath=`which perl 2> /dev/null`
|
---|
| 106 | fi
|
---|
| 107 |
|
---|
[5003] | 108 | # Check that a Perl executable has been found
|
---|
[12286] | 109 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 110 | echo "Revisando Perl: $perlpath"
|
---|
[12286] | 111 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 112 | echo "Vérification de Perl: $perlpath"
|
---|
[12286] | 113 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 114 | echo "ðÒÏ×ÅÒËÁ Perl: $perlpath"
|
---|
| 115 | else
|
---|
| 116 | echo "Checking Perl: $perlpath"
|
---|
| 117 | fi
|
---|
[4952] | 118 | if [ ! -x "$perlpath" ] ; then
|
---|
[5003] | 119 | echo
|
---|
[12286] | 120 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 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."
|
---|
[12286] | 125 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 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."
|
---|
[12286] | 130 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 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
|
---|
[4952] | 140 | exit 1
|
---|
| 141 | fi
|
---|
| 142 |
|
---|
| 143 |
|
---|
[5003] | 144 | ## ---- Check Java exists ----
|
---|
[4952] | 145 | javapath=
|
---|
| 146 |
|
---|
| 147 | # Some users may set the above line manually
|
---|
[12286] | 148 | if [ "x$javapath" = "x" ]; then
|
---|
[5003] | 149 |
|
---|
[6467] | 150 | # If it is set, use the JAVA_HOME environment variable
|
---|
[12286] | 151 | if [ "x$JAVA_HOME" != "x" ]; then
|
---|
[6467] | 152 | javapath="$JAVA_HOME/bin/java"
|
---|
[4952] | 153 |
|
---|
[5003] | 154 | # Check if Java is on the search path
|
---|
[4952] | 155 | else
|
---|
| 156 | javapath=`which java 2> /dev/null`
|
---|
| 157 | fi
|
---|
| 158 | fi
|
---|
| 159 |
|
---|
[5003] | 160 | # Check that a Java executable has been found
|
---|
[12286] | 161 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 162 | echo "Revisando Java: $javapath"
|
---|
[12286] | 163 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 164 | echo "Vérification de Java: $javapath"
|
---|
[12286] | 165 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 166 | echo "ðÒÏ×ÅÒËÁ Java: $javapath"
|
---|
| 167 | else
|
---|
| 168 | echo "Checking Java: $javapath"
|
---|
| 169 | fi
|
---|
[4952] | 170 | if [ ! -x "$javapath" ]; then
|
---|
[5003] | 171 | echo
|
---|
[12286] | 172 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 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."
|
---|
[12286] | 176 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 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."
|
---|
[12286] | 180 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 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
|
---|
[4952] | 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 --
|
---|
[9347] | 194 | `$javapath -classpath . CheckJavaVersion > /dev/null`
|
---|
[8901] | 195 | if [ $? -ne 2 ] ; then
|
---|
[5003] | 196 | echo
|
---|
[12286] | 197 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 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."
|
---|
[12286] | 203 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 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."
|
---|
[12286] | 208 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 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
|
---|
[4952] | 218 | exit 1
|
---|
| 219 | fi
|
---|
| 220 |
|
---|
[5003] | 221 | ## ---- Check that the GLI has been compiled ----
|
---|
[7748] | 222 | if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
|
---|
[8901] | 223 | echo
|
---|
[12286] | 224 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 225 | echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
|
---|
| 226 | echo "(por medio de makegli.sh) antes de ejecutar este guión."
|
---|
[12286] | 227 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 228 | echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
|
---|
| 229 | echo "avant d'exécuter ce script."
|
---|
[12286] | 230 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 231 | echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
|
---|
| 232 | echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
|
---|
| 233 | else
|
---|
| 234 | echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
|
---|
| 235 | echo "before running this script."
|
---|
| 236 | fi
|
---|
[4952] | 237 | exit 1
|
---|
| 238 | fi
|
---|
| 239 |
|
---|
[5003] | 240 | ## ---- Finally, run the GLI ----
|
---|
| 241 | echo
|
---|
[12286] | 242 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 243 | echo "Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
|
---|
[12286] | 244 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 245 | echo "Exécution de Greenstone Librarian Interface"
|
---|
[12286] | 246 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 247 | echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
|
---|
| 248 | else
|
---|
| 249 | echo "Running the Greenstone Librarian Interface..."
|
---|
| 250 | fi
|
---|
[4952] | 251 |
|
---|
[12225] | 252 | stop_gli=0
|
---|
| 253 | while [ "$stop_gli" = "0" ] ; do
|
---|
| 254 |
|
---|
[6211] | 255 | # Other arguments you can provide to GLI to work around memory limitations, or debug
|
---|
| 256 | # -Xms<number>M To set minimum memory (by default 32MB)
|
---|
| 257 | # -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
|
---|
[4914] | 258 | # -verbose:gc To set garbage collection messages
|
---|
[6211] | 259 | # -Xincgc For incremental garbage collection (significantly slows performance)
|
---|
[4914] | 260 | # -Xprof Function call profiling
|
---|
| 261 | # -Xloggc:<file> Write garbage collection log
|
---|
| 262 |
|
---|
| 263 |
|
---|
[12225] | 264 |
|
---|
[13027] | 265 | $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl $GSDLHOME -gsdlos $GSDLOS $*
|
---|
[12225] | 266 | exit_status=$?
|
---|
| 267 |
|
---|
| 268 | if [ "$exit_status" != "2" ] ; then
|
---|
| 269 | stop_gli=1
|
---|
| 270 | else
|
---|
| 271 | echo
|
---|
[12286] | 272 | if [ "$glilang" = "es" ]; then
|
---|
[12225] | 273 | echo "Restarting/Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
|
---|
[12286] | 274 | elif [ "$glilang" = "fr" ]; then
|
---|
[12225] | 275 | echo "Restarting/Exécution de Greenstone Librarian Interface"
|
---|
[12286] | 276 | elif [ "$glilang" = "ru" ]; then
|
---|
[12225] | 277 | echo "Restarting/ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
|
---|
| 278 | else
|
---|
| 279 | echo "Restarting the Greenstone Librarian Interface..."
|
---|
| 280 | fi
|
---|
| 281 |
|
---|
| 282 | fi
|
---|
| 283 | done
|
---|
| 284 |
|
---|
[12286] | 285 | if [ "$glilang" = "es" ]; then
|
---|
[6745] | 286 | echo "¡Hecho!"
|
---|
[12286] | 287 | elif [ "$glilang" = "fr" ]; then
|
---|
[6712] | 288 | echo "Terminé!"
|
---|
[12286] | 289 | elif [ "$glilang" = "ru" ]; then
|
---|
[6702] | 290 | echo "÷ÙÐÏÌÎÅÎÏ!"
|
---|
| 291 | else
|
---|
| 292 | echo "Done!"
|
---|
[12286] | 293 | fi
|
---|