[10759] | 1 | #!/bin/sh
|
---|
| 2 | glilang=en
|
---|
| 3 |
|
---|
[16368] | 4 | if [ "x$PROGNAME" = "x" ] ; then
|
---|
| 5 | PROGNAME="Greenstone"
|
---|
| 6 | if [ "$glilang" = "es" ]; then
|
---|
| 7 | PROGFULLNAME="Biblioteca Digital Greenstone"
|
---|
| 8 | elif [ "$glilang" = "fr" ]; then
|
---|
| 9 | PROGFULLNAME="Bibliothécaire Greenstone"
|
---|
| 10 | elif [ "$glilang" = "ru" ]; then
|
---|
| 11 | PROGFULLNAME="ÉÎÔÅÒÆÅÊÓ Greenstone"
|
---|
| 12 | else
|
---|
| 13 | PROGFULLNAME="Greenstone Digital Library"
|
---|
| 14 | fi
|
---|
| 15 | else
|
---|
| 16 | PROGFULLNAME=$PROGNAME
|
---|
| 17 | fi
|
---|
| 18 |
|
---|
| 19 | if [ "x$PROGABBR" = "x" ] ; then
|
---|
| 20 | PROGABBR="GLI"
|
---|
| 21 | fi
|
---|
| 22 |
|
---|
| 23 | if [ "x$PROGNAME_EN" = "x" ] ; then
|
---|
| 24 | PROGNAME_EN="Greenstone Librarian Interface"
|
---|
| 25 | fi
|
---|
| 26 |
|
---|
| 27 |
|
---|
[10759] | 28 | echo
|
---|
[12287] | 29 | if [ "$glilang" = "es" ]; then
|
---|
[16368] | 30 | echo "Interfaz de la $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
[17946] | 31 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
[16368] | 32 | echo "La Interfaz de la $PROGNAME NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
|
---|
[10759] | 33 | echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
|
---|
| 34 | echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
|
---|
[12287] | 35 | elif [ "$glilang" = "fr" ]; then
|
---|
[16368] | 36 | echo "Interface du $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
[17946] | 37 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
[16368] | 38 | echo "$PROGABBR est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
|
---|
[10759] | 39 | echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
|
---|
[12287] | 40 | elif [ "$glilang" = "ru" ]; then
|
---|
[16368] | 41 | echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
[17946] | 42 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
[10759] | 43 | echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
|
---|
| 44 | echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
|
---|
| 45 | else
|
---|
[16368] | 46 | echo "$PROGNAME Librarian Interface ($PROGABBR)"
|
---|
[17946] | 47 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
[16368] | 48 | echo "$PROGABBR comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
|
---|
[10759] | 49 | echo "This is free software, and you are welcome to redistribute it"
|
---|
| 50 | fi
|
---|
| 51 | echo
|
---|
| 52 |
|
---|
| 53 | ## -------- Run the Greenstone Librarian Interface --------
|
---|
| 54 |
|
---|
| 55 | # This script must be run from within the directory in which it lives
|
---|
| 56 | thisdir=`pwd`
|
---|
| 57 | if [ ! -f "${thisdir}/client-gli.sh" ]; then
|
---|
[12287] | 58 | if [ "$glilang" = "es" ]; then
|
---|
[10759] | 59 | echo "Este guión deberá ejecutarse desde el directorio en el que reside."
|
---|
[12287] | 60 | elif [ "$glilang" = "fr" ]; then
|
---|
[10759] | 61 | echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
|
---|
[12287] | 62 | elif [ "$glilang" = "ru" ]; then
|
---|
[10759] | 63 | echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
|
---|
| 64 | else
|
---|
| 65 | echo "This script must be run from the directory in which it resides."
|
---|
| 66 | fi
|
---|
| 67 | exit 1
|
---|
| 68 | fi
|
---|
| 69 |
|
---|
| 70 |
|
---|
| 71 | ## ---- Check Java exists ----
|
---|
| 72 | javapath=
|
---|
| 73 |
|
---|
| 74 | # Some users may set the above line manually
|
---|
[12287] | 75 | if [ "x$javapath" = "x" ]; then
|
---|
[10759] | 76 |
|
---|
| 77 | # If it is set, use the JAVA_HOME environment variable
|
---|
[12287] | 78 | if [ "x$JAVA_HOME" != "x" ]; then
|
---|
[10759] | 79 | javapath="$JAVA_HOME/bin/java"
|
---|
| 80 |
|
---|
| 81 | # Check if Java is on the search path
|
---|
| 82 | else
|
---|
| 83 | javapath=`which java 2> /dev/null`
|
---|
| 84 | fi
|
---|
| 85 | fi
|
---|
| 86 |
|
---|
| 87 | # Check that a Java executable has been found
|
---|
[12287] | 88 | if [ "$glilang" = "es" ]; then
|
---|
[10759] | 89 | echo "Revisando Java: $javapath"
|
---|
[12287] | 90 | elif [ "$glilang" = "fr" ]; then
|
---|
[10759] | 91 | echo "Vérification de Java: $javapath"
|
---|
[12287] | 92 | elif [ "$glilang" = "ru" ]; then
|
---|
[10759] | 93 | echo "ðÒÏ×ÅÒËÁ Java: $javapath"
|
---|
| 94 | else
|
---|
| 95 | echo "Checking Java: $javapath"
|
---|
| 96 | fi
|
---|
| 97 | if [ ! -x "$javapath" ]; then
|
---|
| 98 | echo
|
---|
[12287] | 99 | if [ "$glilang" = "es" ]; then
|
---|
[10759] | 100 | echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
|
---|
| 101 | echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) "
|
---|
[16368] | 102 | echo "antes de correr la Interfaz de la $PROGFULLNAME ."
|
---|
[12287] | 103 | elif [ "$glilang" = "fr" ]; then
|
---|
[10759] | 104 | echo "Une version adéquate de Java n'a pas pu être localisée."
|
---|
| 105 | echo "Vous devez installer un Java Runtime Environment (version 1.4 ou"
|
---|
[16368] | 106 | echo "supérieur) avant de démarrer $PROGNAME Librarian Interface."
|
---|
[12287] | 107 | elif [ "$glilang" = "ru" ]; then
|
---|
[10759] | 108 | echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
|
---|
| 109 | echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
|
---|
[16368] | 110 | echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ $PROGNAME."
|
---|
[10759] | 111 | else
|
---|
| 112 | echo "Failed to locate an appropriate version of Java. You must install a"
|
---|
| 113 | echo "Java Runtime Environment (version 1.4 or greater) before running the"
|
---|
[16368] | 114 | echo "$PROGNAME Librarian Interface."
|
---|
[10759] | 115 | fi
|
---|
| 116 | exit 1
|
---|
| 117 | fi
|
---|
| 118 |
|
---|
| 119 |
|
---|
| 120 | ## -- Check the version of Java is new enough (1.4.0 or higher) to run the GLI --
|
---|
| 121 | `$javapath -classpath . CheckJavaVersion > /dev/null`
|
---|
| 122 | if [ $? -ne 2 ] ; then
|
---|
| 123 | echo
|
---|
[12287] | 124 | if [ "$glilang" = "es" ]; then
|
---|
[10759] | 125 | echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
|
---|
| 126 | echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
|
---|
| 127 | echo "la Interfaz de la Biblioteca Digital Greenstone. Por favor instale "
|
---|
| 128 | echo "una nueva versión del Ambiente de Ejecución Java (versión 1.4 o "
|
---|
| 129 | echo "posterior) y ejecute nuevamente este guión."
|
---|
[12287] | 130 | elif [ "$glilang" = "fr" ]; then
|
---|
[10759] | 131 | echo "La version de Java Runtime Environment que vous avez installée est"
|
---|
| 132 | echo "trop vielle pour faire fonctionner Greenstone Librarian Interface."
|
---|
| 133 | echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
|
---|
| 134 | echo "récente) et redémarrez le script."
|
---|
[12287] | 135 | elif [ "$glilang" = "ru" ]; then
|
---|
[10759] | 136 | echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
|
---|
| 137 | echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ ÉÎÔÅÒÆÅÊÓÏÍ Greenstone. ðÏÖÁÌÕÊÓÔÁ, "
|
---|
| 138 | echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
|
---|
| 139 | echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
|
---|
| 140 | else
|
---|
| 141 | echo "The version of the Java Runtime Environment you have installed is too"
|
---|
| 142 | echo "old to run the Greenstone Librarian Interface. Please install a new"
|
---|
| 143 | echo "version of the JRE (version 1.4 or newer) and rerun this script."
|
---|
| 144 | fi
|
---|
| 145 | exit 1
|
---|
| 146 | fi
|
---|
| 147 |
|
---|
| 148 | ## ---- Check that the GLI has been compiled ----
|
---|
| 149 | if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
|
---|
| 150 | echo
|
---|
[12287] | 151 | if [ "$glilang" = "es" ]; then
|
---|
[16368] | 152 | echo "Usted necesita compilar la Interfaz de la $PROGFULLNAME"
|
---|
[10759] | 153 | echo "(por medio de makegli.sh) antes de ejecutar este guión."
|
---|
[12287] | 154 | elif [ "$glilang" = "fr" ]; then
|
---|
[16368] | 155 | echo "Vous devez compiler le $PROGNAME Interface (en utilisant makegli.sh)"
|
---|
[10759] | 156 | echo "avant d'exécuter ce script."
|
---|
[12287] | 157 | elif [ "$glilang" = "ru" ]; then
|
---|
[16368] | 158 | echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME"
|
---|
[10759] | 159 | echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
|
---|
| 160 | else
|
---|
[16368] | 161 | echo "You need to compile the $PROGNAME Librarian Interface (using makegli.sh)"
|
---|
[10759] | 162 | echo "before running this script."
|
---|
| 163 | fi
|
---|
| 164 | exit 1
|
---|
| 165 | fi
|
---|
| 166 |
|
---|
| 167 |
|
---|
| 168 | ## ---- Finally, run the GLI ----
|
---|
| 169 | echo
|
---|
[12287] | 170 | if [ "$glilang" = "es" ]; then
|
---|
[16368] | 171 | echo "Ejecutando la Interfaz de la $PROGFULLNAME..."
|
---|
[12287] | 172 | elif [ "$glilang" = "fr" ]; then
|
---|
[16368] | 173 | echo "Exécution de $PROGNAME Librarian Interface"
|
---|
[12287] | 174 | elif [ "$glilang" = "ru" ]; then
|
---|
[16368] | 175 | echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME..."
|
---|
[10759] | 176 | else
|
---|
[16368] | 177 | echo "Running the $PROGNAME Librarian Interface..."
|
---|
[10759] | 178 | fi
|
---|
| 179 |
|
---|
| 180 | # Other arguments you can provide to GLI to work around memory limitations, or debug
|
---|
| 181 | # -Xms<number>M To set minimum memory (by default 32MB)
|
---|
| 182 | # -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
|
---|
| 183 | # -verbose:gc To set garbage collection messages
|
---|
| 184 | # -Xincgc For incremental garbage collection (significantly slows performance)
|
---|
| 185 | # -Xprof Function call profiling
|
---|
| 186 | # -Xloggc:<file> Write garbage collection log
|
---|
| 187 |
|
---|
[16368] | 188 | # GS2 only requires -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar. GS3 requires more but it doesn't conflict with GS2:
|
---|
[19305] | 189 | if [ ! -d "${thisdir}/gs2build" ]; then
|
---|
| 190 | $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone $*
|
---|
| 191 | else
|
---|
| 192 | $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "${thisdir}/gs2build" $*
|
---|
| 193 | fi
|
---|
[10759] | 194 |
|
---|
[12287] | 195 | if [ "$glilang" = "es" ]; then
|
---|
[10759] | 196 | echo "¡Hecho!"
|
---|
[12287] | 197 | elif [ "$glilang" = "fr" ]; then
|
---|
[10759] | 198 | echo "Terminé!"
|
---|
[12287] | 199 | elif [ "$glilang" = "ru" ]; then
|
---|
[10759] | 200 | echo "÷ÙÐÏÌÎÅÎÏ!"
|
---|
| 201 | else
|
---|
| 202 | echo "Done!"
|
---|
| 203 | fi |
---|