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
RevLine 
[4916]1#!/bin/sh
[6752]2glilang=en
[4935]3
[32913]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
[6262]11echo
[12287]12if [ "$glilang" = "es" ]; then
[6959]13 echo "Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)"
[17946]14 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
[6959]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"
[12287]18elif [ "$glilang" = "fr" ]; then
[6955]19 echo "Interface du Bibliothécaire Greenstone (Greenstone Librarian Interface - GLI)"
[17946]20 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
[6955]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"
[12287]23elif [ "$glilang" = "ru" ]; then
[7041]24 echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone (Greenstone Librarian Interface - GLI)"
[17946]25 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
[7041]26 echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
27 echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
[6706]28else
[7041]29 echo "Greenstone Librarian Interface (GLI)"
[17946]30 echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
[7041]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"
[6706]33fi
[6223]34echo
[5011]35
36## -------- Compile the Greenstone Librarian Interface --------
37
38## ---- Check Javac exists ----
39javacpath=
40
41# Some users may set the above line manually
[12287]42if [ "x$javacpath" = "x" ]; then
[5011]43
[23359]44 # If the JAVAC environment variable is set then use it
45 if [ "x$JAVAC" != "x" ] ; then
46 javacpath=$JAVAC
[6467]47 # If it is set, use the JAVA_HOME environment variable
[23359]48 elif [ "x$JAVA_HOME" != "x" ]; then
[6467]49 javacpath="$JAVA_HOME/bin/javac"
[5011]50 # Check if Javac is on the search path
51 else
52 javacpath=`which javac 2> /dev/null`
53 fi
54fi
55
[35574]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
[23359]60
[35566]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
[5011]66# Check that a Javac executable has been found
[12287]67if [ "$glilang" = "es" ]; then
[6746]68 echo "Revisando Javac: $javacpath"
[12287]69elif [ "$glilang" = "fr" ]; then
[6711]70 echo "Vérification de Javac: $javacpath"
[12287]71elif [ "$glilang" = "ru" ]; then
[6706]72 echo "ðÒÏ×ÅÒËÁ Javac: $javacpath"
73else
74 echo "Checking Javac: $javacpath"
75fi
[5011]76if [ ! -x "$javacpath" ]; then
77 echo
[12287]78 if [ "$glilang" = "es" ]; then
[7003]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."
[12287]83 elif [ "$glilang" = "fr" ]; then
[6711]84 echo "Une version appropriée de Javac n'a pas pu être localisée."
[7003]85 echo "Veuillez installer une nouvelle version de Java SDK (version 1.4 ou"
86 echo "plus récente) et redémarrez ce script."
[12287]87 elif [ "$glilang" = "ru" ]; then
[6706]88 echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Javac."
[7003]89 echo "ðÏÖÁÌÕÊÓÔÁ, ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ Java SDK (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ"
90 echo "ÎÏ×ÕÀ) É ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ."
[6706]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
[4935]96 exit 1
[4916]97fi
98
[5011]99## ---- Compile the GLI ----
100
[4947]101# If a file has been specified at the command-line, just compile that file
[4935]102if [ ! "x$*" = "x" ] ; then
[10422]103 echo
[12287]104 if [ "$glilang" = "es" ]; then
[6746]105 echo "Compilando $* y clases dependientes..."
[12287]106 elif [ "$glilang" = "fr" ]; then
[6711]107 echo "Compilation de $* et des classes dépendantes,,,"
[12287]108 elif [ "$glilang" = "ru" ]; then
[6706]109 echo "ëÏÍÐÉÌÉÒÏ×ÁÎÉÅ $* É ÚÁ×ÉÓÉÍÙÅ ËÌÁÓÓÙ..."
110 else
[8978]111 echo "Compiling $* and dependent classes..."
[6706]112 fi
[5011]113
[31649]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 $*
[5011]115
[12287]116 if [ "$glilang" = "es" ]; then
[6746]117 echo "¡Hecho!"
[12287]118 elif [ "$glilang" = "fr" ]; then
[6711]119 echo "Terminé!"
[12287]120 elif [ "$glilang" = "ru" ]; then
[6706]121 echo "÷ÙÐÏÌÎÅÎÏ!"
122 else
123 echo "Done!"
124 fi
[4935]125 exit 0
126fi
127
128# Otherwise compile the lot...
[10422]129
130# Remove any existing class files first
131./clean.sh
132
[12287]133if [ "$glilang" = "es" ]; then
[6746]134 echo "Compilando la Interfaz de la Biblioteca Digital Greenstone..."
[12287]135elif [ "$glilang" = "fr" ]; then
[6711]136 echo "Compilation de Greenstone Librarian Interface,,,"
[12287]137elif [ "$glilang" = "ru" ]; then
[6706]138 echo "ëÏÍÐÉÌÉÒÏ×ÁÎÉÅ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ Greenstone..."
139else
140 echo "Compiling the Greenstone Librarian Interface..."
141fi
[5011]142
[9336]143# Compile the GLI
[31649]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
[32911]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
[31649]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
[9336]148# Compile the GEMS
[31649]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
[9315]150
[13386]151# Compile the standalone programs needed on the server for remote building
[23359]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
[13386]154
[12287]155if [ "$glilang" = "es" ]; then
[6746]156 echo "¡Hecho!"
[12287]157elif [ "$glilang" = "fr" ]; then
[6711]158 echo "Terminé!"
[12287]159elif [ "$glilang" = "ru" ]; then
[6706]160 echo "÷ÙÐÏÌÎÅÎÏ!"
161else
162 echo "Done!"
163fi
Note: See TracBrowser for help on using the repository browser.