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

Revision 19355, 5.5 KB (checked in by ak19, 11 years ago)

Moved finding java and finding perl logic into findjava.sh and findperl.sh. Findjava.sh is called from gli.sh and client-gli.sh. Still need to call findperl.sh from client-gli.sh, and need to split findgsdl into its own file. Tested.

  • 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
55# This script must be run from within the directory in which it lives
56thisdir=`pwd`
57if [ ! -f "${thisdir}/client-gli.sh" ]; then
58    if [ "$glilang" = "es" ]; then
59        echo "Este guión deberá ejecutarse desde el directorio en el que reside."
60    elif [ "$glilang" = "fr" ]; then
61    echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
62    elif [ "$glilang" = "ru" ]; then
63    echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
64    else
65    echo "This script must be run from the directory in which it resides."
66    fi
67    exit 1
68fi
69
70## ---- findJava ----
71# call the script with source, so that we have the variables it sets ($javapath)
72exit_status=0
73source ./findjava.sh
74exit_status=$?
75if [ "$exit_status" -eq 1 ]; then
76    exit 1;
77fi
78
79## ---- Check that the GLI has been compiled ----
80if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
81    echo
82    if [ "$glilang" = "es" ]; then
83    echo "Usted necesita compilar la Interfaz de la $PROGFULLNAME"
84    echo "(por medio de makegli.sh) antes de ejecutar este guión."
85    elif [ "$glilang" = "fr" ]; then
86    echo "Vous devez compiler le $PROGNAME Interface (en utilisant makegli.sh)"
87    echo "avant d'exécuter ce script."
88    elif [ "$glilang" = "ru" ]; then
89    echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME"
90    echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
91    else
92    echo "You need to compile the $PROGNAME Librarian Interface (using makegli.sh)"
93    echo "before running this script."
94    fi
95    exit 1
96fi
97
98
99## ---- Finally, run the GLI ----
100echo
101if [ "$glilang" = "es" ]; then
102    echo "Ejecutando la Interfaz de la $PROGFULLNAME..."
103elif [ "$glilang" = "fr" ]; then
104    echo "Exécution de $PROGNAME Librarian Interface"
105elif [ "$glilang" = "ru" ]; then
106    echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME..."
107else
108    echo "Running the $PROGNAME Librarian Interface..."
109fi
110
111# Other arguments you can provide to GLI to work around memory limitations, or debug
112# -Xms<number>M    To set minimum memory (by default 32MB)
113# -Xmx<number>M    To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
114# -verbose:gc      To set garbage collection messages
115# -Xincgc          For incremental garbage collection (significantly slows performance)
116# -Xprof           Function call profiling
117# -Xloggc:<file>   Write garbage collection log
118
119# GS2 only requires -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar. GS3 requires more but it doesn't conflict with GS2:
120if [ ! -d "${thisdir}/gs2build" ]; then
121    $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 $*
122else
123    gsdlos=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
124# check for running bash under cygwin
125    if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ; then
126    gsdlos=windows
127    fi
128    $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 $*
129fi
130
131if [ "$glilang" = "es" ]; then
132    echo "¡Hecho!"
133elif [ "$glilang" = "fr" ]; then
134    echo "Terminé!"
135elif [ "$glilang" = "ru" ]; then
136    echo "÷ÙÐÏÌÎÅÎÏ!"
137else
138    echo "Done!"
139fi
Note: See TracBrowser for help on using the browser.