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

Last change on this file since 23590 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
RevLine 
[20968]1#!/bin/bash
[16546]2
[8272]3glilang=en
4
[16546]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
[8272]19echo
[12287]20if [ "$glilang" = "es" ]; then
[16546]21 echo "$PROGNAME ($PROGNAME_EN - $PROGABBR)"
[17946]22 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
[10788]23 echo "GEMS NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
[8272]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"
[12287]26elif [ "$glilang" = "fr" ]; then
[16546]27 echo "$PROGNAME ($PROGNAME_EN - $PROGABBR)"
[17946]28 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
[10788]29 echo "GEMS est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
[8272]30 echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
[12287]31elif [ "$glilang" = "ru" ]; then
[16546]32 echo "$PROGNAME ($PROGNAME_EN - $PROGABBR)"
[17946]33 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
[8272]34 echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
35 echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
36else
[16546]37 echo "$PROGNAME ($PROGABBR)"
[17946]38 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
[10788]39 echo "GEMS comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
[8272]40 echo "This is free software, and you are welcome to redistribute it"
41fi
42echo
43
[10788]44## -------- Run the Greenstone Editor for Metadata Sets --------
[8272]45# This script must be run from within the directory in which it lives
[22336]46thisdir="`dirname \"$0\"`"
47thisdir="`cd \"$thisdir\" && pwd`"
48cd "$thisdir"
[8272]49
50## ---- Determine GSDLHOME ----
[16546]51## gsdlpath can be either Greenstone 3 or Greenstone 2
[22336]52exit_status=0
53source ./findgsdl.sh
54exit_status=$?
55if [ "$exit_status" -eq 1 ]; then
56 exit 1;
[8272]57fi
58
[17819]59## ---- Check Java ----
[22336]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;
[8272]66fi
67
[10788]68## ---- Check that the GEMS has been compiled ----
[8272]69if [ ! -f "classes/org/greenstone/gatherer/gems/GEMS.class" ] && [ ! -f "GLI.jar" ]; then
[10788]70 echo
[12287]71 if [ "$glilang" = "es" ]; then
[16546]72 echo "Usted necesita compilar la $PROGNAME"
[8272]73 echo "(por medio de makegli.sh) antes de ejecutar este guión."
[12287]74 elif [ "$glilang" = "fr" ]; then
[16546]75 echo "Vous devez compiler le $PROGNAME (en utilisant makegli.sh)"
[8272]76 echo "avant d'exécuter ce script."
[12287]77 elif [ "$glilang" = "ru" ]; then
[16546]78 echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ $PROGNAME"
[8272]79 echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
80 else
[16546]81 echo "You need to compile the $PROGNAME (using makegli.sh)"
[8272]82 echo "before running this script."
83 fi
84 exit 1
85fi
86
[10788]87## ---- Finally, run the GEMS ----
[8272]88echo
[12287]89if [ "$glilang" = "es" ]; then
[16546]90 echo "Ejecutando la $PROGNAME..."
[12287]91elif [ "$glilang" = "fr" ]; then
[16546]92 echo "Exécution de $PROGNAME..."
[12287]93elif [ "$glilang" = "ru" ]; then
[16546]94 echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
[10788]95else
[16546]96 echo "Running the $PROGNAME..."
[10788]97fi
[8272]98
[10788]99# Other arguments you can provide to GEMS to work around memory limitations, or debug
[8272]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
[23590]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
[16546]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)
[23590]116basic_command="$javapath -classpath classes/:GLI.jar:lib/apache.jar $custom_vm_args org.greenstone.gatherer.gems.GEMS"
[8272]117
[16546]118if [ "$_version" -eq 2 ]; then
119 `$basic_command -gsdl $GSDLHOME $*`
120elif [ "$_version" -eq 3 ]; then
121 `$basic_command -gsdl3 $GSDL3HOME $*`
122fi
123
124
[12287]125if [ "$glilang" = "es" ]; then
[8272]126 echo "¡Hecho!"
[12287]127elif [ "$glilang" = "fr" ]; then
[8272]128 echo "Terminé!"
[12287]129elif [ "$glilang" = "ru" ]; then
[8272]130 echo "÷ÙÐÏÌÎÅÎÏ!"
131else
132 echo "Done!"
[17819]133fi
Note: See TracBrowser for help on using the repository browser.