| 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) 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"
|
---|
| 11 | elif [ "$glilang" == "fr" ]; then
|
---|
| 12 | echo "Interface du Bibliothécaire Greenstone (Greenstone Librarian Interface - GLI)"
|
---|
| 13 | echo "Copyright (C) 2004, 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) 2004, 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) 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"
|
---|
| 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 [ "$gsdlpath" == "" ]; then
|
---|
| 52 | # Check the environment variable first
|
---|
| 53 | if [ "$GSDLHOME" != "" ]; 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 | pushd .. > /dev/null
|
---|
| 59 | gsdlpath=`pwd`
|
---|
| 60 | popd > /dev/null
|
---|
| 61 | fi
|
---|
| 62 | fi
|
---|
| 63 |
|
---|
| 64 | # Check that the Greenstone installation looks OK
|
---|
| 65 | if [ "$glilang" == "es" ]; then
|
---|
| 66 | echo "Revisando GSDL: $gsdlpath"
|
---|
| 67 | elif [ "$glilang" == "fr" ]; then
|
---|
| 68 | echo "Vérification de GSDL: $gsdlpath"
|
---|
| 69 | elif [ "$glilang" == "ru" ]; then
|
---|
| 70 | echo "ðÒÏ×ÅÒËÁ GSDL: $gsdlpath"
|
---|
| 71 | else
|
---|
| 72 | echo "Checking GSDL: $gsdlpath"
|
---|
| 73 | fi
|
---|
| 74 | if [ ! -f "${gsdlpath}/setup.bash" ] ; then
|
---|
| 75 | echo
|
---|
| 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
|
---|
| 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
|
---|
| 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
|
---|
| 90 | exit 1
|
---|
| 91 | fi
|
---|
| 92 |
|
---|
| 93 | # Setup Greenstone, unless it has already been done
|
---|
| 94 | if [ "$GSDLHOME" == "" ]; then
|
---|
| 95 | pushd $gsdlpath > /dev/null
|
---|
| 96 | source setup.bash
|
---|
| 97 | popd > /dev/null
|
---|
| 98 | fi
|
---|
| 99 |
|
---|
| 100 |
|
---|
| 101 | ## ---- Check Perl exists ----
|
---|
| 102 | perlpath=
|
---|
| 103 |
|
---|
| 104 | # Some users may set the above line manually
|
---|
| 105 | if [ "$perlpath" == "" ]; then
|
---|
| 106 | # Check if Perl is on the search path
|
---|
| 107 | perlpath=`which perl 2> /dev/null`
|
---|
| 108 | fi
|
---|
| 109 |
|
---|
| 110 | # Check that a Perl executable has been found
|
---|
| 111 | if [ "$glilang" == "es" ]; then
|
---|
| 112 | echo "Revisando Perl: $perlpath"
|
---|
| 113 | elif [ "$glilang" == "fr" ]; then
|
---|
| 114 | echo "Vérification de Perl: $perlpath"
|
---|
| 115 | elif [ "$glilang" == "ru" ]; then
|
---|
| 116 | echo "ðÒÏ×ÅÒËÁ Perl: $perlpath"
|
---|
| 117 | else
|
---|
| 118 | echo "Checking Perl: $perlpath"
|
---|
| 119 | fi
|
---|
| 120 | if [ ! -x "$perlpath" ] ; then
|
---|
| 121 | echo
|
---|
| 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
|
---|
| 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
|
---|
| 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
|
---|
| 142 | exit 1
|
---|
| 143 | fi
|
---|
| 144 |
|
---|
| 145 |
|
---|
| 146 | ## ---- Check Java exists ----
|
---|
| 147 | javapath=
|
---|
| 148 |
|
---|
| 149 | # Some users may set the above line manually
|
---|
| 150 | if [ "$javapath" == "" ]; then
|
---|
| 151 |
|
---|
| 152 | # If it is set, use the JAVA_HOME environment variable
|
---|
| 153 | if [ "$JAVA_HOME" != "" ]; then
|
---|
| 154 | javapath="$JAVA_HOME/bin/java"
|
---|
| 155 |
|
---|
| 156 | # Check if Java is on the search path
|
---|
| 157 | else
|
---|
| 158 | javapath=`which java 2> /dev/null`
|
---|
| 159 | fi
|
---|
| 160 | fi
|
---|
| 161 |
|
---|
| 162 | # Check that a Java executable has been found
|
---|
| 163 | if [ "$glilang" == "es" ]; then
|
---|
| 164 | echo "Revisando Java: $javapath"
|
---|
| 165 | elif [ "$glilang" == "fr" ]; then
|
---|
| 166 | echo "Vérification de Java: $javapath"
|
---|
| 167 | elif [ "$glilang" == "ru" ]; then
|
---|
| 168 | echo "ðÒÏ×ÅÒËÁ Java: $javapath"
|
---|
| 169 | else
|
---|
| 170 | echo "Checking Java: $javapath"
|
---|
| 171 | fi
|
---|
| 172 | if [ ! -x "$javapath" ]; then
|
---|
| 173 | echo
|
---|
| 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
|
---|
| 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
|
---|
| 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
|
---|
| 191 | exit 1
|
---|
| 192 | fi
|
---|
| 193 |
|
---|
| 194 |
|
---|
| 195 | ## -- Check the version of Java is new enough (1.4.0 or higher) to run the GLI --
|
---|
| 196 | javaversion=`$javapath -version 2>&1 | sed -n 's/^java version \"\(.*\)\"/\1/p'`
|
---|
| 197 | jvmajor=`echo $javaversion | sed -n 's/^\([0-9]*\).*$/\1/p'`
|
---|
| 198 | jvminor=`echo $javaversion | sed -n 's/^[0-9]*\.\([0-9]*\).*$/\1/p'`
|
---|
| 199 |
|
---|
| 200 | jok=1
|
---|
| 201 | if [ $jvmajor -lt 1 ] ; then
|
---|
| 202 | jok=0
|
---|
| 203 | fi
|
---|
| 204 | if [ $jvmajor -eq 1 ] && [ $jvminor -lt 4 ] ; then
|
---|
| 205 | jok=0
|
---|
| 206 | fi
|
---|
| 207 | if [ $jok -eq 0 ] ; then
|
---|
| 208 | echo
|
---|
| 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
|
---|
| 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
|
---|
| 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
|
---|
| 230 | exit 1
|
---|
| 231 | fi
|
---|
| 232 |
|
---|
| 233 | ## ---- Set wgetpath manually if you don't want to use the default Greenstone version -----
|
---|
| 234 | wgetpath=
|
---|
| 235 |
|
---|
| 236 | ## ---- Check that the GLI has been compiled ----
|
---|
| 237 | if [ ! -f "classes/org/greenstone/gatherer/gems/GEMS.class" ] && [ ! -f "GLI.jar" ]; then
|
---|
| 238 | echo
|
---|
| 239 | if [ "$glilang" == "es" ]; then
|
---|
| 240 | echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
|
---|
| 241 | echo "(por medio de makegli.sh) antes de ejecutar este guión."
|
---|
| 242 | elif [ "$glilang" == "fr" ]; then
|
---|
| 243 | echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
|
---|
| 244 | echo "avant d'exécuter ce script."
|
---|
| 245 | elif [ "$glilang" == "ru" ]; then
|
---|
| 246 | echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
|
---|
| 247 | echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
|
---|
| 248 | else
|
---|
| 249 | echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
|
---|
| 250 | echo "before running this script."
|
---|
| 251 | fi
|
---|
| 252 | exit 1
|
---|
| 253 | fi
|
---|
| 254 |
|
---|
| 255 | ## ---- Finally, run the GLI ----
|
---|
| 256 | echo
|
---|
| 257 | echo "Running the Greenstone Editor for Metadata Sets..."
|
---|
| 258 |
|
---|
| 259 | # Other arguments you can provide to GLI to work around memory limitations, or debug
|
---|
| 260 | # -Xms<number>M To set minimum memory (by default 32MB)
|
---|
| 261 | # -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
|
---|
| 262 | # -verbose:gc To set garbage collection messages
|
---|
| 263 | # -Xincgc For incremental garbage collection (significantly slows performance)
|
---|
| 264 | # -Xprof Function call profiling
|
---|
| 265 | # -Xloggc:<file> Write garbage collection log
|
---|
| 266 |
|
---|
| 267 | $javapath -classpath classes/:GLI.jar:lib/apache.jar org.greenstone.gatherer.gems.GEMS -gsdl $GSDLHOME $*
|
---|
| 268 |
|
---|
| 269 | if [ "$glilang" == "es" ]; then
|
---|
| 270 | echo "¡Hecho!"
|
---|
| 271 | elif [ "$glilang" == "fr" ]; then
|
---|
| 272 | echo "Terminé!"
|
---|
| 273 | elif [ "$glilang" == "ru" ]; then
|
---|
| 274 | echo "÷ÙÐÏÌÎÅÎÏ!"
|
---|
| 275 | else
|
---|
| 276 | echo "Done!"
|
---|
| 277 | fi |
---|