source: trunk/script/expeditee

Last change on this file was 1074, checked in by davidb, 8 years ago

To run both with and without EXPEDITEE_FILESYSTEM set

  • Property svn:executable set to *
File size: 5.8 KB
Line 
1#!/bin/bash
2
3if [ ! -z $explang ] ; then
4 explang=en
5fi
6
7# Our French and Spanish strings are in 'ISO-8859-1' (Latin 1) encoding;
8# Russian is the Cyrillic alphabet encoding, 'KOI8-R'
9
10if [ "x$PROGNAME" = "x" ] ; then
11 if [ "$explang" = "es" ]; then
12 PROGNAME="Navegador Expeditee"
13 elif [ "$explang" = "fr" ]; then
14 PROGNAME="Navigateur Expeditee"
15 elif [ "$explang" = "ru" ]; then
16 PROGNAME="âÒÁÕÚÅÒ Expeditee"
17 else
18 PROGNAME="Expeditee Browser"
19 fi
20fi
21
22if [ "x$PROGABBR" = "x" ] ; then
23 PROGABBR="Expeditee"
24fi
25
26if [ "x$PROGNAME_EN" = "x" ] ; then
27 PROGNAME_EN="Expeditee Browser"
28fi
29
30if [ "x$EXPMODE" = "x" ] ; then
31 EXPMODE="local"
32fi
33
34echo
35if [ "$explang" = "es" ]; then
36 echo "Interfaz de la $PROGNAME ($PROGNAME_EN - $PROGABBR)"
37 echo "Copyright (C) 2013, New Zealand Digital Library Project, University Of Waikato"
38 echo "La Interfaz de la $PROGNAME NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
39 echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
40 echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
41elif [ "$explang" = "fr" ]; then
42 echo "Interface du $PROGNAME ($PROGNAME_EN - $PROGABBR)"
43 echo "Copyright (C) 2013, New Zealand Digital Library Project, University Of Waikato"
44 echo "$PROGABBR est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
45 echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
46elif [ "$explang" = "ru" ]; then
47 echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME ($PROGNAME_EN - $PROGABBR)"
48 echo "Copyright (C) 2013, New Zealand Digital Library Project, University Of Waikato"
49 echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
50 echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
51else
52 echo "$PROGNAME ($PROGABBR)"
53 echo "Copyright (C) 2013, New Zealand Digital Library Project, University Of Waikato"
54 echo "$PROGABBR comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
55 echo "This is free software, and you are welcome to redistribute it"
56fi
57echo
58
59## -------- Run the Expeditee Browser --------
60# This script is designed to be run from its own directory (instead of whichever directory it may be called from)
61# => Work out where that is, and 'cd' there
62thisdir="`dirname \"$0\"`"
63thisdir="`cd \"$thisdir\" && pwd`"
64cd "$thisdir"
65
66
67## ---- Determine EXPEDITEE_HOME ----
68# need to source a script in order to inherit the env vars it has set
69# Exit on error code (non-zero)
70exit_status=0
71#source ./findexpeditee.sh
72#exit_status=$?
73#if [ "$exit_status" -eq 1 ]; then
74# exit 1;
75#fi
76
77## ---- Check Java ----
78# call the script with source, so that we have the variables it sets ($javapath)
79#exit_status=0
80#source ./findjava.sh "$explang" "$PROGNAME"
81#exit_status=$?
82#if [ "$exit_status" -eq 1 ]; then
83# exit 1;
84#fi
85
86## ---- Finally, run Expeditee ----
87if [ "$explang" = "es" ]; then
88 echo "Ejecutando la Interfaz de la $PROGNAME..."
89elif [ "$explang" = "fr" ]; then
90 echo "Exécution de $PROGNAME..."
91elif [ "$explang" = "ru" ]; then
92 echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
93else
94 echo "Running the $PROGNAME..."
95fi
96
97# basic_command is the cmd string to execution is
98# basic_command="$javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar org.greenstone.gatherer.GathererProg"
99
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# -Xdock:name To set the name of the app in the MacOS Dock bar
110# -Xdock:icon Path to the MacOS Doc icon (not necessary for GS)
111
112
113custom_vm_args=""
114if [ "$EXPOS" = "darwin" ]; then
115 custom_vm_args="-Xdock:name=$PROGABBR"
116fi
117
118
119cygwin_detected=0
120cygpath -h 2>/dev/null
121if [ $? == 0 ] ; then
122 cygwin_detected=1
123fi
124
125#"$javapath" -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar $custom_vm_args org.greenstone.gatherer.GathererProg -gsdl "$GSDLHOME" -gsdlos $GSDLOS -gsdl3 "$GSDL3HOME" -gsdl3src "$GSDL3SRCHOME" $*
126
127
128jars='jars/JEP.jar:jars/JFreeCharts.jar:jars/activation.jar:jars/cobra.jar:jars/ext:jars/iText-2.1.3.jar:jars/jazzy-core.jar:jars/jcommon-1.0.13.jar:jars/js.jar:jars/lobo-pub.jar:jars/lobo.jar:jars/mail.jar:jars/xercesImpl.jar'
129
130jars="$jars:releases/Expeditee.jar"
131
132if [ $cygwin_detected = "1" ] ; then
133 jars=`cygpath -wp "$jars"`
134fi
135
136
137opt_java_props=""
138if [ "x$EXPEDITEE_FILESYSTEM" != "x" ] ; then
139 if [ ! -d "$EXPEDITEE_FILESYSTEM" ] ; then
140 echo "++ Detected explicit Expeditee filesystem setting"
141 echo "++ Creating \"$EXPEDITEE_FILESYSTEM\""
142 echo ""
143 mkdir "$EXPEDITEE_FILESYSTEM"
144 if [ $? != 0 ] ; then
145 echo "Failed to create directory \"$EXPEDITEE_FILESYSTEM\"" >&2
146 exit -1
147 fi
148 fi
149 _expeditee_filesystem=""
150 if [ $cygwin_detected = "1" ] ; then
151 _expeditee_filesystem=`cygpath -ws "$EXPEDITEE_FILESYSTEM" | sed 's/\\\\/\\\\\\\\/g'`
152 else
153 _expeditee_filesystem="$EXPEDITEE_FILESYSTEM"
154 fi
155
156 opt_java_props="-Dexpeditee.home=$_expeditee_filesystem"
157
158 cd "$EXPEDITEE_HOME"
159 java $custom_vm_args "$opt_java_props" -classpath releases/Expeditee.jar org.apollo.ApolloSystem $*
160
161else
162 cd "$EXPEDITEE_HOME"
163 java $custom_vm_args -classpath releases/Expeditee.jar org.apollo.ApolloSystem $*
164
165fi
166
167#java -classpath "$jars" org.expeditee.gui.Browser $*
168
169
170if [ "$explang" = "es" ]; then
171 echo "Hecho."
172elif [ "$explang" = "fr" ]; then
173 echo "Terminé."
174elif [ "$explang" = "ru" ]; then
175 echo "÷ÙÐÏÌÎÅÎÏ."
176else
177 echo "Done."
178fi
Note: See TracBrowser for help on using the repository browser.