source: main/tags/stable/gli/makejar.sh

Last change on this file was 24783, checked in by ak19, 13 years ago

Same changes as were committed for the equivalent Windows batch file, makejar.bat, with commit revision 24782.

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