source: main/tags/2.70/gli/gems.sh@ 21099

Last change on this file since 21099 was 10788, checked in by mdewsnip, 19 years ago

Tidied these up by basing them on gli.bat and gli.sh, removing the unnecessary stuff (Perl, WGet, Local Library), and changing occurrences of "GLI" and "Greenstone Librarian Interface".

  • Property svn:executable set to *
  • Property svn:mime-type set to application/octet-stream
File size: 8.7 KB
Line 
1#!/bin/sh
2glilang=en
3
4echo
5if [ "$glilang" == "es" ]; then
6 echo "Editar conjuntos de metadatos (Greenstone Editor for Metadata Sets - GEMS)"
7 echo "Copyright (C) 2005, New Zealand Digital Library Project, University Of Waikato"
8 echo "GEMS 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"
11elif [ "$glilang" == "fr" ]; then
12 echo "Editer les jeux de méta-données (Greenstone Editor for Metadata Sets - GEMS)"
13 echo "Copyright (C) 2005, New Zealand Digital Library Project, University Of Waikato"
14 echo "GEMS 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"
16elif [ "$glilang" == "ru" ]; then
17 echo "òÅÄÁËÔÉÒÏ×ÁÔØ ÎÁÂÏÒÙ ÍÅÔÁÄÁÎÎÙÈ (Greenstone Editor for Metadata Sets - GEMS)"
18 echo "Copyright (C) 2005, New Zealand Digital Library Project, University Of Waikato"
19 echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
20 echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
21else
22 echo "Greenstone Editor for Metadata Sets (GEMS)"
23 echo "Copyright (C) 2005, New Zealand Digital Library Project, University Of Waikato"
24 echo "GEMS comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
25 echo "This is free software, and you are welcome to redistribute it"
26fi
27echo
28
29## -------- Run the Greenstone Editor for Metadata Sets --------
30
31# This script must be run from within the directory in which it lives
32thisdir=`pwd`
33if [ ! -f "${thisdir}/gems.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
44fi
45
46
47## ---- Determine GSDLHOME ----
48gsdlpath=
49
50# Some users may set the above line manually
51if [ "$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 (and thus GEMS) is installed as a subdirectory of Greenstone
57 else
58 pushd .. > /dev/null
59 gsdlpath=`pwd`
60 popd > /dev/null
61 fi
62fi
63
64# Check that the Greenstone installation looks OK
65if [ "$glilang" == "es" ]; then
66 echo "Revisando GSDL: $gsdlpath"
67elif [ "$glilang" == "fr" ]; then
68 echo "Vérification de GSDL: $gsdlpath"
69elif [ "$glilang" == "ru" ]; then
70 echo "ðÒÏ×ÅÒËÁ GSDL: $gsdlpath"
71else
72 echo "Checking GSDL: $gsdlpath"
73fi
74if [ ! -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
91fi
92
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
99
100
101## ---- Check Java exists ----
102javapath=
103
104# Some users may set the above line manually
105if [ "$javapath" == "" ]; then
106
107 # If it is set, use the JAVA_HOME environment variable
108 if [ "$JAVA_HOME" != "" ]; then
109 javapath="$JAVA_HOME/bin/java"
110
111 # Check if Java is on the search path
112 else
113 javapath=`which java 2> /dev/null`
114 fi
115fi
116
117# Check that a Java executable has been found
118if [ "$glilang" == "es" ]; then
119 echo "Revisando Java: $javapath"
120elif [ "$glilang" == "fr" ]; then
121 echo "Vérification de Java: $javapath"
122elif [ "$glilang" == "ru" ]; then
123 echo "ðÒÏ×ÅÒËÁ Java: $javapath"
124else
125 echo "Checking Java: $javapath"
126fi
127if [ ! -x "$javapath" ]; then
128 echo
129 if [ "$glilang" == "es" ]; then
130 echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
131 echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) "
132 echo "antes de correr la Editar conjuntos de metadatos."
133 elif [ "$glilang" == "fr" ]; then
134 echo "Une version adéquate de Java n'a pas pu être localisée."
135 echo "Vous devez installer un Java Runtime Environment (version 1.4 ou"
136 echo "supérieur) avant de démarrer Editer les jeux de méta-données."
137 elif [ "$glilang" == "ru" ]; then
138 echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
139 echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
140 echo "ÐÅÒÅÄ ××ÏÄÏÍ òÅÄÁËÔÉÒÏ×ÁÔØ ÎÁÂÏÒÙ ÍÅÔÁÄÁÎÎÙÈ."
141 else
142 echo "Failed to locate an appropriate version of Java. You must install a"
143 echo "Java Runtime Environment (version 1.4 or greater) before running the"
144 echo "Greenstone Editor for Metadata Sets."
145 fi
146 exit 1
147fi
148
149
150## -- Check the version of Java is new enough (1.4.0 or higher) to run the GEMS --
151`$javapath -classpath . CheckJavaVersion > /dev/null`
152if [ $? -ne 2 ] ; then
153 echo
154 if [ "$glilang" == "es" ]; then
155 echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
156 echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
157 echo "la Editar conjuntos de metadatos. Por favor instale una nueva "
158 echo "versión del Ambiente de Ejecución Java (versión 1.4 o posterior)"
159 echo "y ejecute nuevamente este guión."
160 elif [ "$glilang" == "fr" ]; then
161 echo "La version de Java Runtime Environment que vous avez installée est"
162 echo "trop vielle pour faire fonctionner Editer les jeux de méta-données."
163 echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
164 echo "récente) et redémarrez le script."
165 elif [ "$glilang" == "ru" ]; then
166 echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
167 echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ òÅÄÁËÔÉÒÏ×ÁÔØ ÎÁÂÏÒÙ ÍÅÔÁÄÁÎÎÙÈ. ðÏÖÁÌÕÊÓÔÁ, "
168 echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
169 echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
170 else
171 echo "The version of the Java Runtime Environment you have installed is too"
172 echo "old to run the Greenstone Editor for Metadata Sets. Please install a new"
173 echo "version of the JRE (version 1.4 or newer) and rerun this script."
174 fi
175 exit 1
176fi
177
178
179## ---- Check that the GEMS has been compiled ----
180if [ ! -f "classes/org/greenstone/gatherer/gems/GEMS.class" ] && [ ! -f "GLI.jar" ]; then
181 echo
182 if [ "$glilang" == "es" ]; then
183 echo "Usted necesita compilar la Editar conjuntos de metadatos"
184 echo "(por medio de makegli.sh) antes de ejecutar este guión."
185 elif [ "$glilang" == "fr" ]; then
186 echo "Vous devez compiler le Editer les jeux de méta-données (en utilisant makegli.sh)"
187 echo "avant d'exécuter ce script."
188 elif [ "$glilang" == "ru" ]; then
189 echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ òÅÄÁËÔÉÒÏ×ÁÔØ ÎÁÂÏÒÙ ÍÅÔÁÄÁÎÎÙÈ"
190 echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
191 else
192 echo "You need to compile the Greenstone Editor for Metadata Sets (using makegli.sh)"
193 echo "before running this script."
194 fi
195 exit 1
196fi
197
198
199## ---- Finally, run the GEMS ----
200echo
201if [ "$glilang" == "es" ]; then
202 echo "Ejecutando la Editar conjuntos de metadatos..."
203elif [ "$glilang" == "fr" ]; then
204 echo "Exécution de Editer les jeux de méta-données"
205elif [ "$glilang" == "ru" ]; then
206 echo "ôÅËÕÝÉÊ òÅÄÁËÔÉÒÏ×ÁÔØ ÎÁÂÏÒÙ ÍÅÔÁÄÁÎÎÙÈ..."
207else
208 echo "Running the Greenstone Editor for Metadata Sets..."
209fi
210
211# Other arguments you can provide to GEMS to work around memory limitations, or debug
212# -Xms<number>M To set minimum memory (by default 32MB)
213# -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
214# -verbose:gc To set garbage collection messages
215# -Xincgc For incremental garbage collection (significantly slows performance)
216# -Xprof Function call profiling
217# -Xloggc:<file> Write garbage collection log
218
219$javapath -classpath classes/:GLI.jar:lib/apache.jar org.greenstone.gatherer.gems.GEMS -gsdl $GSDLHOME $*
220
221if [ "$glilang" == "es" ]; then
222 echo "¡Hecho!"
223elif [ "$glilang" == "fr" ]; then
224 echo "Terminé!"
225elif [ "$glilang" == "ru" ]; then
226 echo "÷ÙÐÏÌÎÅÎÏ!"
227else
228 echo "Done!"
229fi
Note: See TracBrowser for help on using the repository browser.