source: main/trunk/greenstone3/build.xml@ 22846

Last change on this file since 22846 was 22846, checked in by sjm84, 14 years ago

Added the os.dir to the support library path

File size: 82.2 KB
RevLine 
[15124]1<?xml version="1.0"?>
2<!-- ======================================================================
3 March 2005
4
5 Greenstone3 build and install script
6
7 kjdon
8 ====================================================================== -->
9<project name="greenstone3" default="usage" basedir=".">
[20241]10 <echo>os.name: ${os.name}</echo>
[15124]11
[15799]12 <!-- ============ classpath =================== -->
13 <path id="project.classpath">
14 <fileset dir="lib/java">
15 <include name="**/*.jar"/>
16 </fileset>
17 </path>
18
19 <!-- ============ self defined tasks =================== -->
20 <taskdef name="mysetproxy" classname="org.greenstone.anttasks.MySetProxy" classpathref="project.classpath"/>
21 <taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" classpathref="project.classpath"/>
[19930]22 <taskdef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
[21196]23 <!--<taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>-->
[15799]24 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
25 <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
[19930]26
[15799]27 <!-- ===================== Property Definitions =========================== -->
28
29 <!--
[15124]30
31 Each of the following properties are used in the build script.
32 Values for these properties are set by the first place they are
33 defined, from the following list:
34
35 * Definitions on the "ant" command line (ant -Dfoo=bar compile).
36
37 * Definitions from a "build.properties" file in the top level
[15799]38 source directory of this application.
[15124]39
40 * Definitions from a "build.properties" file in the user's
[15799]41 home directory.
[15124]42
43 * Default definitions in this build.xml file.
44
45 You will note below that property values can be composed based on the
46 contents of previously defined properties. This is a powerful technique
47 that helps you minimize the number of changes required when your development
48 environment is modified. Note that property composition is allowed within
49 "build.properties" files as well as in the "build.xml" script.
50
[15799]51 -->
[18227]52
53 <!-- create build.properties if it has not been created yet -->
54 <if>
55 <bool><not><available file="build.properties"/></not></bool>
56 <copy file="build.properties.in" tofile="build.properties"/>
57 </if>
58
[18515]59 <!-- create the packages dir if it has not been created yet -->
60 <mkdir dir="packages"/>
[15799]61
[15859]62 <!--the first three properties have to be put on the top to be used by build.properties-->
[19960]63 <property name="gs2build.home" value="${basedir}${file.separator}gs2build"/>
[15124]64 <property name="src.packages.home" value="${basedir}/src/packages"/>
[15859]65 <property name="flax.svn.root" value="http://svn.greenstone.org/flax"/>
[19878]66
[15124]67 <property file="build.properties"/>
[16962]68 <if><bool><available file="${user.home}/build.properties"/></bool>
69 <property file="${user.home}/build.properties"/>
70 </if>
[15124]71
[20464]72 <!-- now we've read in properties, apply defaults -->
73 <property name="disable.collection.building" value="false"/>
74
[15124]75 <!-- get properties from the environment -->
76 <property environment="env"/>
[15799]77
[20127]78 <!-- get the filesets defining components and executables -->
[19975]79 <import file="resources/xml/components.xml"/>
[20127]80 <import file="resources/xml/executables.xml"/>
[15799]81
82 <!-- version properties for external packages -->
[20079]83 <!-- for Java versions < 1.4, we print out the message that Java is too old.
84 For Java 1.4, we use Tomcat 5.5, for Java5 and higher, we use Tomcat 6.0-->
85 <condition property="tomcat.version" value="apache-tomcat-5.5.25" else="apache-tomcat-6.0.20">
86 <equals arg1="1.4" arg2="${ant.java.version}"/>
87 </condition>
88 <condition property="tomcat.version.major" value="5" else="6">
89 <equals arg1="1.4" arg2="${ant.java.version}"/>
90 </condition>
[22320]91 <condition property="privileged.attribute" value="privileged='true'" else="">
92 <equals arg1="6" arg2="${tomcat.version.major}"/>
93 </condition>
[20233]94
[22405]95 <property name="axis.zip.version" value="axis-bin-1_4.zip"/>
96 <property name="axis.dir.version" value="axis-1_4"/>
[18179]97 <property name="sqlite.targz.version" value="sqlite-amalgamation-3.5.9.tar.gz"/>
[15799]98
[15124]99 <property name="build.home" value="${basedir}/build"/>
100 <property name="src.home" value="${basedir}/src/java"/>
101 <property name="packages.home" value="${basedir}/packages"/>
102 <!-- this may be set in build.properties, eg if you move the web dir to
103 tomcats webapps directory -->
104 <property name="web.home" value="${basedir}/web"/>
105 <!-- jar files needed by applets go here -->
106 <property name="web.applet" value="${web.home}/applet"/>
[20085]107
[15124]108 <!-- jar files needed by the servlet (and extra ones) go here -->
109 <property name="web.lib" value="${web.home}/WEB-INF/lib"/>
110 <!-- other files needed by the servlet go here -->
111 <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
112 <!--- flax: the WordNet home -->
113 <property name="wn.home" value="${web.home}/WEB-INF/classes/flax/WordNet"/>
114
115 <!-- jni libraries and java wrappers go here -->
116 <property name="lib.jni" value="${basedir}/lib/jni"/>
[19878]117
118 <!-- other jar files needed for installation (but not runtime) go here -->
[18110]119 <property name="lib.java" value="${basedir}/lib/java"/>
[15799]120
[15124]121 <property name="javadocs" value="${basedir}/docs/javadoc"/>
122
123 <property name="app.name" value="greenstone3"/>
124 <property name="app.path" value="/${app.name}"/>
125
[18124]126 <property name="admin.dir" value="${basedir}/admin"/>
[15124]127
128 <!-- defaults - set these on the command line or in build.properties or they will take these default values-->
129 <property name="app.version" value="trunk"/>
130 <property name="branch.path" value="trunk"/>
131 <property name="branch.revision" value="HEAD"/>
132
133 <!--constants -->
134 <property name="svn.root" value="http://svn.greenstone.org"/>
135
[19878]136 <!-- catalina home is set to tomcat basedir if already installed, otherwise
[15124]137 use greenstone's tomcat -->
[20085]138 <condition property="catalina.home" value="${tomcat.installed.path}" else="${packages.home}/tomcat">
[15124]139 <and>
140 <isset property="tomcat.installed.path"/>
141 <not>
[16936]142 <equals arg1="" arg2="${tomcat.installed.path}"/>
[15124]143 </not>
144 </and>
145 </condition>
[19878]146
[15124]147 <property name="os.linux" value="Linux"/>
148 <property name="os.mac" value="Mac OS X"/>
149 <property name="os.solaris" value="SunOS"/>
150 <property name="os.unix" value="${os.linux},${os.mac},${os.solaris}"/>
[22056]151 <property name="os.windows" value="Windows 95,Windows 98,Windows 2000,Windows 2003,Windows XP,Windows NT,Windows ME,Windows Vista,Windows 7"/> <!-- check this!!!-->
[15124]152
153 <!-- this is true for linux and macs -->
154 <condition property="current.os.isunix">
155 <os family="unix"/>
156 </condition>
157
158 <condition property="current.os.isunixnotmac">
159 <and>
160 <os family="unix"/>
161 <not>
[19933]162 <os family="mac"/>
[15124]163 </not>
164 </and>
165 </condition>
[19878]166
[15124]167 <condition property="current.os.ismac">
168 <os family="mac"/>
169 </condition>
170
171 <condition property="current.os.iswindows">
172 <os family="windows"/>
173 </condition>
174
[19933]175 <!-- is there a better way to do this?? what about solaris?? -->
176 <condition property="os.bin.dir" value="windows">
177 <os family="windows"/>
178 </condition>
179 <condition property="os.bin.dir" value="darwin">
180 <os family="mac"/>
181 </condition>
182 <condition property="os.bin.dir" value="linux">
183 <and>
184 <os family="unix"/>
185 <not>
186 <os family="mac"/>
187 </not>
188 </and>
189 </condition>
190
191
[19878]192 <condition property="collection.building.disabled">
[20464]193 <and>
194 <isset property="disable.collection.building"/>
195 <istrue value="${disable.collection.building}"/>
196 </and>
[19878]197 </condition>
198
[15124]199 <condition property="collection.building.enabled">
200 <not>
[20464]201 <istrue value="${disable.collection.building}"/>
[15124]202 </not>
203 </condition>
[19878]204
[15124]205 <condition property="collection.building.enabled.windows">
206 <and>
[20464]207 <istrue value="${collection.building.enabled}"/>
[15124]208 <isset property="current.os.iswindows"/>
209 </and>
210 </condition>
211
212 <condition property="collection.building.enabled.unix">
213 <and>
[20464]214 <istrue value="${collection.building.enabled}"/>
[15124]215 <isset property="current.os.isunix"/>
216 </and>
217 </condition>
218
[20085]219 <condition property="static.arg" value="LDFLAGS=-static" else=" ">
[19931]220 <isset property="compile.static"/>
221 </condition>
[22184]222
[22845]223 <!-- If building a release then we want to adjust environment variables so that the support library can be see during compilation -->
224 <if><bool><isset property="use.support.lib"/></bool>
225 <if><bool><isset property="env.CFLAGS"/></bool>
[22846]226 <property name="cflags.arg" value="CFLAGS=-I${basedir}/ext/gnome-lib/${os.bin.dir}/include ${env.CFLAGS}"/>
[22845]227 <else>
[22846]228 <property name="cflags.arg" value="CFLAGS=-I${basedir}/ext/gnome-lib/${os.bin.dir}/include"/>
[22845]229 </else>
230 </if>
231 <else>
232 <property name="cflags.arg" value=" "/>
233 </else>
234 </if>
235
236 <if><bool><isset property="use.support.lib"/></bool>
237 <if><bool><isset property="env.CPPFLAGS"/></bool>
[22846]238 <property name="cppflags.arg" value="CPPFLAGS=-I${basedir}/ext/gnome-lib/${os.bin.dir}/include ${env.CPPFLAGS}"/>
[22845]239 <else>
[22846]240 <property name="cppflags.arg" value="CPPFLAGS=-I${basedir}/ext/gnome-lib/${os.bin.dir}/include"/>
[22845]241 </else>
242 </if>
243 <else>
244 <property name="cppflags.arg" value=" "/>
245 </else>
246 </if>
247
248 <if><bool><isset property="use.support.lib"/></bool>
249 <if><bool><isset property="env.CXXFLAGS"/></bool>
[22846]250 <property name="cxxflags.arg" value="CXXFLAGS=-I${basedir}/ext/gnome-lib/${os.bin.dir}/include ${env.CXXFLAGS}"/>
[22845]251 <else>
[22846]252 <property name="cxxflags.arg" value="CXXFLAGS=-I${basedir}/ext/gnome-lib/${os.bin.dir}/include"/>
[22845]253 </else>
254 </if>
255 <else>
256 <property name="cxxflags.arg" value=" "/>
257 </else>
258 </if>
259
[22184]260 <condition property="gs2.opt.args" value= " " else="--disable-mg --disable-mgpp --disable-accentfold --disable-gdbm --disable-sqlite">
261 <istrue value="${with.jni}"/>
262 </condition>
263 <condition property="gs2.compile.target" value="with-jni" else="without-jni">
264 <istrue value="${with.jni}"/>
265 </condition>
266 <condition property="gs2.install.target" value="install-with-jni" else="install-without-jni">
267 <istrue value="${with.jni}"/>
268 </condition>
269 <condition property="gs2.windows.enablejni" value="1" else="0">
270 <istrue value="${with.jni}"/>
271 </condition>
[19931]272
[15799]273 <!-- where is search4j tool -->
[20085]274 <condition property="search4j.exec" value="bin/search4j.exe" else="bin/search4j">
[15799]275 <isset property="current.os.iswindows"/>
[15136]276 </condition>
277
[15799]278
[15124]279 <!-- ============= Base dirs for each package and component ============ -->
280 <property name="src.gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
281 <property name="anttasks.home" value="${src.home}/org/greenstone/anttasks"/>
282 <property name="gli.home" value="${basedir}/gli"/>
283 <property name="javagdbm.home" value="${src.packages.home}/javagdbm"/>
284
[21347]285 <condition property="common.src.home" value="${basedir}/common-src" else="${gs2build.home}${file.separator}common-src">
[20464]286 <istrue value="${disable.collection.building}"/>
[19871]287 </condition>
[19931]288
289 <property name="build.src.home" value="${gs2build.home}/build-src"/>
[19871]290 <property name="gdbm.home" value="${common.src.home}/packages/gdbm"/>
291 <property name="mg.home" value="${common.src.home}/indexers/mg"/>
292 <property name="mgpp.home" value="${common.src.home}/indexers/mgpp"/>
293 <property name="lucene.home" value="${common.src.home}/indexers/lucene-gs"/>
294
[15799]295 <!-- ==================== Compilation Control Options ==================== -->
[15124]296
[15799]297 <!--
[15124]298
299 These properties control option settings on the Javac compiler when it
300 is invoked using the <javac> task.
301
302 compile.debug Should compilation include the debug option?
303
304 compile.deprecation Should compilation include the deprecation option?
305
306 compile.optimize Should compilation include the optimize option?
307
[15799]308 -->
[15124]309
310 <property name="compile.debug" value="true"/>
311 <property name="compile.deprecation" value="true"/>
312 <property name="compile.optimize" value="true"/>
313
[15799]314 <!--
[15124]315
316 Rather than relying on the CLASSPATH environment variable, Ant includes
317 features that makes it easy to dynamically construct the classpath you
318 need for each compilation. The example below constructs the compile
319 classpath to include the servlet.jar file, as well as the other components
320 that Tomcat makes available to web applications automatically, plus anything
321 that you explicitly added.
322
[15799]323 -->
[20079]324
325 <!-- All elements that Tomcat 5 exposes to applications -->
326 <path id="tomcat5">
[20085]327 <pathelement location="${catalina.home}/common/classes"/>
328 <fileset dir="${catalina.home}/common/endorsed">
329 <include name="*.jar"/>
330 </fileset>
331 <fileset dir="${catalina.home}/common/lib">
332 <include name="*.jar"/>
333 </fileset>
334 <!-- seems to be empty, but will leave in just in case some people make use of this to customise their install: -->
335 <pathelement location="${catalina.home}/shared/classes"/>
336 <fileset dir="${catalina.home}/shared/lib">
337 <include name="*.jar"/>
338 </fileset>
[20079]339 </path>
340
341 <!-- All elements that Tomcat 6 exposes to applications -->
342 <path id="tomcat6">
[20085]343 <fileset dir="${catalina.home}/lib">
344 <include name="*.jar"/>
345 </fileset>
[20079]346 </path>
347
[15124]348 <path id="compile.classpath">
349 <!-- Include all jar files and libraries in our jni lib directory -->
350 <pathelement location="${lib.jni}"/>
351 <fileset dir="${lib.jni}">
352 <include name="*.jar"/>
353 </fileset>
354 <!-- Include all jar files in our web lib directory -->
355 <pathelement location="${web.lib}"/>
356 <fileset dir="${web.lib}">
357 <include name="*.jar"/>
358 </fileset>
359
[18110]360 <pathelement location="${lib.java}"/>
361 <fileset dir="${lib.java}">
362 <include name="*.jar"/>
363 </fileset>
[15124]364
365 <!-- include the jar files from the source packages -->
366 <!-- mg and mgpp get installed into lib/jni but they may not be there yet
367 so we add them in by name -->
[22184]368 <!-- *** is there any way to make this optional, based on ${with.jni}? -->
[15124]369 <pathelement location="${lib.jni}/mg.jar"/>
370 <pathelement location="${lib.jni}/mgpp.jar"/>
371
[20085]372 <!-- Include all elements that Tomcat exposes to applications -->
373 <path refid="tomcat${tomcat.version.major}"/>
374
[15124]375 </path>
376
377 <path id="local.tomcat.classpath">
378 <!-- explicitly include the jni java wrappers in the classpath -->
379 <pathelement location="${lib.jni}"/>
380 <fileset dir="${lib.jni}">
381 <include name="*.jar"/>
382 </fileset>
383 </path>
384
385 <path id="local.tomcat.path">
386 <pathelement location="${basedir}/bin/script"/>
387 <pathelement location="${basedir}/bin"/>
388 <pathelement location="${lib.jni}"/>
389 <pathelement path="${env.PATH}"/>
390 <pathelement path="${env.Path}"/>
391 <pathelement path="${wn.home}/bin"/>
392 </path>
393
394 <target name="test-setup">
395 <echo>ant java version=${ant.java.version}</echo>
396 <echo>is unix : ${current.os.isunix}</echo>
397 <echo>is mac : ${current.os.ismac}</echo>
398 <echo>is unixnotmac : ${current.os.isunixnotmac}</echo>
399 <echo>is windows : ${current.os.iswindows}</echo>
400 <echo>os.unix: ${os.unix}</echo>
401 </target>
[20085]402
[15799]403 <!-- ==================== Primary and Global Targets ============================= -->
[15124]404
[19873]405 <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-common-src,prepare-collection-building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections, prepare-flax"
[15124]406 description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional subversion checkouts and downloads, so you need to be online to run this.">
407
408 <!-- make sure .sh files are executable -->
409 <chmod dir="${basedir}" perm="ugo+rx"
410 includes="*.sh"/>
411 <chmod dir="${basedir}/bin/script" perm="ugo+rx"
412 includes="*.sh,*.pl"/>
413 </target>
[16936]414
[19871]415 <!-- install-common-src and install-collection-building are mutually exclusive and either one or the other will be done depending on whether collection building is enabled or not -->
[19878]416 <target name="install" depends="init,install-common-src,install-collection-building,install-runtime"
[19843]417 description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare new-install'."/>
418
[19931]419 <target name="install-common-src" depends="init"
420 description="Install (configure, compile, install) only the common-src package (shared code from Greenstone 2). " >
[19894]421 <antcall target="configure-common-src"/>
422 <antcall target="compile-common-src"/>
423 <antcall target="install-auxiliary-jar-files"/>
424 <antcall target="install-jni-files"/>
425 </target>
[19878]426
[19894]427 <target name="install-collection-building" depends="init" if="collection.building.enabled"
428 description="Install (configure, compile, install) the Greenstone 2 collection building package." >
429 <antcall target="configure-collection-building"/>
[19931]430 <antcall target="tweak-makefiles" />
[19894]431 <antcall target="compile-collection-building"/>
432 </target>
433
[19878]434
[20209]435 <target name="install-runtime" depends="init,configure,configure-packages,configure-core,compile-web,compile-packages,compile-core,compile-classpath-jars"
[19878]436 description="Install (configure, compile, install) the runtime system. Needs either common-src or collection-building to have been installed first." />
437
438 <target name="svnupdate" depends="init,svnupdate-packages,svnupdate-core,svnupdate-common-src,svnupdate-collection-building,svnupdate-web"
[15124]439 description="Do a `svn update` for all sources. Doesn't recompile the code. You need to be online to run this."/>
440
441 <target name="configure" depends="init,configure-tomcat,configure-web"
[19878]442 description="Configure the installation (not the C++ code). Includes setting up config files. Should be re-run if you change the build.properties file."/>
[15124]443
[20209]444 <target name="clean" depends="init,clean-packages,clean-core,clean-common-src,clean-collection-building,clean-classpath-jars"
[19878]445 description="Remove all old compiled code. Includes runtime and collection-building if necessary"/>
[15124]446
[20209]447 <target name="distclean" depends="init,distclean-packages,clean-core,distclean-common-src,distclean-collection-building,clean-classpath-jars"
[19878]448 description="Remove all compiled code and also any Makefiles etc generated during configure-c++. Includes runtime and collection-building as necessary"/>
[15799]449
[19878]450 <target name="update" depends="init,svnupdate,clean,install"
451 description="Update (thru Subversion) all the source (including common-src or collection-building, and runtime), then clean, and re-install. To do this without any SVN updates, run it like 'ant -Dnosvn.mode=yes update'"/>
[15124]452
453 <target name="start" depends="init,start-tomcat"
454 description="Startup the Tomcat server." >
[15799]455 <echo>${app.name} (${app.version}) server running using Apache Tomcat and Java</echo>
[16936]456 <echo>Tomcat: ${catalina.home}</echo>
457 <echo>Java : ${java.home}</echo>
458 <echo>URL : http://${tomcat.server}:${tomcat.port}${app.path}/</echo>
[15799]459 <!-- assuming that index.html is not needed here -->
[15124]460 </target>
461
462 <target name="stop" depends="init,stop-tomcat"
463 description="Shutdown the Tomcat server."/>
464
465 <target name="restart" description="Shutdown and restart Tomcat" depends="init,stop,start"/>
466
467
[15799]468 <!-- =========== Help targets =================================== -->
[15124]469
470 <property name="install-command" value="ant [options] prepare install"/>
471
472 <target name="usage" description="Print a help message">
473 <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
474 <echo message=" Execute 'ant -help' for Ant help."/>
475 <echo>To install Greenstone3, run '${install-command}'.
[15799]476 There are properties defined in build.properties. The install process will ask you if these properties are set correctly. To avoid this prompt, use the '-Dproperties.accepted=yes' option.
477 To log the output, use the '-logfile build.log' option.
478 The README.txt file has more information about the ant targets and install process.
[15124]479 </echo>
480 </target>
481
482 <target name="help" depends="usage" description="Print a help message"/>
483
484 <target name="debug" depends="init" description="Display all the currently used properties">
485 <echoproperties/>
486 </target>
487
[15799]488 <!-- ====== initialization and setup targets ================== -->
[15124]489
490 <target name="accept-properties" unless="properties.accepted">
491 <input addproperty="properties.ok" validargs="y,n">The following properties (among others) are being used from a build.properties file found in this directory:
[15799]492 tomcat.server=${tomcat.server}
493 tomcat.port=${tomcat.port}
494 tomcat.installed.path=${tomcat.installed.path} (this is the location of Tomcat's base dir if it is already installed)
495 proxy.host=${proxy.host}
496 proxy.port=${proxy.port}
[19878]497 disable.collection.building=${disable.collection.building}
[19910]498 If these are not acceptable, please change them and rerun this target. Continue [y/n]?
[15124]499 </input>
500 <condition property="do.abort">
501 <equals arg1="n" arg2="${properties.ok}"/>
502 </condition>
503 <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
504 </target>
[20085]505
[15124]506 <!-- this sets up some initial properties -->
507 <target name="init">
508
[20085]509 <!-- has the gs3-setup script been run?? -->
510 <condition property="gs3-setup-not-done">
511 <not>
512 <isset property="env.GSDL3HOME"/>
513 </not>
514 </condition>
515
[20092]516 <!--<fail if="gs3-setup-not-done" message="please run 'gs3-setup' (Windows) or 'source gs3-setup.sh' (Linux/Mac) before running this target."/>-->
[20085]517
[15124]518 <condition property="java.too.old">
519 <or>
[16936]520 <equals arg1="1.1" arg2="${ant.java.version}"/>
521 <equals arg1="1.2" arg2="${ant.java.version}"/>
522 <equals arg1="1.3" arg2="${ant.java.version}"/>
[15124]523 </or>
524 </condition>
[20208]525 <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
[15124]526
527 <available file="${basedir}/gli" property="gli.present"/>
[19878]528 <available file="${basedir}/common-src" property="common.src.present"/>
[15124]529 <available file="${basedir}/gs2build" property="gs2build.present"/>
530
531 <condition property="tomcat.islocal">
532 <or>
[16936]533 <not><isset property="tomcat.installed.path"/></not>
534 <equals arg1="" arg2="${tomcat.installed.path}"/>
[15124]535 </or>
536 </condition>
537
[15799]538 <echo>tomcat.port = ${tomcat.port}</echo>
[15124]539
540 <condition property="proxy.present">
541 <and>
[16936]542 <isset property="proxy.host"/>
543 <not><equals arg1="" arg2="${proxy.host}"/></not>
[15124]544 </and>
545 </condition>
546
[20235]547 <!--
[20290]548 the next block checks if the bundled tomcat is present in the 'packages' directory,
549 and checks for the lethal combination of tomcat 6 and java 1.4. Test for
550 tomcat6 is based on the presence of a file inserted by greenstone into the tomcat6
551 download, as there is no other surefire way to check tomcat version under java 1.4
[20235]552 -->
553 <condition property="packages.tomcat.ispresent" value="true" else="false">
554 <available file="packages/tomcat"/>
555 </condition>
[20290]556 <condition property="packages.tomcat.istomcat6" value="true" else="false">
557 <available file="packages/tomcat/tomcat6.txt"/>
558 </condition>
[20235]559 <if>
560 <bool>
[20290]561 <and>
562 <istrue value="${packages.tomcat.ispresent}"/>
563 <istrue value="${packages.tomcat.istomcat6}"/>
564 <equals arg1="1.4" arg2="${ant.java.version}"/>
565 </and>
[20235]566 </bool>
[20290]567 <fail>Your Java (version 1.4) is too old to work with the bundled Apache Tomcat (version 6). Please upgrade to Java version 1.5 or greater. Alternatively, you may remove the bundled Apache Tomcat from the 'packages' folder and then run 'ant prepare-tomcat'.</fail>
[20235]568 </if>
569
[15124]570 </target>
571
572 <target name="setup-proxy" depends="init" if="proxy.present">
573 <condition property="ask.user">
574 <or>
[16936]575 <equals arg1="" arg2="${proxy.user}"/>
576 <equals arg1="" arg2="${proxy.password}"/>
[15124]577 </or>
578 </condition>
[19878]579
[15124]580 <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}" userproperty="proxy.username" pwordproperty="proxy.password"/>
581 <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
582 </target>
583
[15799]584 <!-- ========== Web app Targets ================================ -->
585
[20089]586 <target name="prepare-web" depends="init">
[15124]587 <mkdir dir="${web.home}/applet"/>
588 <mkdir dir="${web.home}/logs"/>
589 </target>
590
[15136]591 <!-- if we are using java 1.5+, we need the xalan.jar file in web/WEB-INF/lib, but if we are using java 1.4, we can't have it there -->
[15124]592 <target name="configure-java-version" depends="init"
[15139]593 description="Activates or deactivates some jar libraries as needed depending on your java version">
[15136]594
[15799]595 <available property="have.xalan.jar" file="${web.lib}/xalan.jar"/>
[15124]596 <condition property="need.xalan.jar">
[15799]597 <or>
[16936]598 <equals arg1="1.5" arg2="${ant.java.version}"/>
599 <equals arg1="1.6" arg2="${ant.java.version}"/>
[15799]600 </or>
601 </condition>
[15136]602
[15799]603 <!-- if they have xalan.jar but dont need it -->
604 <if>
605 <bool>
[16936]606 <and>
607 <isset property="have.xalan.jar"/>
608 <not><isset property="need.xalan.jar"/></not>
609 </and>
[15799]610 </bool>
611 <antcall target="deactivate-xalan-jar"/>
612 </if>
[15136]613
[15799]614 <!-- if they need xalan.jar but dont have it -->
615 <if>
616 <bool>
[16936]617 <and>
618 <not><isset property="have.xalan.jar"/></not>
619 <isset property="need.xalan.jar"/>
620 </and>
[15799]621 </bool>
622 <antcall target="activate-xalan-jar"/>
623 </if>
[15136]624
[15124]625 </target>
626
[15139]627 <target name="activate-xalan-jar">
[15799]628 <echo>activating xalan.jar</echo>
[15124]629 <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/>
[20085]630 <if>
631 <bool>
632 <and>
633 <isset property="current.os.ismac"/>
634 <available file="${catalina.home}/common/endorsed" type="dir"/>
635 </and>
636 </bool>
637 <copy file="${web.lib}/xalan.jar.tmp" tofile="${catalina.home}/common/endorsed/xalan.jar"/>
[15799]638 </if>
[15124]639 </target>
[15035]640
[15139]641 <target name="deactivate-xalan-jar">
[15799]642 <echo>deactivating xalan.jar</echo>
[15124]643 <delete file="${web.lib}/xalan.jar"/>
[20089]644 <!-- should we be deleting common/endorsed/xalan.jar on mac?? -->
[15124]645 </target>
646
[15837]647
[16936]648 <target name="prepare-collections" depends="init">
649 <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
[17008]650 <property name="index.zip" value="index.zip"/>
[15799]651
[16936]652 <echo message="installing collections..."/>
653 <antcall target="gs2mgdemo-install"/>
654 <antcall target="gs2mgppdemo-install"/>
655 <antcall target="gberg-install"/>
656 </target>
[15837]657
[16936]658 <target name="gs2mgdemo-prepare" if="collect.dir">
659 <property name="gs2mgdemo.dir" value="${collect.dir}/gs2mgdemo"/>
[15799]660
[16936]661 <condition property="gs2mgdemo.present">
662 <and>
[15837]663 <available file="${gs2mgdemo.dir}/${index.zip}"/>
[16936]664 </and>
665 </condition>
666 </target>
[15799]667
[17008]668 <target name="gs2mgdemo-install" if="gs2mgdemo.present" depends="gs2mgdemo-prepare">
[16936]669 <echo> installing gs2mgdemo</echo>
[17008]670 <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${index.zip}" />
[16936]671 <echo>collection gs2mgdemo installed</echo>
672 </target>
[15799]673
[16936]674 <target name="gs2mgppdemo-prepare" if="collect.dir">
675 <property name="gs2mgppdemo.dir" value="${collect.dir}/gs2mgppdemo"/>
[15837]676
[16936]677 <condition property="gs2mgppdemo.present">
678 <and>
[15837]679 <available file="${gs2mgppdemo.dir}/${index.zip}"/>
[16936]680 </and>
681 </condition>
682 </target>
[15799]683
[16936]684 <target name="gs2mgppdemo-install" if="gs2mgppdemo.present" depends="gs2mgppdemo-prepare">
[17008]685 <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${index.zip}" />
[16936]686 <echo>collection gs2mgppdemo installed</echo>
687 </target>
[15799]688
[16936]689 <target name="gberg-prepare" if="collect.dir">
690 <property name="gberg.dir" value="${collect.dir}/gberg"/>
[17008]691 <available file="${gberg.dir}/index/${index.zip}" property="gberg.present"/>
[16936]692 </target>
[15799]693
[16936]694 <target name="gberg-install" if="gberg.present" depends="gberg-prepare">
[19878]695 <unzip dest="${gberg.dir}/index" src="${gberg.dir}/index/${index.zip}"/>
[16936]696 <echo>collection gberg installed</echo>
697 </target>
[15799]698
[15124]699 <target name="configure-web" depends="init"
700 description="Configure only the web app config files">
701 <!-- we want a unix path in the global.properties file -->
702 <pathconvert targetos="unix" property="src.gsdl3.home.unix">
703 <path path="${web.home}"/>
704 </pathconvert>
705 <filter token="gsdl3home" value="${src.gsdl3.home.unix}"/>
706 <filter token="gsdl3version" value="${app.version}"/>
707 <filter token="tomcat.server" value="${tomcat.server}"/>
708 <filter token="tomcat.port" value="${tomcat.port}"/>
709 <copy file="${basedir}/resources/java/global.properties.in" tofile="${web.classes}/global.properties" filtering="true" overwrite="true"/>
710 <copy file="${basedir}/resources/java/log4j.properties.in" tofile="${web.classes}/log4j.properties" filtering="true" overwrite="true"/>
711 <chmod file="${web.classes}/global.properties" perm="600"/>
712 <chmod file="${web.classes}/log4j.properties" perm="600"/>
713 </target>
714
715 <target name="compile-web" depends="init">
716 <javac srcdir="${web.classes}"
717 destdir="${web.classes}"
718 debug="${compile.debug}"
719 deprecation="${compile.deprecation}"
720 optimize="${compile.optimize}">
[16936]721 <classpath><path refid="compile.classpath"/></classpath>
[15124]722 </javac>
723 </target>
724
[20209]725 <target name="compile-classpath-jars" depends="init">
726 <if><bool><available file="admin/cp.mf"/></bool>
727 <jar destfile="admin/cp.jar" manifest="admin/cp.mf"/>
728 </if>
729 <if><bool><available file="${lib.java}/cp.mf"/></bool>
730 <jar destfile="${lib.java}/cp.jar" manifest="${lib.java}/cp.mf"/>
731 </if>
732 <if><bool><available file="${lib.jni}/cp.mf"/></bool>
733 <jar destfile="${lib.jni}/cp.jar" manifest="${lib.jni}/cp.mf"/>
734 </if>
735 <if><bool><available file="${web.lib}/cp.mf"/></bool>
736 <jar destfile="${web.lib}/cp.jar" manifest="${web.lib}/cp.mf"/>
737 </if>
738 <jar destfile="cp.jar">
739 <manifest>
[20211]740 <attribute name="Class-Path" value="server.jar admin/cp.jar lib/java/cp.jar lib/jni/cp.jar web/WEB-INF/lib/cp.jar"/>
[20209]741 </manifest>
742 </jar>
743 </target>
744
745 <target name="clean-classpath-jars" depends="init">
746 <delete file="admin/cp.jar"/>
747 <delete file="${lib.java}/cp.jar"/>
748 <delete file="${lib.jni}/cp.jar"/>
749 <delete file="${web.lib}/cp.jar"/>
750 <delete file="cp.jar"/>
751 </target>
752
753
[15799]754 <target name="svnupdate-web" unless="nosvn.mode">
[20930]755 <exec executable="svn">
756 <arg value="update"/>
757 <arg value="${web.home}"/>
758 <arg value="-r"/><arg value="${branch.revision}"/>
759 </exec>
[15799]760 </target>
[15124]761
762 <target name="update-web" depends="init,svnupdate-web,configure-web"
763 description="update only the web stuff (config files)"/>
764
[15799]765 <!-- ======================= Tomcat Targets ========================== -->
[15124]766
767 <!-- this target downloads and installs Tomcat -->
[20089]768 <!-- we download tomcat (version 6 for Java 1.5 and later, version 5 for Java 1.4 plus the 1.4 compatibility package). -->
769 <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal"
770 description="downloads the appropriate version of Tomcat (Tomcat 5 if using Java 1.4, Tomcat 6 if using Java 1.5 or higher). If you want to change which version of Java you are using between 1.4 and 1.5/6 then you need to run prepare-tomcat">
[16951]771 <if>
772 <bool>
773 <not><available file="${packages.home}/tomcat/.flagfile"/></not>
774 </bool>
775
776 <!-- check that packages dir is there -->
777 <mkdir dir="${packages.home}"/>
778 <get src="http://www.greenstone.org/gs3files/${tomcat.version}.zip"
779 dest="${packages.home}/${tomcat.version}.zip"
780 usetimestamp="true"/>
781 <unzip src="${packages.home}/${tomcat.version}.zip"
782 dest="${packages.home}"/>
[20085]783
784 <!-- If we are using Java 1.4, we'd be using tomcat 5.5 in which case
785 we would need to have the tomcat compat package to work with Java 1.4-->
786 <if>
787 <bool><equals arg1="1.4" arg2="${ant.java.version}"/></bool>
788 <get src="http://www.greenstone.org/gs3files/${tomcat.version}-compat.zip"
789 dest="${packages.home}/${tomcat.version}-compat.zip"
790 usetimestamp="true"/>
791 <unzip src="${packages.home}/${tomcat.version}-compat.zip"
792 dest="${packages.home}"/>
793 </if>
794
[16951]795 <!-- delete any existing tomcat -->
796 <delete dir="${packages.home}/tomcat"/>
797 <move todir="${packages.home}/tomcat">
798 <fileset dir="${packages.home}/${tomcat.version}"/>
799 </move>
800 <copy file="${basedir}/resources/tomcat/setclasspath.bat"
801 tofile="${packages.home}/tomcat/bin/setclasspath.bat"
802 overwrite="true"/>
803 <copy file="${basedir}/resources/tomcat/setclasspath.sh"
804 tofile="${packages.home}/tomcat/bin/setclasspath.sh"
805 overwrite="true"/>
806 <!-- make sure we have execute permission for the .sh files -->
807 <chmod dir="${packages.home}/tomcat/bin" perm="ugo+rx"
808 includes="*.sh"/>
809
810 <echo file="${packages.home}/tomcat/.flagfile">
811 the timestamp of this file is the time that tomcat was extracted from the zip files.
812 it is used to figure out whether the files need to be refreshed or not in `ant prepare-tomcat`
813 </echo>
814
[20089]815 <!-- this is not strictly a prepare tomcat thing, but if one changes
816 Java, then they need to change tomcat as well, so might as well call
817 it here -->
818 <antcall target="configure-java-version"/>
[16951]819 <else>
820 <echo>Tomcat has been prepared, will not prepare</echo>
821 <echo>Delete ${packages.home}/tomcat/.flagfile to force refresh</echo>
822 </else>
823
824 </if>
825
[15124]826 </target>
827
828 <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/>
829
830 <target name="configure-tomcat-local" depends="init" if="tomcat.islocal">
831 <!-- re-setup the server.xml file -->
[20079]832 <copy file="${basedir}/resources/tomcat/server_tomcat${tomcat.version.major}.xml"
833 tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true">
[15124]834 <filterset>
[16936]835 <filter token="port" value="${tomcat.port}"/>
836 <filter token="shutdown-port" value="${tomcat.shutdown.port}"/>
[15124]837 </filterset>
838 </copy>
839 <!-- set up the greenstone3 context -->
840 <copy file="${basedir}/resources/tomcat/greenstone3.xml" tofile="${packages.home}/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true">
841 <filterset>
[16936]842 <filter token="gsdl3webhome" value="${web.home}"/>
[22320]843 <filter token="privilegedattribute" value ="${privileged.attribute}"/>
[15124]844 </filterset>
845 </copy>
846 </target>
847
848 <target name="configure-tomcat-external" depends="init" unless="tomcat.islocal">
849 <!-- re-setup the server.xml file -->
850 <!-- need to edit the config file, or do we get the user to do this???-->
851 </target>
[22551]852
853<!-- Another way: http://ptrthomas.wordpress.com/2006/03/25/how-to-start-and-stop-tomcat-from-ant/ -->
[20089]854 <target name="start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
[15799]855 <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
[15124]856 <property name="tomcat.path" refid="local.tomcat.path"/>
857 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
[21351]858 <exec executable="${catalina.home}/bin/startup.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
[15124]859 <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
860 <env key="GSDL3HOME" value="${basedir}"/>
861 <env key="PATH" path="${tomcat.path}"/>
862 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
863 <env key="CATALINA_HOME" value="${catalina.home}"/>
864 <env key="CLASSPATH" path="${tomcat.classpath}"/>
865 <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
[22184]866 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here these days ??-->
[15124]867 <env key="WNHOME" path="${wn.home}"/>
868 </exec>
[21351]869 <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
[15124]870 <env key="GSDLOS" value="windows"/>
871 <env key="GSDL3HOME" value="${basedir}"/>
872 <env key="Path" path="${tomcat.path}"/>
873 <env key="PATH" path="${tomcat.path}"/>
874 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
[16628]875 <env key="CATALINA_HOME" value="${catalina.home}"/>
[15124]876 <env key="CLASSPATH" path="${tomcat.classpath}"/>
877 </exec>
878 <!-- wait for the server to startup in case other targets need it running -->
879 <waitfor maxwait="5" maxwaitunit="second">
880 <and>
[16936]881 <socket server="${tomcat.server}" port="${tomcat.port}"/>
882 <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
[15124]883 </and>
884 </waitfor>
885 </target>
886
[22551]887 <!--ant task http: http://www.jajakarta.org/ant/ant-1.6.1/docs/ja/manual/api/org/apache/tools/ant/taskdefs/condition/Http.html-->
888 <target name="reconfigure" description="Reconfigure the message router">
889 <waitfor maxwait="5" maxwaitunit="second">
890 <http url="http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}?a=s&amp;sa=c"/>
891 </waitfor>
892 </target>
893
894 <!--Command-line args to Ant: http://www.jguru.com/faq/view.jsp?EID=471794-->
895 <target name="reconfigure-collection" description="Reconfigure the collection">
896 <waitfor maxwait="5" maxwaitunit="second">
897 <http url="http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}?a=s&amp;sa=c&amp;sc=${collection}"/>
898 </waitfor>
899 </target>
900
[15124]901 <!-- windows: do we want to launch a webrowser?? -->
902 <!-- shouldn't this test whether anything is running first? -->
903 <target name="stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
[21351]904 <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
[15124]905 <env key="CATALINA_HOME" value="${catalina.home}"/>
906 </exec>
[21351]907 <exec executable="${catalina.home}/bin/shutdown.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false">
[16628]908 <env key="CATALINA_HOME" value="${catalina.home}"/>
909 </exec>
[15124]910 </target>
911
912 <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/>
913
914 <target name="setup-catalina-ant-tasks">
915 <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
916 <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
917 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
918 <taskdef name="list" classname="org.apache.catalina.ant.ListTask"
919 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
920 <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"
921 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
922 <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
923 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
924 <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"
925 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
926 <taskdef name="start" classname="org.apache.catalina.ant.StartTask"
927 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
928 <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"
929 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
930 <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
931 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
932 </target>
933
934
[15799]935 <!-- ======================= ant Targets ============================ -->
[15124]936 <target name="prepare-ant" depends="init">
[16951]937 <if>
938 <bool>
939 <not><available file="${packages.home}/ant/.flagfile"/></not>
940 </bool>
941
942 <get src="http://www.greenstone.org/gs3files/apache-ant-1.7.0-bin.zip"
943 dest="${packages.home}/apache-ant-1.7.0-bin.zip"
944 usetimestamp="true"/>
945 <unzip src="${packages.home}/apache-ant-1.7.0-bin.zip"
946 dest="${packages.home}"/>
947 <move todir="${packages.home}/ant">
948 <fileset dir="${packages.home}/apache-ant-1.7.0"/>
949 </move>
950 <echo file="${packages.home}/ant/.flagfile">
951 the timestamp of this file is the time that ant was extracted from the zip files.
952 it is used to figure out whether the files need to be refreshed or not in `ant prepare-ant`
953 </echo>
954
955 <else>
956 <echo>Ant has been prepared, will not prepare</echo>
957 <echo>Delete ${packages.home}/ant/.flagfile to force refresh</echo>
958 </else>
959
960 </if>
[15124]961 </target>
962
[20079]963 <!-- ======================= Axis Targets ============================ -->
964
[15124]965 <target name="prepare-axis" depends="init">
[16951]966
967 <if>
968 <bool>
969 <not><available file="${packages.home}/axis/.flagfile"/></not>
970 </bool>
971
972 <get src="http://www.greenstone.org/gs3files/${axis.zip.version}"
973 dest="${packages.home}/${axis.zip.version}"
974 usetimestamp="true"/>
975 <unzip src="${packages.home}/${axis.zip.version}"
976 dest="${packages.home}"/>
977 <move todir="${packages.home}/axis">
978 <fileset dir="${packages.home}/${axis.dir.version}"/>
979 </move>
980 <!-- install axis into greenstone web app -->
981 <copy todir="${web.lib}">
982 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/lib">
983 <include name="*.jar"/>
984 </fileset>
985 </copy>
986 <copy todir="${web.home}">
987 <fileset dir="${packages.home}/axis/webapps/axis/">
988 <include name="*.jsp"/>
989 <include name="*.jws"/>
990 </fileset>
991 </copy>
992 <copy tofile="${web.home}/axis.html" file="${packages.home}/axis/webapps/axis/index.html"/>
993 <copy todir="${web.classes}">
994 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/classes">
995 <include name="*.properties"/>
996 </fileset>
997 </copy>
998 <echo file="${packages.home}/axis/.flagfile">
999 the timestamp of this file is the time that axis was extracted from the zip files.
1000 it is used to figure out whether the files need to be refreshed or not in `ant prepare-axis`
1001 </echo>
1002
1003 <else>
1004 <echo>Axis has been prepared, will not prepare</echo>
1005 <echo>Delete ${packages.home}/axis/.flagfile to force refresh</echo>
1006 </else>
1007
1008 </if>
[15124]1009 </target>
1010
[15229]1011 <target name="soap-deploy-site" depends="init,get-sitename,get-siteuri,get-webservices,create-deployment-files,deploy-site"
[15124]1012 description="Deploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."/>
[15799]1013
1014 <target name="deploy-site">
[15124]1015 <java classname="org.apache.axis.client.AdminClient">
1016 <classpath refid="compile.classpath"/>
1017 <arg value="-l"/>
1018 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
[15229]1019 <arg file="${basedir}/resources/soap/deploy.wsdd"/>
1020 </java>
1021 <delete file="${basedir}/resources/soap/deploy.wsdd"/> <!--clean up, no longer used-->
[15124]1022 </target>
1023
[15229]1024 <target name="soap-undeploy-site" depends="get-undeploy-service-name"
[15124]1025 description="Undeploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work.">
[15229]1026 <filter token="servicesname" value="${axis.undeploy.servicename}"/>
1027 <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
1028 tofile="${basedir}/resources/soap/undeploy.wsdd"
1029 filtering="true"
1030 overwrite="true"/>
[15124]1031 <java classname="org.apache.axis.client.AdminClient">
1032 <classpath refid="compile.classpath"/>
1033 <arg value="-l"/>
1034 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
[15229]1035 <arg file="${basedir}/resources/soap/undeploy.wsdd"/>
[15124]1036 </java>
[15229]1037 <delete file="${basedir}/resources/soap/undeploy.wsdd"/> <!--clean up, no longer used-->
[15799]1038 </target>
[15124]1039
[16936]1040 <!-- this target used to deploy the default web service SOAPServer (base.webservice.name) on the localsite server
1041 with the default servicename of localsite-->
[15124]1042 <target name="deploy-localsite" depends="init"
1043 description="Deploy the SOAP server for localsite. Will start and stop Tomcat.">
1044 <antcall target="start-tomcat"/>
[15235]1045 <echo>Deploying ${base.webservice.name} web services for localsite under service name: localsite</echo>
[15229]1046 <antcall target="create-deployment-files">
1047 <param name="axis.sitename" value="localsite"/>
[15235]1048 <param name="axis.servicesname" value="${base.webservice.name}"/>
[15229]1049 <param name="axis.siteuri" value="localsite"/>
1050 </antcall>
[15124]1051 <antcall target="deploy-site">
1052 <param name="axis.sitename" value="localsite"/>
[15235]1053 <param name="axis.servicesname" value="${base.webservice.name}"/>
[15229]1054 <param name="axis.siteuri" value="localsite"/>
[15124]1055 </antcall>
[15369]1056 <echo>The Greenstone server has been started up. If you do not want it running, please type: ant stop.</echo>
[15124]1057 </target>
[15799]1058
[16936]1059 <target name="get-sitename" unless="axis.sitename">
[15229]1060 <input addproperty="axis.sitename" defaultvalue="localsite">What site do you want to deploy services for?
[15235]1061Press Enter for default:localsite</input>
[15124]1062 </target>
1063
[15229]1064 <target name="get-undeploy-service-name" unless="axis.undeploy.servicename">
1065 <input addproperty="axis.undeploy.servicename" defaultvalue="localsite">Please enter the full name of the service you wish to undeploy.
1066To find out which web services you've got deployed, point your browser to http://HOST:PORT/greenstone3/services
[20209]1067Or press Enter for undeploying the default:localsite /&gt;</input>
[15229]1068 <echo>Name of service to undeploy: ${axis.undeploy.servicename}</echo>
[15124]1069 </target>
1070
[15229]1071 <target name="get-webservices" unless="axis.servicesname">
[15235]1072 <input addproperty="axis.servicesname" defaultvalue="${base.webservice.name}">Which set of web services do you want to deploy?
[15229]1073Choose from: ${web.services.list}
[20209]1074Or press Enter for default:${base.webservice.name} /&gt;</input>
[15229]1075 <echo>${axis.servicesname}</echo>
1076 </target>
1077
1078 <target name="get-siteuri" depends="get-sitename,get-webservices" unless="axis.siteuri">
[15235]1079 <input addproperty="axis.siteuri" defaultvalue="${axis.servicesname}${axis.sitename}">What name do you want the service to have? (Press Enter for default:${axis.servicesname}${axis.sitename})</input>
[15229]1080 <echo>Site: ${axis.sitename}, services: ${axis.servicesname}, servicesname: ${axis.siteuri}</echo>
1081 </target>
1082
1083 <target name="set-soapmethod" description="Determines whether the service in the wsdd should have the style attribute set to message or the provider attribute set to java:RPC" if="axis.servicesname">
1084 <condition property="soap.method" value="provider='java:MSG' style='message' use='literal'">
[15235]1085 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
[15124]1086 </condition>
[15229]1087
1088 <!--everything else defaults to java:RPC at present-->
1089 <condition property="soap.method" value="provider='java:RPC'">
1090 <not>
[15235]1091 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
[15229]1092 </not>
1093 </condition>
[16936]1094 </target>
[15799]1095
[16936]1096 <target name="create-deployment-files" depends="set-soapmethod" if="axis.sitename">
[15124]1097 <filter token="sitename" value="${axis.sitename}"/>
1098 <filter token="siteuri" value="${axis.siteuri}"/>
[15229]1099 <filter token="servicesname" value="${axis.servicesname}"/>
1100 <filter token="soapmethod" value="${soap.method}"/>
[15124]1101 <copy file="${basedir}/resources/soap/site.wsdd.template"
[15229]1102 tofile="${basedir}/resources/soap/deploy.wsdd"
1103 filtering="true"
1104 overwrite="true"/>
[15124]1105 <!-- create the java files and compile them -->
[15229]1106 <copy file="${basedir}/resources/java/${axis.servicesname}.java.in"
1107 tofile="${src.gsdl3.home}/${axis.servicesname}${axis.sitename}.java"
1108 filtering="true"
1109 overwrite="true"/>
[15124]1110 <mkdir dir="${build.home}"/>
1111 <javac srcdir="${src.home}"
1112 destdir="${build.home}"
1113 debug="${compile.debug}"
1114 deprecation="${compile.deprecation}"
1115 optimize="${compile.optimize}">
1116 <classpath refid="compile.classpath"/>
[15229]1117 <include name="org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.java" />
[15124]1118 </javac>
1119 <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
[15799]1120 <copy file="${build.home}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
1121 tofile="${web.classes}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
1122 overwrite="true" />
[15124]1123 </target>
[15799]1124
[15124]1125
[15799]1126 <!-- ====================== Core targets ============================== -->
1127 <!-- core targets refer to the core gsdl3 java src -->
[15124]1128
[19878]1129 <target name="prepare-core"/>
[15124]1130
1131 <target name="configure-core"/>
1132
1133 <target name="update-core" depends="init,svnupdate-core,clean-core,compile-core"
1134 description="Update only the Greenstone core" />
1135
[15799]1136 <target name="svnupdate-core" unless="nosvn.mode">
[20930]1137 <exec executable="svn">
1138 <arg value="update"/>
1139 <arg value="${basedir}"/>
1140 <arg value="-r"/><arg value="${branch.revision}"/>
1141 </exec>
[15124]1142 </target>
1143
1144 <target name="clean-core"
1145 description="Clean only the Greenstone core">
[19878]1146 <!-- should this delete the gsdl3.jar from web/WEB-INF?? -->
[15124]1147 <delete dir="${build.home}"/>
1148 </target>
1149
[15799]1150 <target name="compile-core" depends="init"
[15124]1151 description="Compile only the Greenstone core">
1152 <mkdir dir="${build.home}"/>
1153 <javac srcdir="${src.home}"
1154 destdir="${build.home}"
1155 debug="${compile.debug}"
1156 deprecation="${compile.deprecation}"
1157 optimize="${compile.optimize}">
1158 <classpath>
[16936]1159 <path refid="compile.classpath"/>
[15124]1160 </classpath>
1161 </javac>
1162 <jar destfile="${build.home}/gsdl3.jar">
1163 <fileset dir="${build.home}">
[16936]1164 <include name="org/greenstone/gsdl3/**"/>
[15124]1165 <include name="org/flax/**"/>
[16936]1166 <exclude name="**/Test.class"/>
[15124]1167 </fileset>
1168 <manifest>
[16936]1169 <attribute name="Built-By" value="${user.name}" />
[15124]1170 </manifest>
1171 </jar>
1172 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
[22101]1173
1174 <jar destfile="${build.home}/gutil.jar">
1175 <fileset dir="${build.home}">
1176 <include name="org/greenstone/util/**"/>
1177 </fileset>
1178 <manifest>
1179 <attribute name="Built-By" value="${user.name}" />
1180 </manifest>
1181 </jar>
1182 <copy file="${build.home}/gutil.jar" todir="${web.lib}"/>
1183
[15124]1184 <!-- copy the localsite server in case we need it -->
[15235]1185 <copy file="${build.home}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" tofile="${web.classes}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" />
[15124]1186
[17918]1187 <!-- Greenstone Administrator Interface -->
[15124]1188 <jar destfile="${build.home}/GAI.jar">
1189 <fileset dir="${build.home}">
[16936]1190 <include name="org/greenstone/admin/**"/>
[15124]1191 </fileset>
1192 <manifest>
[16936]1193 <attribute name="Built-By" value="${user.name}" />
[15124]1194 </manifest>
1195 </jar>
[17917]1196 <copy file="${build.home}/GAI.jar" todir="${web.lib}"/>
[18124]1197 <copy file="${build.home}/GAI.jar" todir="${admin.dir}"/>
[15124]1198 <jar destfile="${build.home}/phind.jar">
1199 <fileset dir="${build.home}">
[16936]1200 <include name="org/greenstone/applet/phind/**"/>
[15124]1201 </fileset>
1202 <manifest>
[16936]1203 <attribute name="Built-By" value="${user.name}" />
[15124]1204 </manifest>
1205 </jar>
1206 <mkdir dir="${web.applet}"/>
1207 <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
1208 <!-- phind also needs xercesImpl.jar and xml-apis.jar to be in web/applet -->
[18515]1209 <if>
1210 <bool><istrue value="${tomcat.islocal}"/></bool>
[20085]1211 <copy file="${web.lib}/xercesImpl.jar" todir="${web.applet}"/>
1212 <copy file="${web.lib}/xml-apis.jar" todir="${web.applet}"/>
[18515]1213 </if>
1214
1215
[17116]1216 <!-- skip anttasks for now
[15124]1217 <jar destfile="${build.home}/anttasks.jar">
1218 <fileset dir="${build.home}">
[16936]1219 <include name="org/greenstone/anttasks/**"/>
[15124]1220 </fileset>
1221 <manifest>
[16936]1222 <attribute name="Built-By" value="${user.name}" />
[15124]1223 </manifest>
1224 </jar>
[17116]1225 <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>-->
[15124]1226 <jar destfile="${build.home}/gsdl3test.jar">
1227 <fileset dir="${build.home}">
[16936]1228 <include name="org/greenstone/gsdl3/**/*Test.class"/>
1229 <include name="org/greenstone/testing/**"/>
[15124]1230 </fileset>
1231 <manifest>
[16936]1232 <attribute name="Built-By" value="${user.name}" />
[15124]1233 </manifest>
1234 </jar>
1235 <jar destfile="${build.home}/server.jar">
1236 <fileset dir="${build.home}">
[16936]1237 <include name="org/greenstone/server/**"/>
[22634]1238 <include name="org/greenstone/util/**"/>
[15124]1239 </fileset>
1240 <fileset file="${basedir}/resources/java/server.properties"/>
1241 <manifest>
[16936]1242 <attribute name="Built-By" value="${user.name}"/>
[15124]1243 </manifest>
1244 </jar>
1245 <copy file="${build.home}/server.jar" todir="${basedir}"/>
1246 </target>
[15799]1247
1248 <!-- ================== Packages targets ================================ -->
[15124]1249 <!-- these targets refer to the greenstone source packages - these need
1250 updating less often, so are in separate targets to the core -->
[19871]1251 <target name="prepare-packages" depends="init"/>
[15124]1252
1253 <target name="update-packages" depends="init,svnupdate-packages,configure-packages,clean-packages,compile-packages"
1254 description="Update only the source packages"/>
1255
[15799]1256 <target name="svnupdate-packages" unless="nosvn.mode">
[20930]1257 <exec executable="svn">
1258 <arg value="update"/>
1259 <arg value="${src.packages.home}"/>
1260 <arg value="-r"/><arg value="${branch.revision}"/>
1261 </exec>
[15124]1262 </target>
[19931]1263
[15124]1264
[19871]1265 <target name="configure-packages" depends="init,configure-javagdbm"
[15124]1266 description="Configure only the packages."/>
1267
[22184]1268 <target name="configure-javagdbm" if="with.jni">
[15124]1269 <echo>
1270 Configuring JavaGDBM
1271 </echo>
[18417]1272
[19904]1273 <exec executable="${javagdbm.home}/configure" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
[15124]1274 <arg value="--prefix=${basedir}"/>
1275 <arg value="--libdir=${lib.jni}"/>
[19873]1276 <arg value="--with-gdbm=${gdbm.home}"/>
[15124]1277 </exec>
1278 </target>
1279
[19871]1280 <target name="clean-packages" depends="init,clean-javagdbm" description="Clean only the packages"/>
[15124]1281
1282 <target name="clean-javagdbm" depends="init">
1283 <exec executable="make" os="${os.unix}"
[19904]1284 dir="${javagdbm.home}" failonerror="true">
[15124]1285 <arg value="clean"/>
1286 </exec>
1287 </target>
1288
[19871]1289 <target name="distclean-packages" depends="init,distclean-javagdbm" description="Distclean only the packages"/>
[15185]1290
[15799]1291 <target name="distclean-javagdbm" depends="init">
1292 <exec executable="make" os="${os.unix}"
[19904]1293 dir="${javagdbm.home}" failonerror="true">
[15799]1294 <arg value="distclean"/>
1295 </exec>
1296 </target>
1297
1298 <target name="compile-packages" description="Compile only the source packages">
[22184]1299 <!-- javagdbm -->
1300 <antcall target="compile-javagdbm"/>
1301 <!-- Search4j -->
1302 <antcall target="compile-search4j"/>
1303 </target>
1304
1305 <target name="compile-javagdbm" description="Compile JavaGDBM" if="with.jni">
[15799]1306
[19878]1307 <!-- unix: -->
[15799]1308 <echo>compile javagdbm</echo>
[19904]1309 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true"/>
1310 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
[15799]1311 <arg value="install"/>
1312 </exec>
[15098]1313
[15799]1314 <!-- windows: just the java stuff. -->
1315 <echo>Windows: compile javagdbm (java only)</echo>
[19904]1316 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}" failonerror="true">
[15799]1317 <arg value="compile"/>
1318 <arg value="javaonly"/>
1319 </exec>
[15124]1320
[15799]1321 <!-- install the jar file -->
1322 <echo>Install the javagdbm jar file</echo>
1323 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
1324 </target>
1325
[17491]1326 <target name="compile-search4j">
[17509]1327
[19996]1328 <!-- windows -->
[19997]1329 <if><bool><istrue value="${current.os.iswindows}"/></bool>
[19996]1330 <exec executable="nmake" dir="${src.packages.home}/search4j" failonerror="true">
1331 <arg value="/f"/>
1332 <arg value="win32.mak"/>
1333 <arg value='BINDIR="${basedir}\bin"'/>
1334 </exec>
1335 <exec executable="nmake" dir="${src.packages.home}/search4j" failonerror="true">
1336 <arg value="/f"/>
1337 <arg value="win32.mak"/>
1338 <arg value="install"/>
1339 <arg value='BINDIR="${basedir}\bin"'/>
1340 </exec>
[17509]1341
[19996]1342 <!-- unix -->
[19997]1343 <else><if><bool><istrue value="${current.os.isunix}"/></bool>
[19996]1344 <exec executable="${src.packages.home}/search4j/configure" dir="${src.packages.home}/search4j" failonerror="true">
1345 <arg value="--bindir=${basedir}/bin"/>
1346 <arg value="${static.arg}"/>
[22845]1347 <env key="CFLAGS" value="${cflags.arg}"/>
1348 <env key="CPPFLAGS" value="${cppflags.arg}"/>
1349 <env key="CXXFLAGS" value="${cxxflags.arg}"/>
[19996]1350 </exec>
1351 <exec executable="make" dir="${src.packages.home}/search4j" failonerror="true"/>
1352 <exec executable="make" dir="${src.packages.home}/search4j" failonerror="true">
1353 <arg value="install"/>
1354 </exec>
[17509]1355
[19996]1356 <!-- else warn -->
1357 <else>
1358 <fail>this target does not support the current os</fail>
[17509]1359
[19996]1360 </else></if></else></if>
1361
[17491]1362 </target>
1363
[19871]1364 <target name="install-auxiliary-jar-files" depends="init">
[22184]1365
1366 <if>
1367 <bool><available file="${mg.home}/mg.jar"/></bool>
1368 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
1369 </if>
1370
1371 <if>
[22199]1372 <bool><available file="${mgpp.home}/mgpp.jar"/></bool>
[22184]1373 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
1374 </if>
1375
[19871]1376 <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/>
1377 </target>
1378
[22184]1379 <target name="install-jni-files" depends="init,install-jni-files-linux,install-jni-files-windows,install-jni-files-macos" if="with.jni"/>
[15124]1380
[15799]1381 <target name="install-jni-files-linux" depends="init" if="current.os.isunixnotmac">
[15124]1382 <copy file="${mg.home}/jni/libmgretrievejni.so" todir="${lib.jni}"/>
1383 <copy file="${mg.home}/jni/libmgsearchjni.so" todir="${lib.jni}"/>
[15799]1384 <copy file="${mg.home}/jni/libmgpassjni.so" todir="${lib.jni}"/>
[15124]1385 <copy file="${mgpp.home}/jni/libmgppretrievejni.so" todir="${lib.jni}"/>
1386 <copy file="${mgpp.home}/jni/libmgppsearchjni.so" todir="${lib.jni}"/>
[15799]1387 <copy file="${mgpp.home}/jni/libmgpppassjni.so" todir="${lib.jni}"/>
1388 </target>
1389 <target name="install-jni-files-windows" depends="init" if="current.os.iswindows">
[15124]1390 <copy file="${mg.home}/jni/mgretrievejni.dll" todir="${lib.jni}"/>
1391 <copy file="${mg.home}/jni/mgsearchjni.dll" todir="${lib.jni}"/>
[15799]1392 <copy file="${mg.home}/jni/mgpassjni.dll" todir="${lib.jni}"/>
[15124]1393 <copy file="${mgpp.home}/jni/mgppretrievejni.dll" todir="${lib.jni}"/>
1394 <copy file="${mgpp.home}/jni/mgppsearchjni.dll" todir="${lib.jni}"/>
[15799]1395 <copy file="${mgpp.home}/jni/mgpppassjni.dll" todir="${lib.jni}"/>
1396 </target>
1397 <target name="install-jni-files-macos" depends="init" if="current.os.ismac">
[15124]1398 <copy file="${mg.home}/jni/libmgretrievejni.jnilib" todir="${lib.jni}"/>
1399 <copy file="${mg.home}/jni/libmgsearchjni.jnilib" todir="${lib.jni}"/>
[15799]1400 <copy file="${mg.home}/jni/libmgpassjni.jnilib" todir="${lib.jni}"/>
[15124]1401 <copy file="${mgpp.home}/jni/libmgppretrievejni.jnilib" todir="${lib.jni}"/>
1402 <copy file="${mgpp.home}/jni/libmgppsearchjni.jnilib" todir="${lib.jni}"/>
[15799]1403 <copy file="${mgpp.home}/jni/libmgpppassjni.jnilib" todir="${lib.jni}"/>
1404 </target>
1405
[19871]1406 <!-- ========common-src targets =================================-->
1407 <!-- these are used to get common-src (for indexers, gdbm, sqlite etc) when
1408 collection building is not enabled -->
1409
1410 <target name="update-common-src" depends="init" if="collection.building.disabled">
1411 </target>
[19931]1412
[19871]1413 <target name="svnupdate-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
[20930]1414 <exec executable="svn">
1415 <arg value="update"/>
1416 <arg value="${common.src.home}"/>
1417 <arg value="-r"/><arg value="${branch.revision}"/>
1418 </exec>
[19871]1419 </target>
1420
[19878]1421 <target name="prepare-common-src" depends="init" if="collection.building.disabled" unless="common.src.present">
[19871]1422 <antcall target="checkout-common-src"/>
1423 <antcall target="unzip-windows-packages"/>
1424 </target>
1425
1426 <target name="checkout-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
1427 <echo>checking out common-src</echo>
[20930]1428 <exec executable="svn">
1429 <arg value="checkout"/>
[21196]1430 <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src"/>
[20930]1431 <arg value="common-src"/>
1432 <arg value="-r"/><arg value="${branch.revision}"/>
1433 </exec>
[19871]1434 </target>
1435
[19931]1436 <target name="configure-common-src" depends="init">
[19871]1437 <exec executable="${common.src.home}/configure" os="${os.unix}"
[19904]1438 dir="${common.src.home}" failonerror="true">
[19931]1439 <arg value="--prefix=${gs2build.home}"/> <!-- what value to use?? -->
[19933]1440 <arg value="--bindir=${gs2build.home}/bin/${os.bin.dir}"/> <!-- what value to use?? -->
[22184]1441 <arg line="${gs2.opt.args}"/>
[19931]1442 <arg line="${static.arg}"/>
[22845]1443 <env key="CFLAGS" value="${cflags.arg}"/>
1444 <env key="CPPFLAGS" value="${cppflags.arg}"/>
1445 <env key="CXXFLAGS" value="${cxxflags.arg}"/>
[19871]1446 </exec>
1447 </target>
1448
[19931]1449 <target name="clean-common-src" depends="init">
[19871]1450 <!-- unix: -->
[19904]1451 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
[19871]1452 <arg value="clean"/>
1453 </exec>
1454 <!-- windows: -->
[19904]1455 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
[19871]1456 <arg value="/f"/>
1457 <arg value="win32.mak"/>
1458 <arg value="clean"/>
[19960]1459 <arg value="GSDLHOME=${gs2build.home}"/>
[19871]1460 </exec>
1461 </target>
[19931]1462 <target name="distclean-common-src" depends="init">
[19960]1463 <!-- unix: -->
[19904]1464 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
[19871]1465 <arg value="distclean"/>
1466 </exec>
[19960]1467 <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
1468 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1469 <arg value="/f"/>
1470 <arg value="win32.mak"/>
1471 <arg value="clean"/>
1472 <arg value="GSDLHOME=${gs2build.home}"/>
1473 </exec>
[19871]1474 </target>
[19931]1475 <target name="compile-common-src" depends="init">
[19871]1476 <!-- unix: -->
[19904]1477 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
[22184]1478 <arg value="${gs2.compile.target}"/>
[22845]1479 <env key="CFLAGS" value="${cflags.arg}"/>
1480 <env key="CPPFLAGS" value="${cppflags.arg}"/>
1481 <env key="CXXFLAGS" value="${cxxflags.arg}"/>
[19871]1482 </exec>
1483 <!-- windows: -->
[19904]1484 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
[19871]1485 <arg value="/f"/>
1486 <arg value="win32.mak"/>
[19934]1487 <arg value="GSDLHOME=${gs2build.home}"/>
[22184]1488 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
1489 <arg value="USE_SQLITE=0"/> <!-- Why is this not on by default? -->
[19871]1490 </exec>
1491 </target>
1492
[19843]1493 <!-- ======= collection-building targets ===========================-->
[15124]1494
[19843]1495 <target name="update-collection-building" if="collection.building.enabled"
[19931]1496 depends="init,svnupdate-collection-building,gs2build-edit-setup-bat,configure-common-src,clean-common-src,compile-common-src,configure-collection-building,clean-collection-building,compile-collection-building"
[19843]1497 description="Update (SVN update, configure, compile etc) only the collection building components"/>
[15124]1498
[19843]1499 <target name="svnupdate-collection-building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nosvn.mode"
1500 description="SVN update the collection building components">
1501 </target>
[15124]1502
[19843]1503 <target name="prepare-collection-building" depends="init,prepare-gs2build,prepare-gli" if="collection.building.enabled">
[15124]1504 </target>
1505
[19931]1506 <target name="configure-collection-building" depends="init,configure-build-src" if="collection.building.enabled"
1507 description="Configure the collection building components">
[19843]1508 </target>
[15098]1509
[19948]1510 <target name="clean-collection-building" depends="init,clean-gli,clean-build-src"
[19843]1511 description="Clean only the collection building components"
1512 if="collection.building.enabled"/>
[18495]1513
[19948]1514 <target name="distclean-collection-building" depends="init,clean-build-src,distclean-build-src"
[19843]1515 description="Distclean only the collection building components"
1516 if="collection.building.enabled"/>
1517
[19931]1518 <target name="compile-collection-building" depends="init,compile-build-src,compile-gli" if="collection.building.enabled"
[19843]1519 description="Compile only the collection building components">
[19931]1520 <!-- make install for common-src -->
1521 <!-- unix: -->
1522 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
[22184]1523 <arg value="${gs2.install.target}"/>
[19931]1524 </exec>
1525
1526 <!-- windows: -->
1527 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1528 <arg value="/f"/>
1529 <arg value="win32.mak"/>
[21370]1530 <arg value="install"/>
[22184]1531 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
1532 <arg value="USE_SQLITE=0"/> <!-- why is this not on by default? -->
[19931]1533 </exec>
1534
1535 <!-- install gs2build indexers for windows -->
1536 <if>
1537 <bool><istrue value="${current.os.iswindows}"/></bool>
1538 <copy todir="${gs2build.home}/bin/windows">
1539 <fileset dir="${gs2build.home}/common-src/indexers/bin">
1540 <include name="*.*"/>
1541 </fileset>
1542 </copy>
1543 </if>
1544
1545 <!-- LuceneWrapper jar file not installed by default -->
1546 <mkdir dir="${gs2build.home}/bin/java"/>
1547 <copy file="${lucene.home}/LuceneWrapper.jar" todir="${gs2build.home}/bin/java"/>
1548
[15124]1549 </target>
[19843]1550
1551 <!-- ============== gli targets ================================= -->
[15799]1552 <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nosvn.mode">
[19929]1553
[20930]1554 <exec executable="svn">
1555 <arg value="update"/>
1556 <arg value="${gli.home}"/>
1557 <arg value="-r"/><arg value="${branch.revision}"/>
1558 </exec>
1559
[21196]1560 <exec executable="svn" dir="web/WEB-INF/cgi">
[20930]1561 <arg value="export"/>
1562 <arg value="-r"/><arg value="${branch.revision}"/>
[21196]1563 <arg value="${svn.root}/main/${branch.path}/greenstone2/cgi-bin/gliserver.pl"/>
[20930]1564 </exec>
[21196]1565 <exec executable="svn" dir="web/WEB-INF/cgi">
1566 <arg value="export"/>
1567 <arg value="-r"/><arg value="${branch.revision}"/>
1568 <arg value="${svn.root}/main/${branch.path}/greenstone2/cgi-bin/gsdlCGI.pm"/>
1569 </exec>
[20930]1570
[15124]1571 </target>
1572
[19843]1573 <target name="prepare-gli" depends="init" if="collection.building.enabled" unless="gli.present">
[19911]1574 <!-- checkout -->
1575 <if><bool><not><istrue value="${nosvn.mode}"/></not></bool>
[19929]1576
[20930]1577 <exec executable="svn">
1578 <arg value="checkout"/>
[21196]1579 <arg value="${svn.root}/main/${branch.path}/gli"/>
[20930]1580 <arg value="-r"/><arg value="${branch.revision}"/>
1581 </exec>
1582
[21196]1583 <exec executable="svn" dir="web/WEB-INF/cgi">
[20930]1584 <arg value="export"/>
1585 <arg value="-r"/><arg value="${branch.revision}"/>
[21196]1586 <arg value="${svn.root}/main/${branch.path}/greenstone2/cgi-bin/gliserver.pl"/>
[20930]1587 </exec>
[21196]1588 <exec executable="svn" dir="web/WEB-INF/cgi">
1589 <arg value="export"/>
1590 <arg value="-r"/><arg value="${branch.revision}"/>
1591 <arg value="${svn.root}/main/${branch.path}/greenstone2/cgi-bin/gsdlCGI.pm"/>
1592 </exec>
[20930]1593
[19911]1594 </if>
[15124]1595 </target>
[19843]1596
1597 <target name="clean-gli" depends="init" if="collection.building.enabled">
1598 <!-- gli -->
1599 <property name="gli.home" value="${basedir}/gli"/>
1600 <!-- linux -->
1601 <exec executable="clean.sh" os="${os.unix}" dir="${gli.home}"
[20826]1602 resolveExecutable="true" failonerror="true"/>
[19843]1603 <!-- windows -->
1604 <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
[20826]1605 resolveExecutable="true" failonerror="true"/>
[19843]1606 </target>
1607
1608 <target name="compile-gli" depends="init" if="collection.building.enabled">
1609 <!-- gli -->
1610 <property name="gli.home" value="${basedir}/gli"/>
[15098]1611
[19843]1612 <!-- linux -->
[20826]1613 <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
[19843]1614 <!--remote gli-->
1615 <exec executable="makejar.sh" os="${os.unix}" dir="${gli.home}"
[20826]1616 resolveExecutable="true" failonerror="true"/>
[19843]1617 <!-- windows -->
[20826]1618 <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
[19843]1619 <!--remote gli-->
1620 <exec executable="makejar.bat" os="${os.windows}" dir="${gli.home}"
[20826]1621 resolveExecutable="true" failonerror="true"/>
[19843]1622 <copy file="${gli.home}/GLIServer.jar" todir="${gs2build.home}/bin/java" />
1623 </target>
[15124]1624
[19843]1625 <target name="gli" description="Run the Greenstone Librarian Interface" depends="init" if="collection.building.enabled">
[21351]1626 <exec executable="${basedir}/gli/gli.sh" os="${os.linux},${os.solaris}" dir="${basedir}/gli" spawn="true">
[19843]1627 <env key="gsdl3path" path="${basedir}"/>
[19871]1628 <env key="gsdlpath" path="${gs2build.home}"/>
[19843]1629 </exec>
[21351]1630 <exec executable="${basedir}/gli/gli.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
[19843]1631 <env key="gsdl3path" path="${basedir}"/>
[19871]1632 <env key="gsdlpath" path="${gs2build.home}"/>
[19873]1633 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.home}/lib"/>
[19843]1634 </exec>
[21351]1635 <exec executable="${basedir}/gli/gli.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
[19843]1636 <env key="GSDL3PATH" path="${basedir}"/>
[19871]1637 <env key="GSDLPATH" path="${gs2build.home}"/>
[19843]1638 </exec>
1639 <echo>Running GLI from Ant means that you don't get to see any of the terminal output. If you have problems with GLI and want to see the output, please run the script gli.sh/bat from the greenstone3/gli directory.
1640 </echo>
1641 </target>
1642
1643 <!-- ================ gs2build targets =========================== -->
1644
1645 <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nosvn.mode">
1646 <echo>svn updating gs2build</echo>
[20930]1647 <exec executable="svn">
1648 <arg value="update"/>
1649 <arg value="${gs2build.home}"/>
1650 <arg value="-r"/><arg value="${branch.revision}"/>
1651 </exec>
[15799]1652 </target>
[19843]1653
[15124]1654 <target name="prepare-gs2build" depends="init" if="collection.building.enabled" unless="gs2build.present">
1655 <antcall target="checkout-gs2build"/>
1656 <antcall target="unzip-windows-packages"/>
1657 <antcall target="checkout-winbin"/>
1658 <antcall target="get-windows-binaries"/>
1659 <antcall target="delete-winbin"/>
1660 </target>
1661
[19843]1662 <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nosvn.mode">
1663 <echo>checking out gs2build</echo>
[20930]1664 <exec executable="svn">
1665 <arg value="checkout"/>
[21196]1666 <arg value="${svn.root}/main/${branch.path}/gs2build"/>
[20930]1667 <arg value="-r"/><arg value="${branch.revision}"/>
1668 </exec>
1669
[21196]1670
[19843]1671 </target>
1672
[15124]1673 <target name="checkout-winbin" depends="init" if="current.os.iswindows"
[15799]1674 unless="nosvn.mode">
[20930]1675
1676 <exec executable="svn">
1677 <arg value="checkout"/>
[21196]1678 <arg value="${svn.root}/main/${branch.path}/binaries/windows"/>
[20930]1679 <arg value="-r"/><arg value="${branch.revision}"/>
[21196]1680 <arg value="winbin"/>
[20930]1681 </exec>
1682
[15124]1683 </target>
1684
[15799]1685 <target name="update-winbin" depends="init" if="current.os.iswindows" unless="nosvn.mode">
[20930]1686 <exec executable="svn">
1687 <arg value="update"/>
1688 <arg value="winbin"/>
1689 <arg value="-r"/><arg value="${branch.revision}"/>
1690 </exec>
1691
[15799]1692 </target>
[15124]1693
1694 <target name="get-windows-binaries" depends="init" if="collection.building.enabled.windows">
1695 <move todir="${gs2build.home}/bin/windows" failonerror="false">
1696 <fileset dir="${basedir}/winbin/bin"/>
1697 </move>
1698 </target>
[19843]1699
[15124]1700 <target name="delete-winbin" depends="init" if="collection.building.enabled.windows">
1701 <delete dir="${basedir}/winbin"/>
1702 </target>
1703
[19871]1704 <target name="unzip-windows-packages" depends="init" if="current.os.iswindows">
1705 <unzip src="${common.src.home}/packages/windows/crypt/crypt.zip"
1706 dest="${common.src.home}/packages/windows/crypt"/>
[18179]1707 <untar compression="gzip"
[19871]1708 src="${common.src.home}/packages/sqlite/${sqlite.targz.version}"
1709 dest="${common.src.home}/packages/sqlite"/>
1710 <unzip src="${common.src.home}/indexers/packages/windows/iconv/iconv.zip"
1711 dest="${common.src.home}/indexers/packages/windows/iconv"/>
[15799]1712 </target>
[19878]1713
[15124]1714 <target name="gs2build-edit-setup-bat" if="collection.building.enabled.windows">
1715 <!-- we want a windows path in the setup.bat file -->
1716 <pathconvert targetos="windows" property="gs2build.home.windows">
1717 <path path="${gs2build.home}"/>
1718 </pathconvert>
1719 <move file="${gs2build.home}/setup.bat" tofile="${gs2build.home}/setup-tmp.bat">
1720 <filterset>
[16620]1721 <filter token="gsdlhome" value="${gs2build.home.windows}"/>
[15799]1722 </filterset>
[15124]1723 </move>
1724 <move file="${gs2build.home}/setup-tmp.bat" tofile="${gs2build.home}/setup.bat" />
1725 </target>
1726
[19843]1727
[19948]1728 <target name="clean-build-src" depends="init" if="collection.building.enabled">
[19871]1729 <!-- unix: -->
[19948]1730 <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
[15124]1731 <arg value="clean"/>
1732 </exec>
1733 <!-- windows: -->
[19948]1734 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
[15799]1735 <arg value="/f"/>
1736 <arg value="win32.mak"/>
1737 <arg value="clean"/>
[19960]1738 <arg value="GSDLHOME=${gs2build.home}"/>
[15124]1739 </exec>
1740 </target>
1741
[19948]1742
1743 <target name="distclean-build-src" depends="init,clean-build-src" if="collection.building.enabled">
[19960]1744 <!-- unix: -->
[19948]1745 <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
[15124]1746 <arg value="distclean"/>
1747 </exec>
[19960]1748 <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
1749 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
1750 <arg value="/f"/>
1751 <arg value="win32.mak"/>
1752 <arg value="clean"/>
1753 <arg value="GSDLHOME=${gs2build.home}"/>
1754 </exec>
[15124]1755 </target>
[19843]1756
[19931]1757 <target name="configure-build-src" depends="init" if="collection.building.enabled"
1758 description="Configure the build-src component">
1759 <exec executable="${build.src.home}/configure" os="${os.unix}"
1760 dir="${build.src.home}" failonerror="true">
1761 <arg value="--prefix=${gs2build.home}"/>
[22184]1762 <arg line="${gs2.opt.args}"/>
[19931]1763 <arg line="${static.arg}"/>
1764 </exec>
1765 </target>
[19910]1766
[19931]1767 <!-- common-src is done separately and needs to be compiled first -->
1768 <target name="compile-build-src" depends="init" if="collection.building.enabled">
1769
1770 <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
[22845]1771 <env key="CFLAGS" value="${cflags.arg}"/>
1772 <env key="CPPFLAGS" value="${cppflags.arg}"/>
1773 <env key="CXXFLAGS" value="${cxxflags.arg}"/>
1774 </exec>
1775
1776 <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
[19931]1777 <arg value="install"/>
1778 </exec>
[19910]1779
[19931]1780 <!-- run the setup script -->
[20826]1781 <!-- <exec executable="${compile.windows.c++.setup}" os="${os.windows}" failonerror="true"/>-->
[19910]1782 <!--Above does not work: even though vcvars.bat executes, the env changes it makes don't get saved. Need user to run vcvars.bat first before calling ant-->
[19931]1783 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
[19910]1784 <arg value="/f"/>
1785 <arg value="win32.mak"/>
[19934]1786 <arg value="GSDLHOME=${gs2build.home}"/>
[19910]1787 </exec>
[19931]1788 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
[19910]1789 <arg value="/f"/>
1790 <arg value="win32.mak"/>
1791 <arg value="install"/>
[19934]1792 <arg value="GSDLHOME=${gs2build.home}"/>
[19910]1793 </exec>
[15124]1794 </target>
1795
1796
[15799]1797 <!-- ======================== TESTING Targets ========================= -->
[15124]1798
1799 <target name="test" description="Run the (incomplete) JUnit test suite "
1800 depends="init">
1801 <mkdir dir="${basedir}/test"/>
1802 <junit printsummary="withOutAndErr"
1803 errorproperty="test.failed"
1804 failureproperty="test.failed"
1805 fork="${junit.fork}">
1806 <formatter type="plain"/>
1807 <classpath>
[16936]1808 <pathelement location="${build.home}/gsdl3test.jar"/>
1809 <path refid="compile.classpath"/>
[15124]1810 </classpath>
1811 <test name="${testcase}" if="testcase"/>
1812 <batchtest todir="${basedir}/test" unless="testcase">
[18505]1813 <fileset dir="${build.home}" includes="**/*Test.class" />
[15124]1814 </batchtest>
1815 </junit>
1816 <echo>
1817 *********************************************
[15799]1818 Test output can be found in directory 'test'
[15124]1819 *********************************************
1820 </echo>
1821 </target>
[15799]1822
[20950]1823 <!-- ======================== FLAX Targets ========================= -->
1824 <target name="prepare-flax" description="check out flax source code from another repository" if="install.flax">
1825 <echo>checking out flax ...</echo>
1826 <mkdir dir="${basedir}/src/java/org/flax"/>
1827 <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
[22198]1828 <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/action/flax"/>
[20950]1829 <mkdir dir="${web.home}/WEB-INF/classes/flax"/>
1830 <mkdir dir="${web.home}/interfaces/flax"/>
1831 <mkdir dir="${web.home}/sites/flax"/>
1832 <mkdir dir="${basedir}/flax-resources"/>
1833 <mkdir dir="${basedir}/flax-lib"/>
[21272]1834 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/flax"/>
1835 <arg value="src/java/org/flax"/></exec>
1836 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/greenstone/gsdl3/flax"/>
1837 <arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
[22198]1838 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/greenstone/gsdl3/action/flax"/>
1839 <arg value="src/java/org/greenstone/gsdl3/action/flax"/></exec>
1840 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/WEB-INF/classes/flax"/>
[21272]1841 <arg value="${web.home}/WEB-INF/classes/flax"/></exec>
1842 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/interfaces/flax"/>
1843 <arg value="${web.home}/interfaces/flax"/></exec>
1844 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/sites/flax"/>
1845 <arg value="${web.home}/sites/flax"/></exec>
1846 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/flax-resources"/>
1847 <arg value="flax-resources"/></exec>
1848 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/lib"/>
1849 <arg value="flax-lib"/></exec>
[20950]1850 <move file="${web.home}/WEB-INF/web.xml" tofile="${web.home}/WEB-INF/web.xml.greenstone3backup"/>
1851 <antcall target="flax-copy-files" />
1852 </target>
1853
1854 <target name="update-flax" description="update flax from repository">
1855 <echo>updating flax ...</echo>
[21272]1856 <exec executable="svn"><arg value="update"/>
1857 <arg value="src/java/org/flax"/></exec>
1858 <exec executable="svn"><arg value="update"/>
[22198]1859 <arg value="src/java/org/greenstone/gsdl3/action/flax"/></exec>
1860 <exec executable="svn"><arg value="update"/>
[21272]1861 <arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
1862 <exec executable="svn"><arg value="update"/>
1863 <arg value="${web.home}/WEB-INF/classes/flax"/></exec>
1864 <exec executable="svn"><arg value="update"/>
1865 <arg value="${web.home}/interfaces/flax"/></exec>
1866 <exec executable="svn"><arg value="update"/>
1867 <arg value="flax-resources"/></exec>
1868 <exec executable="svn"><arg value="update"/>
1869 <arg value="flax-lib"/></exec>
[20950]1870 <antcall target="flax-copy-files" />
1871 </target>
1872
1873 <target name="flax-copy-files" description="copy some flax files into the appropriate greenstone3 directories">
1874 <echo>copying flax files ...</echo>
1875 <copy file="${web.home}/WEB-INF/classes/flax/web.xml" todir="${web.home}/WEB-INF" overwrite="true" />
1876 <!-- A configuration file containing web service binding information for the axis engine -->
1877 <copy file="${web.home}/WEB-INF/classes/flax/server-config.wsdd" todir="${web.home}/WEB-INF" overwrite="true" />
1878 <!-- A static web service wsdl file which is queried by soap client. The reason this file is used (instead of the dynamically generated version) is in case any redirects are used in the Apache configuration (e.g., flax.nzdl.org:80 redirects to harakeke:8080) -->
1879 <copy file="${basedir}/flax-resources/FlaxWebService.wsdl" tofile="${web.home}/FlaxWebService.wsdl" filtering="true" overwrite="true">
1880 <filterset>
1881 <filter token="flaxpublicserver" value="${tomcat.server}"/>
1882 <filter token="flaxpublicport" value="${tomcat.port}"/>
1883 </filterset>
1884 </copy>
1885 <copy file="${basedir}/flax-lib/opennlp-tools-1.3.0.jar" todir="${web.home}/WEB-INF/lib" overwrite="true" />
[22344]1886 <copy file="${basedir}/flax-lib/cos.jar" todir="${web.home}/WEB-INF/lib" overwrite="true" />
[20950]1887 </target>
1888
[20963]1889
[19354]1890 <target name="compile-javadocs">
1891 <javadoc packagenames="org.greenstone.*"
1892 sourcepath="src/java"
1893 defaultexcludes="yes"
1894 destdir="docs/javadoc"
1895 author="true"
1896 version="true"
1897 use="true"
1898 windowtitle="Greenstone3 API">
1899 <doctitle><![CDATA[<h1>Greenstone3 API</h1>]]></doctitle>
1900 </javadoc>
1901 </target>
1902
[20089]1903<!-- ========== Some distribution targets ======================== -->
[19972]1904 <target name="remove-source">
[19975]1905 <delete includeEmptyDirs="true">
1906 <fileset dir="." defaultexcludes="false">
1907 <patternset refid="greenstone3.source.component"/>
1908 </fileset>
1909 </delete>
[19972]1910 </target>
1911
[19903]1912 <target name="dist-tidy"
1913 description="'tidies-up' a greenstone3 installation for distribution.">
1914
1915 <!-- delete unneeded things -->
1916 <delete dir="${packages.home}/axis"/>
1917 <delete><fileset dir="${packages.home}" includes="*.zip"/></delete>
1918 <delete file="README-SVN.txt"/>
[20215]1919 <delete file="build.properties.in"/>
[19903]1920
[19961]1921 <!-- delete source files -->
[19972]1922 <antcall target="remove-source"/>
[19903]1923
1924 <!-- create empty directories -->
1925 <mkdir dir="${web.home}/applet"/>
1926 <mkdir dir="${web.home}/logs"/>
1927
1928 <!-- os specific tidy-ups -->
[20051]1929 <!-- linux, mac -->
1930 <if><bool><istrue value="${current.os.isunix}"/></bool>
[19903]1931 <delete><fileset dir="." includes="*.bat"/></delete>
1932 <delete><fileset dir="gli" includes="*.bat"/></delete>
1933 <delete><fileset dir="gs2build" includes="*.bat"/></delete>
1934 <delete><fileset dir="bin/script" includes="*.bat"/></delete>
[19946]1935 <delete file="${basedir}/gs2build/win32cfg.h"/>
[19939]1936 <delete file="${basedir}/gs2build/win32.mak"/>
[20051]1937 <delete dir="${basedir}/winutil"/>
[19903]1938 <delete failonerror="false"><fileset dir="${lib.jni}" includes="*.dll"/></delete>
1939
[20051]1940 <!-- windows -->
1941 <else><if><bool><istrue value="${current.os.iswindows}"/></bool>
1942 <delete><fileset dir="." includes="*.sh,*.bash,*.csh"/></delete>
1943 <delete><fileset dir="gli" includes="*.sh,*.bash,*.csh"/></delete>
1944 <delete><fileset dir="gs2build" includes="*.sh,*.bash,*.csh"/></delete>
1945 <delete><fileset dir="bin/script" includes="*.sh,*.bash,*.csh"/></delete>
1946 </if></else></if>
1947
[19903]1948 </target>
1949
[20089]1950 <!-- fix up executable permissions for binary release -->
1951 <target name="fix-execute-permissions">
1952 <echo>Setting binaries to executable</echo>
[20127]1953 <chmod perm="775">
1954 <fileset dir="."><patternset refid="greenstone3.executables"/></fileset>
1955 </chmod>
[20089]1956 </target>
1957
1958 <!-- fix up executable permissions for source code release -->
1959 <target name="fix-execute-permissions-source">
[20127]1960 <chmod perm="775">
1961 <fileset dir="."><patternset refid="greenstone3.source.executables"/></fileset>
1962 </chmod>
[20089]1963 </target>
1964
1965
[19931]1966 <!-- ============= tweaks for making compilation static ========== -->
1967 <target name="tweak-makefiles" depends="init" if="compile.static">
1968 <antcall target="rtftohtml-add-static" />
1969 </target>
1970
1971 <target name="rtftohtml-add-static" depends="init" if="collection.building.enabled">
1972 <rsr file="${gs2build.home}/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="-o rtftohtml(.{2})EXEEXT(.{1})" replacement="-o rtftohtml$1EXEEXT$2 -static" />
1973 </target>
1974
[15028]1975</project>
[22184]1976
Note: See TracBrowser for help on using the repository browser.