[10759] | 1 | #!/bin/sh
|
---|
| 2 | glilang=en
|
---|
| 3 |
|
---|
[16368] | 4 | if [ "x$PROGNAME" = "x" ] ; then
|
---|
| 5 | PROGNAME="Greenstone"
|
---|
| 6 | if [ "$glilang" = "es" ]; then
|
---|
| 7 | PROGFULLNAME="Biblioteca Digital Greenstone"
|
---|
| 8 | elif [ "$glilang" = "fr" ]; then
|
---|
| 9 | PROGFULLNAME="Bibliothécaire Greenstone"
|
---|
| 10 | elif [ "$glilang" = "ru" ]; then
|
---|
| 11 | PROGFULLNAME="ÉÎÔÅÒÆÅÊÓ Greenstone"
|
---|
| 12 | else
|
---|
| 13 | PROGFULLNAME="Greenstone Digital Library"
|
---|
| 14 | fi
|
---|
| 15 | else
|
---|
| 16 | PROGFULLNAME=$PROGNAME
|
---|
| 17 | fi
|
---|
[23590] | 18 | export PROGNAME
|
---|
| 19 | export PROGFULLNAME
|
---|
[16368] | 20 |
|
---|
| 21 | if [ "x$PROGABBR" = "x" ] ; then
|
---|
[23590] | 22 | PROGABBR="Client-GLI"
|
---|
[16368] | 23 | fi
|
---|
[23590] | 24 | export PROGABBR
|
---|
[16368] | 25 |
|
---|
| 26 | if [ "x$PROGNAME_EN" = "x" ] ; then
|
---|
[23590] | 27 | PROGNAME_EN="Greenstone Librarian Interface - Remote Client"
|
---|
[16368] | 28 | fi
|
---|
[23590] | 29 | export PROGNAME_EN
|
---|
[16368] | 30 |
|
---|
[19403] | 31 | # we're running GLI (or FLI) in client mode
|
---|
| 32 | GLIMODE="client"
|
---|
[16368] | 33 |
|
---|
[19403] | 34 |
|
---|
[10759] | 35 | echo
|
---|
[12287] | 36 | if [ "$glilang" = "es" ]; then
|
---|
[16368] | 37 | echo "Interfaz de la $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
[17946] | 38 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
[16368] | 39 | echo "La Interfaz de la $PROGNAME NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
|
---|
[10759] | 40 | echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
|
---|
| 41 | echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
|
---|
[12287] | 42 | elif [ "$glilang" = "fr" ]; then
|
---|
[16368] | 43 | echo "Interface du $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
[17946] | 44 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
[16368] | 45 | echo "$PROGABBR est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
|
---|
[10759] | 46 | echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
|
---|
[12287] | 47 | elif [ "$glilang" = "ru" ]; then
|
---|
[16368] | 48 | echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
[17946] | 49 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
[10759] | 50 | echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
|
---|
| 51 | echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
|
---|
| 52 | else
|
---|
[16368] | 53 | echo "$PROGNAME Librarian Interface ($PROGABBR)"
|
---|
[17946] | 54 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
[16368] | 55 | echo "$PROGABBR comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
|
---|
[10759] | 56 | echo "This is free software, and you are welcome to redistribute it"
|
---|
| 57 | fi
|
---|
| 58 | echo
|
---|
| 59 |
|
---|
| 60 | ## -------- Run the Greenstone Librarian Interface --------
|
---|
[19392] | 61 | # Need to run this script from its own directory instead of whichever directory it may be called from
|
---|
| 62 | #currentdir=$(cd `dirname "$0"` && pwd)
|
---|
| 63 | thisdir="`dirname \"$0\"`"
|
---|
| 64 | thisdir="`cd \"$thisdir\" && pwd`"
|
---|
| 65 | cd "$thisdir"
|
---|
[10759] | 66 |
|
---|
[19403] | 67 | ## ---- Determine GSDLHOME to see if the download panel can be enabled ----
|
---|
| 68 | # Need to source a script in order to inherit the env vars it has set.
|
---|
| 69 | # Try to detect a local GSDLHOME installation (need gs2build). If none can
|
---|
| 70 | # be found, then client-gli won't have a download panel. We're calling
|
---|
| 71 | # findgsdl.bat purely for knowing if there's a GSDLHOME around and to set and
|
---|
| 72 | # use that for downloading. If there IS a local GSDLHOME, then we can download
|
---|
| 73 | # (and build) locally, but ONLY if we have perl. Else downloading and building
|
---|
| 74 | # will have to be done remotely anyway. If Perl is found, PERLPATH will be set.
|
---|
| 75 | source ./findgsdl.sh
|
---|
| 76 | local_gs="false"
|
---|
| 77 | if [ "x$GSDLHOME" != "x" ] ; then
|
---|
| 78 | # GSDLHOME set, test for perl
|
---|
| 79 | # no need to source the findperl script since it does not set env vars
|
---|
| 80 | exit_status=0
|
---|
| 81 | ./findperl.sh
|
---|
| 82 | exit_status=$?
|
---|
| 83 | if [ "$exit_status" -ne 1 ]; then
|
---|
| 84 | local_gs="true"
|
---|
| 85 | fi
|
---|
| 86 | fi
|
---|
| 87 |
|
---|
| 88 |
|
---|
[19355] | 89 | ## ---- findJava ----
|
---|
| 90 | # call the script with source, so that we have the variables it sets ($javapath)
|
---|
| 91 | exit_status=0
|
---|
[19769] | 92 | source ./findjava.sh "$glilang" "$PROGABBR"
|
---|
[19355] | 93 | exit_status=$?
|
---|
| 94 | if [ "$exit_status" -eq 1 ]; then
|
---|
| 95 | exit 1;
|
---|
[10759] | 96 | fi
|
---|
| 97 |
|
---|
| 98 | ## ---- Check that the GLI has been compiled ----
|
---|
| 99 | if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
|
---|
| 100 | echo
|
---|
[12287] | 101 | if [ "$glilang" = "es" ]; then
|
---|
[16368] | 102 | echo "Usted necesita compilar la Interfaz de la $PROGFULLNAME"
|
---|
[10759] | 103 | echo "(por medio de makegli.sh) antes de ejecutar este guión."
|
---|
[12287] | 104 | elif [ "$glilang" = "fr" ]; then
|
---|
[16368] | 105 | echo "Vous devez compiler le $PROGNAME Interface (en utilisant makegli.sh)"
|
---|
[10759] | 106 | echo "avant d'exécuter ce script."
|
---|
[12287] | 107 | elif [ "$glilang" = "ru" ]; then
|
---|
[16368] | 108 | echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME"
|
---|
[10759] | 109 | echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
|
---|
| 110 | else
|
---|
[16368] | 111 | echo "You need to compile the $PROGNAME Librarian Interface (using makegli.sh)"
|
---|
[10759] | 112 | echo "before running this script."
|
---|
| 113 | fi
|
---|
| 114 | exit 1
|
---|
| 115 | fi
|
---|
| 116 |
|
---|
| 117 |
|
---|
| 118 | ## ---- Finally, run the GLI ----
|
---|
| 119 | echo
|
---|
[12287] | 120 | if [ "$glilang" = "es" ]; then
|
---|
[16368] | 121 | echo "Ejecutando la Interfaz de la $PROGFULLNAME..."
|
---|
[12287] | 122 | elif [ "$glilang" = "fr" ]; then
|
---|
[16368] | 123 | echo "Exécution de $PROGNAME Librarian Interface"
|
---|
[12287] | 124 | elif [ "$glilang" = "ru" ]; then
|
---|
[16368] | 125 | echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME..."
|
---|
[10759] | 126 | else
|
---|
[16368] | 127 | echo "Running the $PROGNAME Librarian Interface..."
|
---|
[10759] | 128 | fi
|
---|
| 129 |
|
---|
| 130 | # Other arguments you can provide to GLI to work around memory limitations, or debug
|
---|
| 131 | # -Xms<number>M To set minimum memory (by default 32MB)
|
---|
| 132 | # -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
|
---|
| 133 | # -verbose:gc To set garbage collection messages
|
---|
| 134 | # -Xincgc For incremental garbage collection (significantly slows performance)
|
---|
| 135 | # -Xprof Function call profiling
|
---|
| 136 | # -Xloggc:<file> Write garbage collection log
|
---|
| 137 |
|
---|
[23590] | 138 | # -Xdock:name To set the name of the app in the MacOS Dock bar
|
---|
| 139 | # -Xdock:icon Path to the MacOS Doc icon (not necessary for GS)
|
---|
| 140 | custom_vm_args=""
|
---|
| 141 | if [ "$GSDLOS" = "darwin" ]; then
|
---|
| 142 | custom_vm_args="-Xdock:name=$PROGABBR"
|
---|
| 143 | fi
|
---|
| 144 |
|
---|
[16368] | 145 | # GS2 only requires -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar. GS3 requires more but it doesn't conflict with GS2:
|
---|
[19403] | 146 | if [ "$local_gs" = "false" ]; then
|
---|
| 147 | echo "Since there's no GSDLHOME, client-GLI's download panel will be deactivated."
|
---|
| 148 | echo
|
---|
[23590] | 149 | $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar $custom_vm_args org.greenstone.gatherer.GathererProg -use_remote_greenstone $*
|
---|
[19305] | 150 | else
|
---|
[19313] | 151 | gsdlos=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
---|
[19403] | 152 | # check for running bash under cygwin
|
---|
[19313] | 153 | if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ; then
|
---|
| 154 | gsdlos=windows
|
---|
| 155 | fi
|
---|
[19403] | 156 | echo "Perl and GSDLHOME ($GSDLHOME) detected."
|
---|
| 157 | echo "Downloading is enabled."
|
---|
| 158 | echo
|
---|
[23590] | 159 | $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar $custom_vm_args org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "$GSDLHOME" -gsdlos $gsdlos $*
|
---|
[19305] | 160 | fi
|
---|
[10759] | 161 |
|
---|
[12287] | 162 | if [ "$glilang" = "es" ]; then
|
---|
[10759] | 163 | echo "¡Hecho!"
|
---|
[12287] | 164 | elif [ "$glilang" = "fr" ]; then
|
---|
[10759] | 165 | echo "Terminé!"
|
---|
[12287] | 166 | elif [ "$glilang" = "ru" ]; then
|
---|
[10759] | 167 | echo "÷ÙÐÏÌÎÅÎÏ!"
|
---|
| 168 | else
|
---|
| 169 | echo "Done!"
|
---|
| 170 | fi |
---|