[8178] | 1 | #!/bin/sh
|
---|
| 2 | glilang=en
|
---|
[8172] | 3 |
|
---|
[8178] | 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
|
---|
[12287] | 8 | if [ "$glilang" = "es" ]; then
|
---|
[8178] | 9 | echo "Este guión deberá ejecutarse desde el directorio en el que reside."
|
---|
[12287] | 10 | elif [ "$glilang" = "fr" ]; then
|
---|
[8178] | 11 | echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
|
---|
[12287] | 12 | elif [ "$glilang" = "ru" ]; then
|
---|
[8178] | 13 | echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
|
---|
| 14 | else
|
---|
| 15 | echo "This script must be run from the directory in which it resides."
|
---|
| 16 | fi
|
---|
| 17 | exit 1
|
---|
[8172] | 18 | fi
|
---|
| 19 |
|
---|
[15184] | 20 | echo "Generating the JAR files for Remote Greenstone"
|
---|
| 21 |
|
---|
[8178] | 22 | ## ---- Check that the GLI has been compiled ----
|
---|
| 23 | if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ]; then
|
---|
| 24 | echo
|
---|
[12287] | 25 | if [ "$glilang" = "es" ]; then
|
---|
[8178] | 26 | echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
|
---|
| 27 | echo "(por medio de makegli.sh) antes de ejecutar este guión."
|
---|
[12287] | 28 | elif [ "$glilang" = "fr" ]; then
|
---|
[8178] | 29 | echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
|
---|
| 30 | echo "avant d'exécuter ce script."
|
---|
[12287] | 31 | elif [ "$glilang" = "ru" ]; then
|
---|
[8178] | 32 | echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
|
---|
| 33 | echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
|
---|
| 34 | else
|
---|
| 35 | echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
|
---|
| 36 | echo "before running this script."
|
---|
| 37 | fi
|
---|
| 38 | exit 1
|
---|
| 39 | fi
|
---|
| 40 |
|
---|
[8181] | 41 | echo "Assuming that Java code is freshly compiled..."
|
---|
[8178] | 42 |
|
---|
| 43 | # All the GLI class files and supporting libraries are put into the "jar" directory
|
---|
| 44 | if [ ! -d jar ]; then
|
---|
| 45 | mkdir jar
|
---|
| 46 |
|
---|
[8172] | 47 | cd lib
|
---|
[8179] | 48 | jar xf apache.jar com org
|
---|
| 49 | jar xf qfslib.jar de
|
---|
[8172] | 50 |
|
---|
[11801] | 51 | mv com de org ../jar/.
|
---|
[8172] | 52 | cd ..
|
---|
| 53 | fi
|
---|
| 54 |
|
---|
[8178] | 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
|
---|
[8172] | 58 |
|
---|
[8179] | 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
|
---|
[9094] | 64 |
|
---|
| 65 | # Recreate the metadata.zip file (contains the GLI metadata directory)
|
---|
| 66 | rm -f metadata.zip
|
---|
| 67 | zip -r metadata.zip metadata >/dev/null
|
---|
| 68 |
|
---|
[18635] | 69 | # get the list of dictionary files
|
---|
| 70 | dictionary_files=
|
---|
| 71 | cd classes
|
---|
| 72 | for dict_file in dictionary*.properties ; do
|
---|
| 73 | dictionary_files="$dictionary_files -C classes $dict_file"
|
---|
| 74 | done
|
---|
| 75 | cd ..
|
---|
| 76 |
|
---|
[8178] | 77 | # Jar everything up
|
---|
[9094] | 78 | jar cf GLI.jar .java.policy metadata.zip $optional help \
|
---|
[18635] | 79 | $dictionary_files \
|
---|
[9094] | 80 | -C classes feedback.properties -C classes images -C classes xml \
|
---|
[11801] | 81 | -C jar com -C jar de -C jar org
|
---|
[8172] | 82 |
|
---|
[13805] | 83 | # Tidy up
|
---|
| 84 | rm -f metadata.zip
|
---|
| 85 |
|
---|
[13387] | 86 | # Generate the GLIServer.jar file for remote building
|
---|
| 87 | jar cf GLIServer.jar -C classes org/greenstone/gatherer/remote
|
---|
[8172] | 88 |
|
---|
[8178] | 89 | # ---- Make signed JAR file for the applet, if desired ----
|
---|
[12287] | 90 | if [ "$1" = "-sign" ]; then
|
---|
[8178] | 91 | rm -f SignedGatherer.jar
|
---|
| 92 | echo "greenstone" | jarsigner -keystore .greenstonestore -signedjar SignedGatherer.jar GLI.jar privateKey 2> /dev/null
|
---|
| 93 | echo
|
---|
| 94 | echo "Installing SignedGatherer in ../bin/java"
|
---|
| 95 | mv SignedGatherer.jar ../bin/java/.
|
---|
| 96 | fi
|
---|