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

Last change on this file since 35741 was 35574, checked in by davidb, 3 years ago

No longer want JAVACFLAGS set to default vals if not already set

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 6.7 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
56# The following is now explicitly set in the Release Kit
57#if [ "x$JAVACFLAGS" = "x" ] ; then
58# JAVACFLAGS="-source 1.6 -target 1.6"
59#fi
60
61# https://stackoverflow.com/questions/15492948/javac-source-and-target-options
62if [ -f lib/rt-openjdk6.jar ] ; then
63 JAVACFLAGS="$JAVACFLAGS -bootclasspath lib/rt-openjdk6.jar -extdirs \"\""
64fi
65
66# Check that a Javac executable has been found
67if [ "$glilang" = "es" ]; then
68 echo "Revisando Javac: $javacpath"
69elif [ "$glilang" = "fr" ]; then
70 echo "Vérification de Javac: $javacpath"
71elif [ "$glilang" = "ru" ]; then
72 echo "ðÒÏ×ÅÒËÁ Javac: $javacpath"
73else
74 echo "Checking Javac: $javacpath"
75fi
76if [ ! -x "$javacpath" ]; then
77 echo
78 if [ "$glilang" = "es" ]; then
79 echo "No se pudo localizar una versión apropiada de Javac."
80 echo "Por favor instale una nueva versión del Kit de Desarrollo de"
81 echo "Software Java (versión 1.4 o posterior) y ejecute nuevamente"
82 echo "este guión."
83 elif [ "$glilang" = "fr" ]; then
84 echo "Une version appropriée de Javac n'a pas pu être localisée."
85 echo "Veuillez installer une nouvelle version de Java SDK (version 1.4 ou"
86 echo "plus récente) et redémarrez ce script."
87 elif [ "$glilang" = "ru" ]; then
88 echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Javac."
89 echo "ðÏÖÁÌÕÊÓÔÁ, ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ Java SDK (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ"
90 echo "ÎÏ×ÕÀ) É ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ."
91 else
92 echo "Failed to locate an appropriate version of Javac. You must install a"
93 echo "Java Development Kit (version 1.4 or greater) before compiling the"
94 echo "Greenstone Librarian Interface."
95 fi
96 exit 1
97fi
98
99## ---- Compile the GLI ----
100
101# If a file has been specified at the command-line, just compile that file
102if [ ! "x$*" = "x" ] ; then
103 echo
104 if [ "$glilang" = "es" ]; then
105 echo "Compilando $* y clases dependientes..."
106 elif [ "$glilang" = "fr" ]; then
107 echo "Compilation de $* et des classes dépendantes,,,"
108 elif [ "$glilang" = "ru" ]; then
109 echo "ëÏÍÐÉÌÉÒÏ×ÁÎÉÅ $* É ÚÁ×ÉÓÉÍÙÅ ËÌÁÓÓÙ..."
110 else
111 echo "Compiling $* and dependent classes..."
112 fi
113
114 $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 $*
115
116 if [ "$glilang" = "es" ]; then
117 echo "¡Hecho!"
118 elif [ "$glilang" = "fr" ]; then
119 echo "Terminé!"
120 elif [ "$glilang" = "ru" ]; then
121 echo "÷ÙÐÏÌÎÅÎÏ!"
122 else
123 echo "Done!"
124 fi
125 exit 0
126fi
127
128# Otherwise compile the lot...
129
130# Remove any existing class files first
131./clean.sh
132
133if [ "$glilang" = "es" ]; then
134 echo "Compilando la Interfaz de la Biblioteca Digital Greenstone..."
135elif [ "$glilang" = "fr" ]; then
136 echo "Compilation de Greenstone Librarian Interface,,,"
137elif [ "$glilang" = "ru" ]; then
138 echo "ëÏÍÐÉÌÉÒÏ×ÁÎÉÅ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ Greenstone..."
139else
140 echo "Compiling the Greenstone Librarian Interface..."
141fi
142
143# Compile the GLI
144$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
145$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
146$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
147#$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
148# Compile the GEMS
149$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
150
151# Compile the standalone programs needed on the server for remote building
152$javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/ src/org/greenstone/gatherer/remote/Zip*.java
153$javacpath $JAVACFLAGS -deprecation -d classes/ -sourcepath src/ -classpath classes/ src/org/greenstone/gatherer/remote/Unzip.java
154
155if [ "$glilang" = "es" ]; then
156 echo "¡Hecho!"
157elif [ "$glilang" = "fr" ]; then
158 echo "Terminé!"
159elif [ "$glilang" = "ru" ]; then
160 echo "÷ÙÐÏÌÎÅÎÏ!"
161else
162 echo "Done!"
163fi
Note: See TracBrowser for help on using the repository browser.