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

Last change on this file since 30119 was 30119, checked in by ak19, 9 years ago

Mac icons for when launching the startup scripts from the command line. This also ensures the appropriate icon for the second item in the dock panel when launching the .app files.

  • Property svn:executable set to *
File size: 4.8 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"
[30119]112 if [ -f "../gems.app/Contents/Resources/AutomatorApplet.icns" ]; then
113 custom_vm_args="$custom_vm_args -Xdock:icon=../gems.app/Contents/Resources/AutomatorApplet.icns"
114 fi
[23590]115fi
116
[16546]117# basic_command is the cmd string common to both Greenstone 3 and Greenstone 2 execution
118# (gs3 doesn't -gsdl3src $GSDL3SRCHOME passed to it, it needs $GSDL3HOME to find the collect dir)
[23590]119basic_command="$javapath -classpath classes/:GLI.jar:lib/apache.jar $custom_vm_args org.greenstone.gatherer.gems.GEMS"
[8272]120
[16546]121if [ "$_version" -eq 2 ]; then
122 `$basic_command -gsdl $GSDLHOME $*`
123elif [ "$_version" -eq 3 ]; then
124 `$basic_command -gsdl3 $GSDL3HOME $*`
125fi
126
127
[12287]128if [ "$glilang" = "es" ]; then
[8272]129 echo "¡Hecho!"
[12287]130elif [ "$glilang" = "fr" ]; then
[8272]131 echo "Terminé!"
[12287]132elif [ "$glilang" = "ru" ]; then
[8272]133 echo "÷ÙÐÏÌÎÅÎÏ!"
134else
135 echo "Done!"
[17819]136fi
Note: See TracBrowser for help on using the repository browser.