1 | #!/bin/sh
|
---|
2 | glilang=en
|
---|
3 |
|
---|
4 |
|
---|
5 | # This script must be run from within the directory in which it lives
|
---|
6 | thisdir=`pwd`
|
---|
7 | if [ ! -f "${thisdir}/makejar.sh" ]; then
|
---|
8 | if [ "$glilang" == "es" ]; then
|
---|
9 | echo "Este guión deberá ejecutarse desde el directorio en el que reside."
|
---|
10 | elif [ "$glilang" == "fr" ]; then
|
---|
11 | echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
|
---|
12 | elif [ "$glilang" == "ru" ]; then
|
---|
13 | echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
|
---|
14 | else
|
---|
15 | echo "This script must be run from the directory in which it resides."
|
---|
16 | fi
|
---|
17 | exit 1
|
---|
18 | fi
|
---|
19 |
|
---|
20 | ## ---- Check that the GLI has been compiled ----
|
---|
21 | if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ]; then
|
---|
22 | echo
|
---|
23 | if [ "$glilang" == "es" ]; then
|
---|
24 | echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
|
---|
25 | echo "(por medio de makegli.sh) antes de ejecutar este guión."
|
---|
26 | elif [ "$glilang" == "fr" ]; then
|
---|
27 | echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
|
---|
28 | echo "avant d'exécuter ce script."
|
---|
29 | elif [ "$glilang" == "ru" ]; then
|
---|
30 | echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
|
---|
31 | echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
|
---|
32 | else
|
---|
33 | echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
|
---|
34 | echo "before running this script."
|
---|
35 | fi
|
---|
36 | exit 1
|
---|
37 | fi
|
---|
38 |
|
---|
39 | echo "Assuming that Java code is freshly compiled..."
|
---|
40 |
|
---|
41 | # All the GLI class files and supporting libraries are put into the "jar" directory
|
---|
42 | if [ ! -d jar ]; then
|
---|
43 | mkdir jar
|
---|
44 |
|
---|
45 | cd lib
|
---|
46 | jar xf activation.jar com javax
|
---|
47 | jar xf apache.jar com org
|
---|
48 | jar xf mail.jar com javax
|
---|
49 | jar xf qfslib.jar de
|
---|
50 |
|
---|
51 | mv com de javax org ../jar/.
|
---|
52 | cd ..
|
---|
53 | fi
|
---|
54 |
|
---|
55 | # Copy the latest version of the GLI classes into the jar directory
|
---|
56 | rm -rf jar/org/greenstone
|
---|
57 | cp -r classes/org/greenstone jar/org
|
---|
58 |
|
---|
59 | # Some of the things to go into the JAR file are optional, and may not exist
|
---|
60 | optional=
|
---|
61 | if [ -f collect.zip ]; then
|
---|
62 | optional="$optional collect.zip"
|
---|
63 | fi
|
---|
64 | if [ -f classifiers.dat ]; then
|
---|
65 | optional="$optional classifiers.dat"
|
---|
66 | fi
|
---|
67 | if [ -f plugins.dat ]; then
|
---|
68 | optional="$optional plugins.dat"
|
---|
69 | fi
|
---|
70 |
|
---|
71 | # Jar everything up
|
---|
72 | jar cf GLI.jar .java.policy $optional help \
|
---|
73 | -C classes dictionary.properties -C classes dictionary_es.properties \
|
---|
74 | -C classes dictionary_fr.properties -C classes dictionary_ru.properties \
|
---|
75 | -C classes feedback.properties -C classes metadata.zip \
|
---|
76 | -C classes images -C classes xml \
|
---|
77 | -C jar com -C jar de -C jar javax -C jar org
|
---|
78 |
|
---|
79 |
|
---|
80 | # ---- Make signed JAR file for the applet, if desired ----
|
---|
81 | if [ "$1" == "-sign" ]; then
|
---|
82 | rm -f SignedGatherer.jar
|
---|
83 | echo "greenstone" | jarsigner -keystore .greenstonestore -signedjar SignedGatherer.jar GLI.jar privateKey 2> /dev/null
|
---|
84 | echo
|
---|
85 | echo "Installing SignedGatherer in ../bin/java"
|
---|
86 | mv SignedGatherer.jar ../bin/java/.
|
---|
87 | fi
|
---|