root/gli/trunk/client-gli.sh @ 19392

Revision 19392, 5.1 KB (checked in by ak19, 11 years ago)

Allowing the user to run the gli and client-gli scripts from other directories.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/bin/sh
2glilang=en
3
4if [ "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
17fi
18
19if [ "x$PROGABBR" = "x" ] ; then
20    PROGABBR="GLI"
21fi
22
23if [ "x$PROGNAME_EN" = "x" ] ; then
24    PROGNAME_EN="Greenstone Librarian Interface"
25fi
26
27
28echo
29if [ "$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"
35elif [ "$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"
40elif [ "$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 "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
45else
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"
50fi
51echo
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)
56thisdir="`dirname \"$0\"`"
57thisdir="`cd \"$thisdir\" && pwd`"
58cd "$thisdir"
59
60## ---- findJava ----
61# call the script with source, so that we have the variables it sets ($javapath)
62exit_status=0
63source ./findjava.sh
64exit_status=$?
65if [ "$exit_status" -eq 1 ]; then
66    exit 1;
67fi
68
69## ---- Check that the GLI has been compiled ----
70if [ ! -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
86fi
87
88
89## ---- Finally, run the GLI ----
90echo
91if [ "$glilang" = "es" ]; then
92    echo "Ejecutando la Interfaz de la $PROGFULLNAME..."
93elif [ "$glilang" = "fr" ]; then
94    echo "Exécution de $PROGNAME Librarian Interface"
95elif [ "$glilang" = "ru" ]; then
96    echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME..."
97else
98    echo "Running the $PROGNAME Librarian Interface..."
99fi
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:
110if [ ! -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 $*
112else
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 $*
119fi
120
121if [ "$glilang" = "es" ]; then
122    echo "¡Hecho!"
123elif [ "$glilang" = "fr" ]; then
124    echo "Terminé!"
125elif [ "$glilang" = "ru" ]; then
126    echo "÷ÙÐÏÌÎÅÎÏ!"
127else
128    echo "Done!"
129fi
Note: See TracBrowser for help on using the browser.