source: main/trunk/gli/makegli.sh@ 32913

Last change on this file since 32913 was 32913, checked in by ak19, 5 years ago

Kathy wanted makegli.sh to be prevented from running clean and thereby deleting existing class files when there's no src code, as happens with binary. Although the assumption is that developers will run makegli and therefore will ahve checked out src code, we can always accidentally run makegli when testing a binary only to discover we had no src code and have now lost all the installed gli .class files.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 6.5 KB
Line 
1#!/bin/sh
2glilang=en
3
4
5# Don't bother compiling GLI if there's no source code (e.g. if this is a binary only)
6if [ ! -d "src" ]; then
7 echo "WARNING: There is no gli source code (src directory) to compile. Terminating makegli."
8 exit 0
9fi
10
11echo
12if [ "$glilang" = "es" ]; then
13 echo "Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)"
14 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
15 echo "La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
16 echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
17 echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
18elif [ "$glilang" = "fr" ]; then
19 echo "Interface du Bibliothécaire Greenstone (Greenstone Librarian Interface - GLI)"
20 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
21 echo "GLI est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
22 echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
23elif [ "$glilang" = "ru" ]; then
24 echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone (Greenstone Librarian Interface - GLI)"
25 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
26 echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
27 echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
28else
29 echo "Greenstone Librarian Interface (GLI)"
30 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
31 echo "GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
32 echo "This is free software, and you are welcome to redistribute it"
33fi
34echo
35
36## -------- Compile the Greenstone Librarian Interface --------
37
38## ---- Check Javac exists ----
39javacpath=
40
41# Some users may set the above line manually
42if [ "x$javacpath" = "x" ]; then
43
44 # If the JAVAC environment variable is set then use it
45 if [ "x$JAVAC" != "x" ] ; then
46 javacpath=$JAVAC
47 # If it is set, use the JAVA_HOME environment variable
48 elif [ "x$JAVA_HOME" != "x" ]; then
49 javacpath="$JAVA_HOME/bin/javac"
50 # Check if Javac is on the search path
51 else
52 javacpath=`which javac 2> /dev/null`
53 fi
54fi
55
56if [ "xJAVACFLAGS" = "x" ] ; then
57 JAVACFLAGS="-source 1.4 -target 1.4"
58fi
59
60# Check that a Javac executable has been found
61if [ "$glilang" = "es" ]; then
62 echo "Revisando Javac: $javacpath"
63elif [ "$glilang" = "fr" ]; then
64 echo "Vérification de Javac: $javacpath"
65elif [ "$glilang" = "ru" ]; then
66 echo "ðÒÏ×ÅÒËÁ Javac: $javacpath"
67else
68 echo "Checking Javac: $javacpath"
69fi
70if [ ! -x "$javacpath" ]; then
71 echo
72 if [ "$glilang" = "es" ]; then
73 echo "No se pudo localizar una versión apropiada de Javac."
74 echo "Por favor instale una nueva versión del Kit de Desarrollo de"
75 echo "Software Java (versión 1.4 o posterior) y ejecute nuevamente"
76 echo "este guión."
77 elif [ "$glilang" = "fr" ]; then
78 echo "Une version appropriée de Javac n'a pas pu être localisée."
79 echo "Veuillez installer une nouvelle version de Java SDK (version 1.4 ou"
80 echo "plus récente) et redémarrez ce script."
81 elif [ "$glilang" = "ru" ]; then
82 echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Javac."
83 echo "ðÏÖÁÌÕÊÓÔÁ, ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ Java SDK (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ"
84 echo "ÎÏ×ÕÀ) É ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ."
85 else
86 echo "Failed to locate an appropriate version of Javac. You must install a"
87 echo "Java Development Kit (version 1.4 or greater) before compiling the"
88 echo "Greenstone Librarian Interface."
89 fi
90 exit 1
91fi
92
93## ---- Compile the GLI ----
94
95# If a file has been specified at the command-line, just compile that file
96if [ ! "x$*" = "x" ] ; then
97 echo
98 if [ "$glilang" = "es" ]; then
99 echo "Compilando $* y clases dependientes..."
100 elif [ "$glilang" = "fr" ]; then
101 echo "Compilation de $* et des classes dépendantes,,,"
102 elif [ "$glilang" = "ru" ]; then
103 echo "ëÏÍÐÉÌÉÒÏ×ÁÎÉÅ $* É ÚÁ×ÉÓÉÍÙÅ ËÌÁÓÓÙ..."
104 else
105 echo "Compiling $* and dependent classes..."
106 fi
107
108 $javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar $*
109
110 if [ "$glilang" = "es" ]; then
111 echo "¡Hecho!"
112 elif [ "$glilang" = "fr" ]; then
113 echo "Terminé!"
114 elif [ "$glilang" = "ru" ]; then
115 echo "÷ÙÐÏÌÎÅÎÏ!"
116 else
117 echo "Done!"
118 fi
119 exit 0
120fi
121
122# Otherwise compile the lot...
123
124# Remove any existing class files first
125./clean.sh
126
127if [ "$glilang" = "es" ]; then
128 echo "Compilando la Interfaz de la Biblioteca Digital Greenstone..."
129elif [ "$glilang" = "fr" ]; then
130 echo "Compilation de Greenstone Librarian Interface,,,"
131elif [ "$glilang" = "ru" ]; then
132 echo "ëÏÍÐÉÌÉÒÏ×ÁÎÉÅ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ Greenstone..."
133else
134 echo "Compiling the Greenstone Librarian Interface..."
135fi
136
137# Compile the GLI
138$javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererProg.java
139$javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/WebGatherer.java
140$javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererApplet.java
141#$javacpath -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/GathererApplet4gs3.java
142# Compile the GEMS
143$javacpath -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/jna.jar:lib/jna-platform.jar:lib/qfslib.jar:lib/rsyntaxtextarea.jar src/org/greenstone/gatherer/gems/GEMS.java
144
145# Compile the standalone programs needed on the server for remote building
146$javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/ src/org/greenstone/gatherer/remote/Zip*.java
147$javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/ src/org/greenstone/gatherer/remote/Unzip.java
148
149if [ "$glilang" = "es" ]; then
150 echo "¡Hecho!"
151elif [ "$glilang" = "fr" ]; then
152 echo "Terminé!"
153elif [ "$glilang" = "ru" ]; then
154 echo "÷ÙÐÏÌÎÅÎÏ!"
155else
156 echo "Done!"
157fi
Note: See TracBrowser for help on using the repository browser.