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