source: main/tags/3.03/gli/gems.sh@ 21154

Last change on this file since 21154 was 12453, checked in by mdewsnip, 18 years ago

Changed copyright date to 2006.

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