source: main/trunk/gli/gems.sh@ 25939

Last change on this file since 25939 was 23590, checked in by ak19, 13 years ago

Changed the script files that launch GS applications to contain an extra Java VM argument called Xdock:name for Darwin (MacOS) machines that will set the program abbreviation as the visible name of the top Mac menubar when the application is running in the Dock menu at the bottom.

  • Property svn:executable set to *
File size: 4.7 KB
Line 
1#!/bin/bash
2
3glilang=en
4
5if [ "$glilang" = "es" ]; then
6 PROGNAME="Editar conjuntos de metadatos"
7elif [ "$glilang" = "fr" ]; then
8 PROGNAME="Editer les jeux de méta-données"
9elif [ "$glilang" = "ru" ]; then
10 PROGNAME="òÅÄÁËÔÉÒÏ×ÁÔØ ÎÁÂÏÒÙ ÍÅÔÁÄÁÎÎÙÈ"
11else
12 PROGNAME="Greenstone Editor for Metadata Sets"
13fi
14
15PROGABBR="GEMS"
16
17PROGNAME_EN="Greenstone Editor for Metadata Sets"
18
19echo
20if [ "$glilang" = "es" ]; then
21 echo "$PROGNAME ($PROGNAME_EN - $PROGABBR)"
22 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
23 echo "GEMS NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
24 echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
25 echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
26elif [ "$glilang" = "fr" ]; then
27 echo "$PROGNAME ($PROGNAME_EN - $PROGABBR)"
28 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
29 echo "GEMS est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
30 echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
31elif [ "$glilang" = "ru" ]; then
32 echo "$PROGNAME ($PROGNAME_EN - $PROGABBR)"
33 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
34 echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
35 echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
36else
37 echo "$PROGNAME ($PROGABBR)"
38 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
39 echo "GEMS comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
40 echo "This is free software, and you are welcome to redistribute it"
41fi
42echo
43
44## -------- Run the Greenstone Editor for Metadata Sets --------
45# This script must be run from within the directory in which it lives
46thisdir="`dirname \"$0\"`"
47thisdir="`cd \"$thisdir\" && pwd`"
48cd "$thisdir"
49
50## ---- Determine GSDLHOME ----
51## gsdlpath can be either Greenstone 3 or Greenstone 2
52exit_status=0
53source ./findgsdl.sh
54exit_status=$?
55if [ "$exit_status" -eq 1 ]; then
56 exit 1;
57fi
58
59## ---- Check Java ----
60# call the script with source, so that we have the variables it sets ($javapath
61exit_status=0
62source ./findjava.sh "$glilang" "$PROGNAME"
63exit_status=$?
64if [ "$exit_status" -eq 1 ]; then
65 exit 1;
66fi
67
68## ---- Check that the GEMS has been compiled ----
69if [ ! -f "classes/org/greenstone/gatherer/gems/GEMS.class" ] && [ ! -f "GLI.jar" ]; then
70 echo
71 if [ "$glilang" = "es" ]; then
72 echo "Usted necesita compilar la $PROGNAME"
73 echo "(por medio de makegli.sh) antes de ejecutar este guión."
74 elif [ "$glilang" = "fr" ]; then
75 echo "Vous devez compiler le $PROGNAME (en utilisant makegli.sh)"
76 echo "avant d'exécuter ce script."
77 elif [ "$glilang" = "ru" ]; then
78 echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ $PROGNAME"
79 echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
80 else
81 echo "You need to compile the $PROGNAME (using makegli.sh)"
82 echo "before running this script."
83 fi
84 exit 1
85fi
86
87## ---- Finally, run the GEMS ----
88echo
89if [ "$glilang" = "es" ]; then
90 echo "Ejecutando la $PROGNAME..."
91elif [ "$glilang" = "fr" ]; then
92 echo "Exécution de $PROGNAME..."
93elif [ "$glilang" = "ru" ]; then
94 echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
95else
96 echo "Running the $PROGNAME..."
97fi
98
99# Other arguments you can provide to GEMS to work around memory limitations, or debug
100# -Xms<number>M To set minimum memory (by default 32MB)
101# -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
102# -verbose:gc To set garbage collection messages
103# -Xincgc For incremental garbage collection (significantly slows performance)
104# -Xprof Function call profiling
105# -Xloggc:<file> Write garbage collection log
106
107# -Xdock:name To set the name of the app in the MacOS Dock bar
108# -Xdock:icon Path to the MacOS Doc icon (not necessary for GS)
109custom_vm_args=""
110if [ "$GSDLOS" = "darwin" ]; then
111 custom_vm_args="-Xdock:name=$PROGABBR"
112fi
113
114# basic_command is the cmd string common to both Greenstone 3 and Greenstone 2 execution
115# (gs3 doesn't -gsdl3src $GSDL3SRCHOME passed to it, it needs $GSDL3HOME to find the collect dir)
116basic_command="$javapath -classpath classes/:GLI.jar:lib/apache.jar $custom_vm_args org.greenstone.gatherer.gems.GEMS"
117
118if [ "$_version" -eq 2 ]; then
119 `$basic_command -gsdl $GSDLHOME $*`
120elif [ "$_version" -eq 3 ]; then
121 `$basic_command -gsdl3 $GSDL3HOME $*`
122fi
123
124
125if [ "$glilang" = "es" ]; then
126 echo "¡Hecho!"
127elif [ "$glilang" = "fr" ]; then
128 echo "Terminé!"
129elif [ "$glilang" = "ru" ]; then
130 echo "÷ÙÐÏÌÎÅÎÏ!"
131else
132 echo "Done!"
133fi
Note: See TracBrowser for help on using the repository browser.