source: trunk/gli/makejar.sh@ 13048

Last change on this file since 13048 was 12287, checked in by kjdon, 18 years ago

Made these POSIX compliant (I think) based on patch and comments sent in by James Strother.
changed [ a == b] to [a = b], = "" to = "x", removed popd and pushd. changed source to .

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
RevLine 
[8178]1#!/bin/sh
2glilang=en
[8172]3
[8178]4
5# This script must be run from within the directory in which it lives
6thisdir=`pwd`
7if [ ! -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]18fi
19
[8178]20## ---- Check that the GLI has been compiled ----
21if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ]; then
22 echo
[12287]23 if [ "$glilang" = "es" ]; then
[8178]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."
[12287]26 elif [ "$glilang" = "fr" ]; then
[8178]27 echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
28 echo "avant d'exécuter ce script."
[12287]29 elif [ "$glilang" = "ru" ]; then
[8178]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
37fi
38
[8181]39echo "Assuming that Java code is freshly compiled..."
[8178]40
41# All the GLI class files and supporting libraries are put into the "jar" directory
42if [ ! -d jar ]; then
43 mkdir jar
44
[8172]45 cd lib
[8179]46 jar xf apache.jar com org
47 jar xf qfslib.jar de
[8172]48
[11801]49 mv com de org ../jar/.
[8172]50 cd ..
51fi
52
[8178]53# Copy the latest version of the GLI classes into the jar directory
54rm -rf jar/org/greenstone
55cp -r classes/org/greenstone jar/org
[8172]56
[8179]57# Some of the things to go into the JAR file are optional, and may not exist
58optional=
59if [ -f collect.zip ]; then
60 optional="$optional collect.zip"
61fi
62if [ -f classifiers.dat ]; then
63 optional="$optional classifiers.dat"
64fi
65if [ -f plugins.dat ]; then
66 optional="$optional plugins.dat"
67fi
[9094]68
69# Recreate the metadata.zip file (contains the GLI metadata directory)
70rm -f metadata.zip
71zip -r metadata.zip metadata >/dev/null
72
[8178]73# Jar everything up
[9094]74jar cf GLI.jar .java.policy metadata.zip $optional help \
[8178]75 -C classes dictionary.properties -C classes dictionary_es.properties \
76 -C classes dictionary_fr.properties -C classes dictionary_ru.properties \
[9094]77 -C classes feedback.properties -C classes images -C classes xml \
[11801]78 -C jar com -C jar de -C jar org
[8172]79
80
[8178]81# ---- Make signed JAR file for the applet, if desired ----
[12287]82if [ "$1" = "-sign" ]; then
[8178]83 rm -f SignedGatherer.jar
84 echo "greenstone" | jarsigner -keystore .greenstonestore -signedjar SignedGatherer.jar GLI.jar privateKey 2> /dev/null
85 echo
86 echo "Installing SignedGatherer in ../bin/java"
87 mv SignedGatherer.jar ../bin/java/.
88fi
Note: See TracBrowser for help on using the repository browser.