1 | #!/bin/sh
|
---|
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 |
|
---|
19 | if [ "x$PROGABBR" = "x" ] ; then
|
---|
20 | PROGABBR="GLI"
|
---|
21 | fi
|
---|
22 |
|
---|
23 | if [ "x$PROGNAME_EN" = "x" ] ; then
|
---|
24 | PROGNAME_EN="Greenstone Librarian Interface"
|
---|
25 | fi
|
---|
26 |
|
---|
27 |
|
---|
28 | echo
|
---|
29 | if [ "$glilang" = "es" ]; then
|
---|
30 | echo "Interfaz de la $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
31 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
32 | echo "La Interfaz de la $PROGNAME NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
|
---|
33 | echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
|
---|
34 | echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
|
---|
35 | elif [ "$glilang" = "fr" ]; then
|
---|
36 | echo "Interface du $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
37 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
38 | echo "$PROGABBR est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
|
---|
39 | echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
|
---|
40 | elif [ "$glilang" = "ru" ]; then
|
---|
41 | echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
|
---|
42 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
43 | echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
|
---|
44 | echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
|
---|
45 | else
|
---|
46 | echo "$PROGNAME Librarian Interface ($PROGABBR)"
|
---|
47 | echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
|
---|
48 | echo "$PROGABBR comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
|
---|
49 | echo "This is free software, and you are welcome to redistribute it"
|
---|
50 | fi
|
---|
51 | echo
|
---|
52 |
|
---|
53 | ## -------- Run the Greenstone Librarian Interface --------
|
---|
54 | # Need to run this script from its own directory instead of whichever directory it may be called from
|
---|
55 | #currentdir=$(cd `dirname "$0"` && pwd)
|
---|
56 | thisdir="`dirname \"$0\"`"
|
---|
57 | thisdir="`cd \"$thisdir\" && pwd`"
|
---|
58 | cd "$thisdir"
|
---|
59 |
|
---|
60 | ## ---- findJava ----
|
---|
61 | # call the script with source, so that we have the variables it sets ($javapath)
|
---|
62 | exit_status=0
|
---|
63 | source ./findjava.sh
|
---|
64 | exit_status=$?
|
---|
65 | if [ "$exit_status" -eq 1 ]; then
|
---|
66 | exit 1;
|
---|
67 | fi
|
---|
68 |
|
---|
69 | ## ---- Check that the GLI has been compiled ----
|
---|
70 | if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
|
---|
71 | echo
|
---|
72 | if [ "$glilang" = "es" ]; then
|
---|
73 | echo "Usted necesita compilar la Interfaz de la $PROGFULLNAME"
|
---|
74 | echo "(por medio de makegli.sh) antes de ejecutar este guión."
|
---|
75 | elif [ "$glilang" = "fr" ]; then
|
---|
76 | echo "Vous devez compiler le $PROGNAME Interface (en utilisant makegli.sh)"
|
---|
77 | echo "avant d'exécuter ce script."
|
---|
78 | elif [ "$glilang" = "ru" ]; then
|
---|
79 | echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME"
|
---|
80 | echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
|
---|
81 | else
|
---|
82 | echo "You need to compile the $PROGNAME Librarian Interface (using makegli.sh)"
|
---|
83 | echo "before running this script."
|
---|
84 | fi
|
---|
85 | exit 1
|
---|
86 | fi
|
---|
87 |
|
---|
88 |
|
---|
89 | ## ---- Finally, run the GLI ----
|
---|
90 | echo
|
---|
91 | if [ "$glilang" = "es" ]; then
|
---|
92 | echo "Ejecutando la Interfaz de la $PROGFULLNAME..."
|
---|
93 | elif [ "$glilang" = "fr" ]; then
|
---|
94 | echo "Exécution de $PROGNAME Librarian Interface"
|
---|
95 | elif [ "$glilang" = "ru" ]; then
|
---|
96 | echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME..."
|
---|
97 | else
|
---|
98 | echo "Running the $PROGNAME Librarian Interface..."
|
---|
99 | fi
|
---|
100 |
|
---|
101 | # Other arguments you can provide to GLI to work around memory limitations, or debug
|
---|
102 | # -Xms<number>M To set minimum memory (by default 32MB)
|
---|
103 | # -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
|
---|
104 | # -verbose:gc To set garbage collection messages
|
---|
105 | # -Xincgc For incremental garbage collection (significantly slows performance)
|
---|
106 | # -Xprof Function call profiling
|
---|
107 | # -Xloggc:<file> Write garbage collection log
|
---|
108 |
|
---|
109 | # GS2 only requires -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar. GS3 requires more but it doesn't conflict with GS2:
|
---|
110 | if [ ! -d "${thisdir}/gs2build" ]; then
|
---|
111 | $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 org.greenstone.gatherer.GathererProg -use_remote_greenstone $*
|
---|
112 | else
|
---|
113 | gsdlos=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
---|
114 | # check for running bash under cygwin
|
---|
115 | if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ; then
|
---|
116 | gsdlos=windows
|
---|
117 | fi
|
---|
118 | $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 org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl "${thisdir}/gs2build" -gsdlos $gsdlos $*
|
---|
119 | fi
|
---|
120 |
|
---|
121 | if [ "$glilang" = "es" ]; then
|
---|
122 | echo "¡Hecho!"
|
---|
123 | elif [ "$glilang" = "fr" ]; then
|
---|
124 | echo "Terminé!"
|
---|
125 | elif [ "$glilang" = "ru" ]; then
|
---|
126 | echo "÷ÙÐÏÌÎÅÎÏ!"
|
---|
127 | else
|
---|
128 | echo "Done!"
|
---|
129 | fi |
---|