1 | #!/bin/bash
|
---|
2 | glilang=en
|
---|
3 |
|
---|
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
|
---|
18 | export PROGNAME
|
---|
19 | export PROGFULLNAME
|
---|
20 |
|
---|
21 | if [ "x$PROGABBR" = "x" ] ; then
|
---|
22 | PROGABBR="Client-GLI"
|
---|
23 | fi
|
---|
24 | export PROGABBR
|
---|
25 |
|
---|
26 | if [ "x$PROGNAME_EN" = "x" ] ; then
|
---|
27 | PROGNAME_EN="Greenstone Librarian Interface - Remote Client"
|
---|
28 | fi
|
---|
29 | export PROGNAME_EN
|
---|
30 |
|
---|
31 | # we're running GLI (or FLI) in client mode
|
---|
32 | GLIMODE="client"
|
---|
33 |
|
---|
34 |
|
---|
35 | echo
|
---|
36 | if [ "$glilang" = "es" ]; then
|
---|
37 | echo "Interfaz de la $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
38 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
39 | echo "La Interfaz de la $PROGNAME NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
|
---|
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"
|
---|
42 | elif [ "$glilang" = "fr" ]; then
|
---|
43 | echo "Interface du $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
44 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
45 | echo "$PROGABBR est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
|
---|
46 | echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
|
---|
47 | elif [ "$glilang" = "ru" ]; then
|
---|
48 | echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
49 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
50 | echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
|
---|
51 | echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
|
---|
52 | else
|
---|
53 | echo "$PROGNAME Librarian Interface ($PROGABBR)"
|
---|
54 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
55 | echo "$PROGABBR comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
|
---|
56 | echo "This is free software, and you are welcome to redistribute it"
|
---|
57 | fi
|
---|
58 | echo
|
---|
59 |
|
---|
60 | ## -------- Run the Greenstone Librarian Interface --------
|
---|
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"
|
---|
66 |
|
---|
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 |
|
---|
89 | ## ---- findJava ----
|
---|
90 | # call the script with source, so that we have the variables it sets ($javapath)
|
---|
91 | exit_status=0
|
---|
92 | source ./findjava.sh "$glilang" "$PROGABBR"
|
---|
93 | exit_status=$?
|
---|
94 | if [ "$exit_status" -eq 1 ]; then
|
---|
95 | exit 1;
|
---|
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
|
---|
101 | if [ "$glilang" = "es" ]; then
|
---|
102 | echo "Usted necesita compilar la Interfaz de la $PROGFULLNAME"
|
---|
103 | echo "(por medio de makegli.sh) antes de ejecutar este guión."
|
---|
104 | elif [ "$glilang" = "fr" ]; then
|
---|
105 | echo "Vous devez compiler le $PROGNAME Interface (en utilisant makegli.sh)"
|
---|
106 | echo "avant d'exécuter ce script."
|
---|
107 | elif [ "$glilang" = "ru" ]; then
|
---|
108 | echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME"
|
---|
109 | echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
|
---|
110 | else
|
---|
111 | echo "You need to compile the $PROGNAME Librarian Interface (using makegli.sh)"
|
---|
112 | echo "before running this script."
|
---|
113 | fi
|
---|
114 | exit 1
|
---|
115 | fi
|
---|
116 |
|
---|
117 |
|
---|
118 | ## ---- Finally, run the GLI ----
|
---|
119 | echo
|
---|
120 | if [ "$glilang" = "es" ]; then
|
---|
121 | echo "Ejecutando la Interfaz de la $PROGFULLNAME..."
|
---|
122 | elif [ "$glilang" = "fr" ]; then
|
---|
123 | echo "Exécution de $PROGNAME Librarian Interface"
|
---|
124 | elif [ "$glilang" = "ru" ]; then
|
---|
125 | echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME..."
|
---|
126 | else
|
---|
127 | echo "Running the $PROGNAME Librarian Interface..."
|
---|
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 |
|
---|
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 |
|
---|
145 | # GS2 only requires -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar. GS3 requires more but it doesn't conflict with GS2:
|
---|
146 | if [ "$local_gs" = "false" ]; then
|
---|
147 | echo "Since there's no GSDLHOME, client-GLI's download panel will be deactivated."
|
---|
148 | echo
|
---|
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 $*
|
---|
150 | else
|
---|
151 | gsdlos=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
---|
152 | # check for running bash under cygwin
|
---|
153 | if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ; then
|
---|
154 | gsdlos=windows
|
---|
155 | fi
|
---|
156 | echo "Perl and GSDLHOME ($GSDLHOME) detected."
|
---|
157 | echo "Downloading is enabled."
|
---|
158 | echo
|
---|
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 $*
|
---|
160 | fi
|
---|
161 |
|
---|
162 | if [ "$glilang" = "es" ]; then
|
---|
163 | echo "¡Hecho!"
|
---|
164 | elif [ "$glilang" = "fr" ]; then
|
---|
165 | echo "Terminé!"
|
---|
166 | elif [ "$glilang" = "ru" ]; then
|
---|
167 | echo "÷ÙÐÏÌÎÅÎÏ!"
|
---|
168 | else
|
---|
169 | echo "Done!"
|
---|
170 | fi |
---|