[20968] | 1 | #!/bin/bash
|
---|
[16546] | 2 |
|
---|
[8272] | 3 | glilang=en
|
---|
| 4 |
|
---|
[16546] | 5 | if [ "$glilang" = "es" ]; then
|
---|
| 6 | PROGNAME="Editar conjuntos de metadatos"
|
---|
| 7 | elif [ "$glilang" = "fr" ]; then
|
---|
| 8 | PROGNAME="Editer les jeux de méta-données"
|
---|
| 9 | elif [ "$glilang" = "ru" ]; then
|
---|
| 10 | PROGNAME="òÅÄÁËÔÉÒÏ×ÁÔØ ÎÁÂÏÒÙ ÍÅÔÁÄÁÎÎÙÈ"
|
---|
| 11 | else
|
---|
| 12 | PROGNAME="Greenstone Editor for Metadata Sets"
|
---|
| 13 | fi
|
---|
| 14 |
|
---|
| 15 | PROGABBR="GEMS"
|
---|
| 16 |
|
---|
| 17 | PROGNAME_EN="Greenstone Editor for Metadata Sets"
|
---|
| 18 |
|
---|
[8272] | 19 | echo
|
---|
[12287] | 20 | if [ "$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] | 26 | elif [ "$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] | 31 | elif [ "$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 "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
|
---|
| 36 | else
|
---|
[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"
|
---|
| 41 | fi
|
---|
| 42 | echo
|
---|
| 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] | 46 | thisdir="`dirname \"$0\"`"
|
---|
| 47 | thisdir="`cd \"$thisdir\" && pwd`"
|
---|
| 48 | cd "$thisdir"
|
---|
[8272] | 49 |
|
---|
| 50 | ## ---- Determine GSDLHOME ----
|
---|
[16546] | 51 | ## gsdlpath can be either Greenstone 3 or Greenstone 2
|
---|
[22336] | 52 | exit_status=0
|
---|
| 53 | source ./findgsdl.sh
|
---|
| 54 | exit_status=$?
|
---|
| 55 | if [ "$exit_status" -eq 1 ]; then
|
---|
| 56 | exit 1;
|
---|
[8272] | 57 | fi
|
---|
| 58 |
|
---|
[17819] | 59 | ## ---- Check Java ----
|
---|
[22336] | 60 | # call the script with source, so that we have the variables it sets ($javapath
|
---|
| 61 | exit_status=0
|
---|
| 62 | source ./findjava.sh "$glilang" "$PROGNAME"
|
---|
| 63 | exit_status=$?
|
---|
| 64 | if [ "$exit_status" -eq 1 ]; then
|
---|
| 65 | exit 1;
|
---|
[8272] | 66 | fi
|
---|
| 67 |
|
---|
[10788] | 68 | ## ---- Check that the GEMS has been compiled ----
|
---|
[8272] | 69 | if [ ! -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
|
---|
| 85 | fi
|
---|
| 86 |
|
---|
[10788] | 87 | ## ---- Finally, run the GEMS ----
|
---|
[8272] | 88 | echo
|
---|
[12287] | 89 | if [ "$glilang" = "es" ]; then
|
---|
[16546] | 90 | echo "Ejecutando la $PROGNAME..."
|
---|
[12287] | 91 | elif [ "$glilang" = "fr" ]; then
|
---|
[16546] | 92 | echo "Exécution de $PROGNAME..."
|
---|
[12287] | 93 | elif [ "$glilang" = "ru" ]; then
|
---|
[16546] | 94 | echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
|
---|
[10788] | 95 | else
|
---|
[16546] | 96 | echo "Running the $PROGNAME..."
|
---|
[10788] | 97 | fi
|
---|
[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)
|
---|
| 109 | custom_vm_args=""
|
---|
| 110 | if [ "$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] | 115 | fi
|
---|
| 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] | 119 | basic_command="$javapath -classpath classes/:GLI.jar:lib/apache.jar $custom_vm_args org.greenstone.gatherer.gems.GEMS"
|
---|
[8272] | 120 |
|
---|
[16546] | 121 | if [ "$_version" -eq 2 ]; then
|
---|
| 122 | `$basic_command -gsdl $GSDLHOME $*`
|
---|
| 123 | elif [ "$_version" -eq 3 ]; then
|
---|
| 124 | `$basic_command -gsdl3 $GSDL3HOME $*`
|
---|
| 125 | fi
|
---|
| 126 |
|
---|
| 127 |
|
---|
[12287] | 128 | if [ "$glilang" = "es" ]; then
|
---|
[8272] | 129 | echo "¡Hecho!"
|
---|
[12287] | 130 | elif [ "$glilang" = "fr" ]; then
|
---|
[8272] | 131 | echo "Terminé!"
|
---|
[12287] | 132 | elif [ "$glilang" = "ru" ]; then
|
---|
[8272] | 133 | echo "÷ÙÐÏÌÎÅÎÏ!"
|
---|
| 134 | else
|
---|
| 135 | echo "Done!"
|
---|
[17819] | 136 | fi
|
---|