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

Last change on this file since 26082 was 26082, checked in by sjm84, 12 years ago

Fixed error messages when calling "ant clean"

File size: 100.5 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"/>
[23854]25 <taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask" classpathref="project.classpath"/>
26
[19930]27
[15799]28 <!-- ===================== Property Definitions =========================== -->
29
30 <!--
[15124]31
32 Each of the following properties are used in the build script.
33 Values for these properties are set by the first place they are
34 defined, from the following list:
35
36 * Definitions on the "ant" command line (ant -Dfoo=bar compile).
37
38 * Definitions from a "build.properties" file in the top level
[15799]39 source directory of this application.
[15124]40
41 * Definitions from a "build.properties" file in the user's
[15799]42 home directory.
[15124]43
44 * Default definitions in this build.xml file.
45
46 You will note below that property values can be composed based on the
47 contents of previously defined properties. This is a powerful technique
48 that helps you minimize the number of changes required when your development
49 environment is modified. Note that property composition is allowed within
50 "build.properties" files as well as in the "build.xml" script.
51
[15799]52 -->
[18227]53
54 <!-- create build.properties if it has not been created yet -->
55 <if>
56 <bool><not><available file="build.properties"/></not></bool>
57 <copy file="build.properties.in" tofile="build.properties"/>
58 </if>
59
[18515]60 <!-- create the packages dir if it has not been created yet -->
61 <mkdir dir="packages"/>
[15799]62
[15859]63 <!--the first three properties have to be put on the top to be used by build.properties-->
[19960]64 <property name="gs2build.home" value="${basedir}${file.separator}gs2build"/>
[15124]65 <property name="src.packages.home" value="${basedir}/src/packages"/>
[15859]66 <property name="flax.svn.root" value="http://svn.greenstone.org/flax"/>
[19878]67
[15124]68 <property file="build.properties"/>
[16962]69 <if><bool><available file="${user.home}/build.properties"/></bool>
70 <property file="${user.home}/build.properties"/>
71 </if>
[15124]72
[20464]73 <!-- now we've read in properties, apply defaults -->
74 <property name="disable.collection.building" value="false"/>
75
[15124]76 <!-- get properties from the environment -->
77 <property environment="env"/>
[15799]78
[20127]79 <!-- get the filesets defining components and executables -->
[19975]80 <import file="resources/xml/components.xml"/>
[20127]81 <import file="resources/xml/executables.xml"/>
[15799]82
83 <!-- version properties for external packages -->
[20079]84 <!-- for Java versions < 1.4, we print out the message that Java is too old.
[25131]85 For Java 1.4, we use Tomcat 5.5, for Java5 and higher, we use Tomcat 7.0-->
86 <condition property="tomcat.version" value="apache-tomcat-5.5.25" else="apache-tomcat-7.0.26">
[20079]87 <equals arg1="1.4" arg2="${ant.java.version}"/>
88 </condition>
[25131]89 <condition property="tomcat.version.major" value="5" else="7">
[20079]90 <equals arg1="1.4" arg2="${ant.java.version}"/>
91 </condition>
[22320]92 <condition property="privileged.attribute" value="privileged='true'" else="">
[25384]93 <equals arg1="7" arg2="${tomcat.version.major}"/>
[22320]94 </condition>
[20233]95
[22405]96 <property name="axis.zip.version" value="axis-bin-1_4.zip"/>
97 <property name="axis.dir.version" value="axis-1_4"/>
[24077]98 <property name="sqlite.targz.version" value="sqlite-autoconf-3070602.tar.gz"/>
[15799]99
[15124]100 <property name="build.home" value="${basedir}/build"/>
101 <property name="src.home" value="${basedir}/src/java"/>
102 <property name="packages.home" value="${basedir}/packages"/>
103 <!-- this may be set in build.properties, eg if you move the web dir to
104 tomcats webapps directory -->
105 <property name="web.home" value="${basedir}/web"/>
106 <!-- jar files needed by applets go here -->
107 <property name="web.applet" value="${web.home}/applet"/>
[20085]108
[15124]109 <!-- jar files needed by the servlet (and extra ones) go here -->
110 <property name="web.lib" value="${web.home}/WEB-INF/lib"/>
111 <!-- other files needed by the servlet go here -->
112 <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
113 <!--- flax: the WordNet home -->
114 <property name="wn.home" value="${web.home}/WEB-INF/classes/flax/WordNet"/>
115
116 <!-- jni libraries and java wrappers go here -->
117 <property name="lib.jni" value="${basedir}/lib/jni"/>
[19878]118
119 <!-- other jar files needed for installation (but not runtime) go here -->
[18110]120 <property name="lib.java" value="${basedir}/lib/java"/>
[15799]121
[15124]122 <property name="javadocs" value="${basedir}/docs/javadoc"/>
123
124 <property name="app.name" value="greenstone3"/>
125 <property name="app.path" value="/${app.name}"/>
126
[18124]127 <property name="admin.dir" value="${basedir}/admin"/>
[15124]128
129 <!-- defaults - set these on the command line or in build.properties or they will take these default values-->
130 <property name="app.version" value="trunk"/>
131 <property name="branch.path" value="trunk"/>
132 <property name="branch.revision" value="HEAD"/>
133
134 <!--constants -->
135 <property name="svn.root" value="http://svn.greenstone.org"/>
136
[19878]137 <!-- catalina home is set to tomcat basedir if already installed, otherwise
[15124]138 use greenstone's tomcat -->
[20085]139 <condition property="catalina.home" value="${tomcat.installed.path}" else="${packages.home}/tomcat">
[15124]140 <and>
141 <isset property="tomcat.installed.path"/>
142 <not>
[16936]143 <equals arg1="" arg2="${tomcat.installed.path}"/>
[15124]144 </not>
145 </and>
146 </condition>
[25131]147
[15124]148 <property name="os.linux" value="Linux"/>
149 <property name="os.mac" value="Mac OS X"/>
150 <property name="os.solaris" value="SunOS"/>
151 <property name="os.unix" value="${os.linux},${os.mac},${os.solaris}"/>
[22056]152 <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]153
154 <!-- this is true for linux and macs -->
155 <condition property="current.os.isunix">
156 <os family="unix"/>
157 </condition>
158
159 <condition property="current.os.isunixnotmac">
160 <and>
161 <os family="unix"/>
162 <not>
[19933]163 <os family="mac"/>
[15124]164 </not>
165 </and>
166 </condition>
[19878]167
[15124]168 <condition property="current.os.ismac">
169 <os family="mac"/>
170 </condition>
171
172 <condition property="current.os.iswindows">
173 <os family="windows"/>
174 </condition>
175
[19933]176 <!-- is there a better way to do this?? what about solaris?? -->
177 <condition property="os.bin.dir" value="windows">
178 <os family="windows"/>
179 </condition>
180 <condition property="os.bin.dir" value="darwin">
181 <os family="mac"/>
182 </condition>
183 <condition property="os.bin.dir" value="linux">
184 <and>
185 <os family="unix"/>
186 <not>
187 <os family="mac"/>
188 </not>
189 </and>
190 </condition>
191
192
[19878]193 <condition property="collection.building.disabled">
[20464]194 <and>
195 <isset property="disable.collection.building"/>
196 <istrue value="${disable.collection.building}"/>
197 </and>
[19878]198 </condition>
199
[15124]200 <condition property="collection.building.enabled">
201 <not>
[20464]202 <istrue value="${disable.collection.building}"/>
[15124]203 </not>
204 </condition>
[19878]205
[15124]206 <condition property="collection.building.enabled.windows">
207 <and>
[20464]208 <istrue value="${collection.building.enabled}"/>
[15124]209 <isset property="current.os.iswindows"/>
210 </and>
211 </condition>
212
213 <condition property="collection.building.enabled.unix">
214 <and>
[20464]215 <istrue value="${collection.building.enabled}"/>
[15124]216 <isset property="current.os.isunix"/>
217 </and>
218 </condition>
[22847]219
[20085]220 <condition property="static.arg" value="LDFLAGS=-static" else=" ">
[19931]221 <isset property="compile.static"/>
222 </condition>
[22184]223
[22845]224 <!-- If building a release then we want to adjust environment variables so that the support library can be see during compilation -->
225 <if><bool><isset property="use.support.lib"/></bool>
[23599]226 <property name="gnome-lib-dir" value="${basedir}/ext/gnome-lib-minimal/${os.bin.dir}"/>
[22845]227
[23599]228 <if><bool><isset property="env.CFLAGS"/></bool>
229 <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CFLAGS}&quot;"/>
230 <else>
231 <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome-lib-dir}/include&quot;"/>
232 </else>
233 </if>
[22845]234
[23599]235 <if><bool><isset property="env.CPPFLAGS"/></bool>
236 <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CPPFLAGS}&quot;"/>
237 <else>
238 <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome-lib-dir}/include&quot;"/>
239 </else>
240 </if>
[22847]241
[23599]242 <if><bool><isset property="env.CXXFLAGS"/></bool>
243 <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CXXFLAGS}&quot;"/>
244 <else>
245 <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome-lib-dir}/include&quot;"/>
246 </else>
247 </if>
248
249 <if><bool><isset property="env.LDFLAGS"/></bool>
250 <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome-lib-dir}/lib ${env.LDFLAGS}&quot;"/>
251 <else>
252 <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome-lib-dir}/lib&quot;"/>
253 </else>
254 </if>
255
256 <if><bool><isset property="env.PATH"/></bool>
257 <property name="path.arg" value="PATH=&quot;${gnome-lib-dir}/bin:${env.PATH}&quot;"/>
258 <else>
259 <property name="path.arg" value="PATH=&quot;${gnome-lib-dir}/bin&quot;"/>
260 </else>
261 </if>
262
263 <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
264 <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome-lib-dir}/lib/pkgconfig:${env.PKG_CONFIG_PATH}&quot;"/>
265 <else>
266 <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome-lib-dir}/lib/pkgconfig&quot;"/>
267 </else>
268 </if>
269
[23611]270 <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
271 <if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
272 <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib:${env.DYLD_LIBRARY_PATH}&quot;"/>
273 <else>
274 <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib&quot;"/>
275 </else>
276 </if>
[23599]277 <else>
[23611]278 <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
279 <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib:${env.LD_LIBRARY_PATH}&quot;"/>
280 <else>
281 <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib&quot;"/>
282 </else>
283 </if>
[23599]284 </else>
285 </if>
286
287 <else>
288 <if><bool><isset property="env.CFLAGS"/></bool>
289 <property name="cflags.arg" value="CFLAGS=&quot;${env.CFLAGS}&quot;"/>
290 <else>
291 <property name="cflags.arg" value=" "/>
292 </else>
293 </if>
294
295 <if><bool><isset property="env.CPPFLAGS"/></bool>
296 <property name="cppflags.arg" value="CPPFLAGS=&quot;${env.CPPFLAGS}&quot;"/>
297 <else>
298 <property name="cppflags.arg" value=" "/>
299 </else>
300 </if>
301
302 <if><bool><isset property="env.CXXFLAGS"/></bool>
303 <property name="cxxflags.arg" value="CXXFLAGS=&quot;${env.CXXFLAGS}&quot;"/>
304 <else>
305 <property name="cxxflags.arg" value=" "/>
306 </else>
307 </if>
308
309 <if><bool><isset property="env.LDFLAGS"/></bool>
310 <property name="ldflags.arg" value="LDFLAGS=&quot;${env.LDFLAGS}&quot;"/>
311 <else>
312 <property name="ldflags.arg" value=" "/>
313 </else>
314 </if>
315
316 <if><bool><isset property="env.PATH"/></bool>
317 <property name="path.arg" value="PATH=&quot;${env.PATH}&quot;"/>
318 <else>
319 <property name="path.arg" value=" "/>
320 </else>
321 </if>
322
323 <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
324 <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${env.PKG_CONFIG_PATH}&quot;"/>
325 <else>
326 <property name="pcpath.arg" value=" "/>
327 </else>
328 </if>
329
[23611]330 <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
331 <if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
332 <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${env.DYLD_LIBRARY_PATH}&quot;"/>
333 <else>
334 <property name="ldlpath.arg" value=" "/>
335 </else>
336 </if>
[23599]337 <else>
[23611]338 <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
339 <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${env.LD_LIBRARY_PATH}&quot;"/>
340 <else>
341 <property name="ldlpath.arg" value=" "/>
342 </else>
343 </if>
344 </else>
[23599]345 </if>
346 </else>
[22868]347 </if>
[23611]348 <property name="allargs" value="${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${path.arg} ${ldlpath.arg} ${pcpath.arg}"/>
[22868]349
[22184]350 <condition property="gs2.opt.args" value= " " else="--disable-mg --disable-mgpp --disable-accentfold --disable-gdbm --disable-sqlite">
351 <istrue value="${with.jni}"/>
352 </condition>
353 <condition property="gs2.compile.target" value="with-jni" else="without-jni">
354 <istrue value="${with.jni}"/>
355 </condition>
356 <condition property="gs2.install.target" value="install-with-jni" else="install-without-jni">
357 <istrue value="${with.jni}"/>
358 </condition>
359 <condition property="gs2.windows.enablejni" value="1" else="0">
360 <istrue value="${with.jni}"/>
361 </condition>
[22976]362 <condition property="gs2.windows.enablemg" value="1" else="0">
363 <istrue value="${with.jni}"/>
364 </condition>
365 <condition property="gs2.windows.enablemgpp" value="1" else="0">
366 <istrue value="${with.jni}"/>
367 </condition>
368 <!-- Should accent folding not also be set here ?? -->
369 <condition property="gs2.windows.usegdbm" value="1" else="0">
370 <istrue value="${with.jni}"/>
371 </condition>
372 <condition property="gs2.windows.usesqlite" value="1" else="0">
373 <istrue value="${with.jni}"/>
374 </condition>
[19931]375
[15799]376 <!-- where is search4j tool -->
[20085]377 <condition property="search4j.exec" value="bin/search4j.exe" else="bin/search4j">
[15799]378 <isset property="current.os.iswindows"/>
[15136]379 </condition>
380
[15799]381
[15124]382 <!-- ============= Base dirs for each package and component ============ -->
383 <property name="src.gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
384 <property name="anttasks.home" value="${src.home}/org/greenstone/anttasks"/>
385 <property name="gli.home" value="${basedir}/gli"/>
386 <property name="javagdbm.home" value="${src.packages.home}/javagdbm"/>
387
[21347]388 <condition property="common.src.home" value="${basedir}/common-src" else="${gs2build.home}${file.separator}common-src">
[20464]389 <istrue value="${disable.collection.building}"/>
[19871]390 </condition>
[19931]391
392 <property name="build.src.home" value="${gs2build.home}/build-src"/>
[19871]393 <property name="gdbm.home" value="${common.src.home}/packages/gdbm"/>
394 <property name="mg.home" value="${common.src.home}/indexers/mg"/>
395 <property name="mgpp.home" value="${common.src.home}/indexers/mgpp"/>
396 <property name="lucene.home" value="${common.src.home}/indexers/lucene-gs"/>
397
[15799]398 <!-- ==================== Compilation Control Options ==================== -->
[15124]399
[15799]400 <!--
[15124]401
402 These properties control option settings on the Javac compiler when it
403 is invoked using the <javac> task.
404
405 compile.debug Should compilation include the debug option?
406
407 compile.deprecation Should compilation include the deprecation option?
408
409 compile.optimize Should compilation include the optimize option?
410
[15799]411 -->
[15124]412
413 <property name="compile.debug" value="true"/>
414 <property name="compile.deprecation" value="true"/>
415 <property name="compile.optimize" value="true"/>
416
[15799]417 <!--
[15124]418
419 Rather than relying on the CLASSPATH environment variable, Ant includes
420 features that makes it easy to dynamically construct the classpath you
421 need for each compilation. The example below constructs the compile
422 classpath to include the servlet.jar file, as well as the other components
423 that Tomcat makes available to web applications automatically, plus anything
424 that you explicitly added.
425
[15799]426 -->
[20079]427
428 <!-- All elements that Tomcat 5 exposes to applications -->
429 <path id="tomcat5">
[20085]430 <pathelement location="${catalina.home}/common/classes"/>
431 <fileset dir="${catalina.home}/common/endorsed">
432 <include name="*.jar"/>
433 </fileset>
434 <fileset dir="${catalina.home}/common/lib">
435 <include name="*.jar"/>
436 </fileset>
437 <!-- seems to be empty, but will leave in just in case some people make use of this to customise their install: -->
438 <pathelement location="${catalina.home}/shared/classes"/>
439 <fileset dir="${catalina.home}/shared/lib">
440 <include name="*.jar"/>
441 </fileset>
[20079]442 </path>
443
[25131]444 <!-- All elements that Tomcat 7 exposes to applications -->
445 <path id="tomcat7">
[20085]446 <fileset dir="${catalina.home}/lib">
447 <include name="*.jar"/>
448 </fileset>
[20079]449 </path>
450
[15124]451 <path id="compile.classpath">
452 <!-- Include all jar files and libraries in our jni lib directory -->
453 <pathelement location="${lib.jni}"/>
454 <fileset dir="${lib.jni}">
455 <include name="*.jar"/>
456 </fileset>
457 <!-- Include all jar files in our web lib directory -->
458 <pathelement location="${web.lib}"/>
459 <fileset dir="${web.lib}">
460 <include name="*.jar"/>
461 </fileset>
462
[18110]463 <pathelement location="${lib.java}"/>
464 <fileset dir="${lib.java}">
465 <include name="*.jar"/>
466 </fileset>
[15124]467
468 <!-- include the jar files from the source packages -->
469 <!-- mg and mgpp get installed into lib/jni but they may not be there yet
470 so we add them in by name -->
[22184]471 <!-- *** is there any way to make this optional, based on ${with.jni}? -->
[15124]472 <pathelement location="${lib.jni}/mg.jar"/>
473 <pathelement location="${lib.jni}/mgpp.jar"/>
474
[20085]475 <!-- Include all elements that Tomcat exposes to applications -->
476 <path refid="tomcat${tomcat.version.major}"/>
477
[15124]478 </path>
479
480 <path id="local.tomcat.classpath">
481 <!-- explicitly include the jni java wrappers in the classpath -->
482 <pathelement location="${lib.jni}"/>
483 <fileset dir="${lib.jni}">
484 <include name="*.jar"/>
485 </fileset>
[25095]486
487 <pathelement location="${web.lib}"/>
488 <fileset dir="${web.lib}">
489 <include name="derby.jar"/>
490 </fileset>
[15124]491 </path>
492
493 <path id="local.tomcat.path">
494 <pathelement location="${basedir}/bin/script"/>
495 <pathelement location="${basedir}/bin"/>
496 <pathelement location="${lib.jni}"/>
497 <pathelement path="${env.PATH}"/>
498 <pathelement path="${env.Path}"/>
499 <pathelement path="${wn.home}/bin"/>
500 </path>
501
502 <target name="test-setup">
503 <echo>ant java version=${ant.java.version}</echo>
504 <echo>is unix : ${current.os.isunix}</echo>
505 <echo>is mac : ${current.os.ismac}</echo>
506 <echo>is unixnotmac : ${current.os.isunixnotmac}</echo>
507 <echo>is windows : ${current.os.iswindows}</echo>
508 <echo>os.unix: ${os.unix}</echo>
509 </target>
[20085]510
[15799]511 <!-- ==================== Primary and Global Targets ============================= -->
[15124]512
[19873]513 <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]514 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.">
515
516 <!-- make sure .sh files are executable -->
517 <chmod dir="${basedir}" perm="ugo+rx"
518 includes="*.sh"/>
519 <chmod dir="${basedir}/bin/script" perm="ugo+rx"
520 includes="*.sh,*.pl"/>
521 </target>
[16936]522
[19871]523 <!-- 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]524 <target name="install" depends="init,install-common-src,install-collection-building,install-runtime"
[19843]525 description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare new-install'."/>
526
[19931]527 <target name="install-common-src" depends="init"
528 description="Install (configure, compile, install) only the common-src package (shared code from Greenstone 2). " >
[19894]529 <antcall target="configure-common-src"/>
530 <antcall target="compile-common-src"/>
531 <antcall target="install-auxiliary-jar-files"/>
532 <antcall target="install-jni-files"/>
533 </target>
[19878]534
[19894]535 <target name="install-collection-building" depends="init" if="collection.building.enabled"
536 description="Install (configure, compile, install) the Greenstone 2 collection building package." >
537 <antcall target="configure-collection-building"/>
[19931]538 <antcall target="tweak-makefiles" />
[19894]539 <antcall target="compile-collection-building"/>
540 </target>
541
[19878]542
[20209]543 <target name="install-runtime" depends="init,configure,configure-packages,configure-core,compile-web,compile-packages,compile-core,compile-classpath-jars"
[19878]544 description="Install (configure, compile, install) the runtime system. Needs either common-src or collection-building to have been installed first." />
545
546 <target name="svnupdate" depends="init,svnupdate-packages,svnupdate-core,svnupdate-common-src,svnupdate-collection-building,svnupdate-web"
[15124]547 description="Do a `svn update` for all sources. Doesn't recompile the code. You need to be online to run this."/>
548
549 <target name="configure" depends="init,configure-tomcat,configure-web"
[23855]550 description="Configure the installation (not the C++ code). Includes setting up config files. Should be re-run if you change the build.properties file, including if you change the port number."/>
[15124]551
[20209]552 <target name="clean" depends="init,clean-packages,clean-core,clean-common-src,clean-collection-building,clean-classpath-jars"
[19878]553 description="Remove all old compiled code. Includes runtime and collection-building if necessary"/>
[15124]554
[20209]555 <target name="distclean" depends="init,distclean-packages,clean-core,distclean-common-src,distclean-collection-building,clean-classpath-jars"
[19878]556 description="Remove all compiled code and also any Makefiles etc generated during configure-c++. Includes runtime and collection-building as necessary"/>
[15799]557
[19878]558 <target name="update" depends="init,svnupdate,clean,install"
559 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]560
[23854]561
562 <target name="perl-for-building" depends="init">
563 <!-- uses perl.path if set in build.properties, otherwise try for
564 environment variable PERLPATH, and failing that assumes 'perl'
565 is on environment PATH -->
[23856]566 <!-- if, outside build.properties, we only set perl.path if we have gs2build/build-src (collection building), then we won't set perl.path in a (flax) binary, since it doesn't have build-src -->
[23857]567 <if><bool><available file="${gs2build.home}"/></bool>
[23854]568
569 <if><bool><not><isset property="perl.path"/></not></bool>
570
571 <if>
572 <bool>
573 <and>
574 <isset property="env.PERLPATH"/>
575 <not><equals arg1="${env.PERLPATH}" arg2=""/></not>
576 </and>
577 </bool>
578 <property name="perl.path" value="${env.PERLPATH}"/>
579 <else>
580 <echo>
[23896]581 Using PATH environment variable to locate Perl.
[23854]582 </echo>
583 <exec executable="which" os="${os.unix}" spawn="false" outputproperty="full.perl.path">
584 <arg value="perl" />
585 </exec>
586
[23941]587 <exec executable="${gs2build.home}/bin/windows/which" os="${os.windows}" spawn="false" outputproperty="full.perl.path">
588 <arg value="perl" />
589 </exec>
[23896]590
[25640]591 <stringutil string="${full.perl.path}" property="partial.perl.path">
592 <replace regex="\/[^\/]*$" replacement="/" />
[23854]593 </stringutil>
[25640]594 <stringutil string="${partial.perl.path}" property="perl.path">
595 <replace regex="\\[^\\]*$" replacement="\\" />
596 </stringutil>
[23896]597 <if><bool><istrue value="${current.os.isunix}"/></bool>
598
599 <if><bool><not><equals arg1="${full.perl.path}" arg2="/usr/bin/perl"/></not></bool>
600 <echo>
[23854]601 Non-standard location of Perl found: ${full.perl.path}
602 Set the environment variable PERLPATH or the perl.path property in
603 build.properties to explicitly control the version of Perl used.
[23896]604 </echo>
605 </if>
[23854]606 </if>
607 </else>
608 </if>
609 </if>
610
611 <!-- full.perl.path is for pretty-printing only, e.g. used in target "start" -->
612 <if><bool><isset property="perl.path"/></bool>
613 <property name="full.perl.path" value="${perl.path}${file.separator}perl"/>
614 <else>
615 <property name="full.perl.path" value="perl (will use the enviroment variable PATH to find this executable)"/>
616 </else>
617 </if>
[23857]618
619 <!-- gs2build not available, perl.path -->
620 <else>
621 <property name="perl.path" value=""/>
622 </else>
623 </if>
[23854]624 </target>
625
[25549]626 <target name="get-default-servlet-url">
627 <echo>http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}</echo>
628 </target>
629
[23854]630 <target name="start" depends="init,configure-web,start-tomcat"
[15124]631 description="Startup the Tomcat server." >
[15799]632 <echo>${app.name} (${app.version}) server running using Apache Tomcat and Java</echo>
[16936]633 <echo>Tomcat: ${catalina.home}</echo>
634 <echo>Java : ${java.home}</echo>
[23849]635 <if><bool><available file="${build.src.home}"/></bool>
636 <echo>Perl : ${full.perl.path}</echo>
637 </if>
[23936]638 <if><bool><isset property="install.flax"/></bool>
639 <property name="url" value="http://${tomcat.server}:${tomcat.port}${app.path}/flax"/>
640 <else>
641 <property name="url" value="http://${tomcat.server}:${tomcat.port}${app.path}/"/>
642 </else>
643 </if>
644 <echo>URL : ${url}</echo>
[15799]645 <!-- assuming that index.html is not needed here -->
[26033]646
647 <!--Now write out the url with oaiserver suffix as the baseURL property in OAIConfig.xml-->
648 <available file="${web.classes}/OAIConfig.xml" property="oaiconfig.present"/>
649 <antcall target="init-oaiconfig">
650 <param name="url" value="${url}"/>
651 </antcall>
[15124]652 </target>
653
[26033]654 <target name="init-oaiconfig" if="oaiconfig.present">
655 <echo>Writing out baseURL ${url}oaiserver to ${web.classes}/OAIConfig.xml</echo>
656 <rsr file="${web.classes}/OAIConfig.xml" pattern="&lt;baseURL&gt;.*&lt;/baseURL&gt;" replacement="&lt;baseURL&gt;${url}oaiserver&lt;/baseURL&gt;" />
657 </target>
658
[15124]659 <target name="stop" depends="init,stop-tomcat"
660 description="Shutdown the Tomcat server."/>
661
662 <target name="restart" description="Shutdown and restart Tomcat" depends="init,stop,start"/>
663
664
[15799]665 <!-- =========== Help targets =================================== -->
[15124]666
667 <property name="install-command" value="ant [options] prepare install"/>
668
669 <target name="usage" description="Print a help message">
670 <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
671 <echo message=" Execute 'ant -help' for Ant help."/>
[23849]672 <echo>
673 To install Greenstone3, run '${install-command}'.
674 There are properties defined in build.properties. The install
675 process will ask you if these properties are set correctly.
676 To avoid this prompt, use the '-Dproperties.accepted=yes'
677 option.
678 To log the output, use the '-logfile build.log' option.
679 The README.txt file has more information about the ant targets
680 and install process.
[15124]681 </echo>
682 </target>
683
684 <target name="help" depends="usage" description="Print a help message"/>
685
686 <target name="debug" depends="init" description="Display all the currently used properties">
687 <echoproperties/>
688 </target>
689
[15799]690 <!-- ====== initialization and setup targets ================== -->
[15124]691
692 <target name="accept-properties" unless="properties.accepted">
693 <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]694 tomcat.server=${tomcat.server}
695 tomcat.port=${tomcat.port}
696 tomcat.installed.path=${tomcat.installed.path} (this is the location of Tomcat's base dir if it is already installed)
697 proxy.host=${proxy.host}
698 proxy.port=${proxy.port}
[19878]699 disable.collection.building=${disable.collection.building}
[19910]700 If these are not acceptable, please change them and rerun this target. Continue [y/n]?
[15124]701 </input>
702 <condition property="do.abort">
703 <equals arg1="n" arg2="${properties.ok}"/>
704 </condition>
705 <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
706 </target>
[20085]707
[15124]708 <!-- this sets up some initial properties -->
709 <target name="init">
710
[20085]711 <!-- has the gs3-setup script been run?? -->
712 <condition property="gs3-setup-not-done">
713 <not>
714 <isset property="env.GSDL3HOME"/>
715 </not>
716 </condition>
717
[20092]718 <!--<fail if="gs3-setup-not-done" message="please run 'gs3-setup' (Windows) or 'source gs3-setup.sh' (Linux/Mac) before running this target."/>-->
[20085]719
[15124]720 <condition property="java.too.old">
721 <or>
[16936]722 <equals arg1="1.1" arg2="${ant.java.version}"/>
723 <equals arg1="1.2" arg2="${ant.java.version}"/>
724 <equals arg1="1.3" arg2="${ant.java.version}"/>
[15124]725 </or>
726 </condition>
[20208]727 <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
[15124]728
729 <available file="${basedir}/gli" property="gli.present"/>
[19878]730 <available file="${basedir}/common-src" property="common.src.present"/>
[15124]731 <available file="${basedir}/gs2build" property="gs2build.present"/>
732
733 <condition property="tomcat.islocal">
734 <or>
[16936]735 <not><isset property="tomcat.installed.path"/></not>
736 <equals arg1="" arg2="${tomcat.installed.path}"/>
[15124]737 </or>
738 </condition>
739
[15799]740 <echo>tomcat.port = ${tomcat.port}</echo>
[15124]741
742 <condition property="proxy.present">
743 <and>
[16936]744 <isset property="proxy.host"/>
745 <not><equals arg1="" arg2="${proxy.host}"/></not>
[15124]746 </and>
747 </condition>
748
[20235]749 <!--
[20290]750 the next block checks if the bundled tomcat is present in the 'packages' directory,
[25131]751 and checks for the lethal combination of tomcat 7 and java 1.4. Test for
[20290]752 tomcat6 is based on the presence of a file inserted by greenstone into the tomcat6
753 download, as there is no other surefire way to check tomcat version under java 1.4
[20235]754 -->
755 <condition property="packages.tomcat.ispresent" value="true" else="false">
756 <available file="packages/tomcat"/>
757 </condition>
[25131]758 <condition property="packages.tomcat.istomcat7" value="true" else="false">
759 <available file="packages/tomcat/tomcat7.txt"/>
[20290]760 </condition>
[20235]761 <if>
762 <bool>
[20290]763 <and>
764 <istrue value="${packages.tomcat.ispresent}"/>
[25131]765 <istrue value="${packages.tomcat.istomcat7}"/>
[20290]766 <equals arg1="1.4" arg2="${ant.java.version}"/>
767 </and>
[20235]768 </bool>
[20290]769 <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]770 </if>
771
[15124]772 </target>
773
774 <target name="setup-proxy" depends="init" if="proxy.present">
775 <condition property="ask.user">
776 <or>
[16936]777 <equals arg1="" arg2="${proxy.user}"/>
778 <equals arg1="" arg2="${proxy.password}"/>
[15124]779 </or>
780 </condition>
[19878]781
[15124]782 <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}" userproperty="proxy.username" pwordproperty="proxy.password"/>
783 <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
784 </target>
785
[15799]786 <!-- ========== Web app Targets ================================ -->
787
[20089]788 <target name="prepare-web" depends="init">
[15124]789 <mkdir dir="${web.home}/applet"/>
790 <mkdir dir="${web.home}/logs"/>
[25446]791 <mkdir dir="${web.home}/logs/tmp"/>
[15124]792 </target>
793
[24607]794 <!-- 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.
795 The test for whether we need it assumes we won't be trying to compile GS3 against Java versions less than 1.4. -->
[15124]796 <target name="configure-java-version" depends="init"
[15139]797 description="Activates or deactivates some jar libraries as needed depending on your java version">
[15136]798
[15799]799 <available property="have.xalan.jar" file="${web.lib}/xalan.jar"/>
[15124]800 <condition property="need.xalan.jar">
[15799]801 <or>
[24607]802 <not><equals arg1="1.4" arg2="${ant.java.version}"/></not>
[15799]803 </or>
804 </condition>
[15136]805
[15799]806 <!-- if they have xalan.jar but dont need it -->
807 <if>
808 <bool>
[16936]809 <and>
810 <isset property="have.xalan.jar"/>
811 <not><isset property="need.xalan.jar"/></not>
812 </and>
[15799]813 </bool>
814 <antcall target="deactivate-xalan-jar"/>
815 </if>
[15136]816
[15799]817 <!-- if they need xalan.jar but dont have it -->
818 <if>
819 <bool>
[16936]820 <and>
821 <not><isset property="have.xalan.jar"/></not>
822 <isset property="need.xalan.jar"/>
823 </and>
[15799]824 </bool>
825 <antcall target="activate-xalan-jar"/>
826 </if>
[15136]827
[15124]828 </target>
829
[15139]830 <target name="activate-xalan-jar">
[15799]831 <echo>activating xalan.jar</echo>
[15124]832 <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/>
[20085]833 <if>
834 <bool>
835 <and>
836 <isset property="current.os.ismac"/>
837 <available file="${catalina.home}/common/endorsed" type="dir"/>
838 </and>
839 </bool>
840 <copy file="${web.lib}/xalan.jar.tmp" tofile="${catalina.home}/common/endorsed/xalan.jar"/>
[15799]841 </if>
[15124]842 </target>
[15035]843
[15139]844 <target name="deactivate-xalan-jar">
[15799]845 <echo>deactivating xalan.jar</echo>
[15124]846 <delete file="${web.lib}/xalan.jar"/>
[20089]847 <!-- should we be deleting common/endorsed/xalan.jar on mac?? -->
[15124]848 </target>
849
[15837]850
[25491]851 <target name="prepare-collections" depends="init"
852 description="Unpack all the collections from their svn zipped versions">
[16936]853 <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
[17008]854 <property name="index.zip" value="index.zip"/>
[15799]855
[16936]856 <echo message="installing collections..."/>
857 <antcall target="gs2mgdemo-install"/>
858 <antcall target="gs2mgppdemo-install"/>
859 <antcall target="gberg-install"/>
[25214]860 <antcall target="lucene-jdbm-demo-install"/>
[16936]861 </target>
[15837]862
[16936]863 <target name="gs2mgdemo-prepare" if="collect.dir">
864 <property name="gs2mgdemo.dir" value="${collect.dir}/gs2mgdemo"/>
[15799]865
[16936]866 <condition property="gs2mgdemo.present">
867 <and>
[15837]868 <available file="${gs2mgdemo.dir}/${index.zip}"/>
[16936]869 </and>
870 </condition>
871 </target>
[15799]872
[17008]873 <target name="gs2mgdemo-install" if="gs2mgdemo.present" depends="gs2mgdemo-prepare">
874 <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${index.zip}" />
[16936]875 <echo>collection gs2mgdemo installed</echo>
876 </target>
[15799]877
[16936]878 <target name="gs2mgppdemo-prepare" if="collect.dir">
879 <property name="gs2mgppdemo.dir" value="${collect.dir}/gs2mgppdemo"/>
[15837]880
[16936]881 <condition property="gs2mgppdemo.present">
882 <and>
[15837]883 <available file="${gs2mgppdemo.dir}/${index.zip}"/>
[16936]884 </and>
885 </condition>
886 </target>
[15799]887
[16936]888 <target name="gs2mgppdemo-install" if="gs2mgppdemo.present" depends="gs2mgppdemo-prepare">
[17008]889 <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${index.zip}" />
[16936]890 <echo>collection gs2mgppdemo installed</echo>
891 </target>
[15799]892
[16936]893 <target name="gberg-prepare" if="collect.dir">
894 <property name="gberg.dir" value="${collect.dir}/gberg"/>
[17008]895 <available file="${gberg.dir}/index/${index.zip}" property="gberg.present"/>
[16936]896 </target>
[15799]897
[16936]898 <target name="gberg-install" if="gberg.present" depends="gberg-prepare">
[19878]899 <unzip dest="${gberg.dir}/index" src="${gberg.dir}/index/${index.zip}"/>
[16936]900 <echo>collection gberg installed</echo>
901 </target>
[15799]902
[25214]903 <target name="lucene-jdbm-demo-prepare" if="collect.dir">
904 <property name="lucene-jdbm-demo.dir" value="${collect.dir}/lucene-jdbm-demo"/>
[25491]905 <available file="${lucene-jdbm-demo.dir}/${index.zip}" property="lucene-jdbm-demo.present"/>
[25214]906 </target>
907
908 <target name="lucene-jdbm-demo-install" if="lucene-jdbm-demo.present" depends="lucene-jdbm-demo-prepare">
[25491]909 <unzip dest="${lucene-jdbm-demo.dir}" src="${lucene-jdbm-demo.dir}/${index.zip}"/>
[25214]910 <echo>collection lucene-jdbm-demo installed</echo>
911 </target>
912
[23854]913 <target name="configure-web" depends="init,perl-for-building"
[15124]914 description="Configure only the web app config files">
915 <!-- we want a unix path in the global.properties file -->
916 <pathconvert targetos="unix" property="src.gsdl3.home.unix">
917 <path path="${web.home}"/>
918 </pathconvert>
[24868]919 <stringutil string="${perl.path}" property="escaped.perl.path">
920 <replace regex="\\" replacement="\\\\" />
921 </stringutil>
922
[25830]923 <filter token="gsdlhome" value="${gs2build.home}"/>
924 <filter token="gsdl3srchome" value="${basedir}"/>
[15124]925 <filter token="gsdl3home" value="${src.gsdl3.home.unix}"/>
926 <filter token="gsdl3version" value="${app.version}"/>
927 <filter token="tomcat.server" value="${tomcat.server}"/>
928 <filter token="tomcat.port" value="${tomcat.port}"/>
[24868]929 <filter token="perlpath" value="${escaped.perl.path}"/>
[25570]930 <filter token="disable.collection.building" value="${disable.collection.building}"/>
[25830]931 <copy file="${basedir}/web/WEB-INF/cgi/gsdl3site.cfg.in" tofile="${basedir}/web/WEB-INF/cgi/gsdl3site.cfg" filtering="true" overwrite="true"/>
[15124]932 <copy file="${basedir}/resources/java/global.properties.in" tofile="${web.classes}/global.properties" filtering="true" overwrite="true"/>
933 <copy file="${basedir}/resources/java/log4j.properties.in" tofile="${web.classes}/log4j.properties" filtering="true" overwrite="true"/>
934 <chmod file="${web.classes}/global.properties" perm="600"/>
935 <chmod file="${web.classes}/log4j.properties" perm="600"/>
936 </target>
937
938 <target name="compile-web" depends="init">
939 <javac srcdir="${web.classes}"
940 destdir="${web.classes}"
941 debug="${compile.debug}"
942 deprecation="${compile.deprecation}"
943 optimize="${compile.optimize}">
[16936]944 <classpath><path refid="compile.classpath"/></classpath>
[15124]945 </javac>
946 </target>
947
[20209]948 <target name="compile-classpath-jars" depends="init">
949 <if><bool><available file="admin/cp.mf"/></bool>
950 <jar destfile="admin/cp.jar" manifest="admin/cp.mf"/>
951 </if>
952 <if><bool><available file="${lib.java}/cp.mf"/></bool>
953 <jar destfile="${lib.java}/cp.jar" manifest="${lib.java}/cp.mf"/>
954 </if>
955 <if><bool><available file="${lib.jni}/cp.mf"/></bool>
956 <jar destfile="${lib.jni}/cp.jar" manifest="${lib.jni}/cp.mf"/>
957 </if>
958 <if><bool><available file="${web.lib}/cp.mf"/></bool>
959 <jar destfile="${web.lib}/cp.jar" manifest="${web.lib}/cp.mf"/>
960 </if>
961 <jar destfile="cp.jar">
962 <manifest>
[20211]963 <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]964 </manifest>
965 </jar>
966 </target>
967
968 <target name="clean-classpath-jars" depends="init">
969 <delete file="admin/cp.jar"/>
970 <delete file="${lib.java}/cp.jar"/>
971 <delete file="${lib.jni}/cp.jar"/>
972 <delete file="${web.lib}/cp.jar"/>
973 <delete file="cp.jar"/>
974 </target>
975
976
[15799]977 <target name="svnupdate-web" unless="nosvn.mode">
[20930]978 <exec executable="svn">
979 <arg value="update"/>
980 <arg value="${web.home}"/>
981 <arg value="-r"/><arg value="${branch.revision}"/>
982 </exec>
[15799]983 </target>
[15124]984
985 <target name="update-web" depends="init,svnupdate-web,configure-web"
986 description="update only the web stuff (config files)"/>
987
[15799]988 <!-- ======================= Tomcat Targets ========================== -->
[15124]989
990 <!-- this target downloads and installs Tomcat -->
[25131]991 <!-- we download tomcat (version 7 for Java 1.5 and later, version 5 for Java 1.4 plus the 1.4 compatibility package). -->
[20089]992 <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal"
[25131]993 description="downloads the appropriate version of Tomcat (Tomcat 5 if using Java 1.4, Tomcat 7 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/7 then you need to run prepare-tomcat">
994 <if>
[16951]995 <bool>
996 <not><available file="${packages.home}/tomcat/.flagfile"/></not>
997 </bool>
998
999 <!-- check that packages dir is there -->
1000 <mkdir dir="${packages.home}"/>
1001 <get src="http://www.greenstone.org/gs3files/${tomcat.version}.zip"
1002 dest="${packages.home}/${tomcat.version}.zip"
1003 usetimestamp="true"/>
1004 <unzip src="${packages.home}/${tomcat.version}.zip"
1005 dest="${packages.home}"/>
[20085]1006
1007 <!-- If we are using Java 1.4, we'd be using tomcat 5.5 in which case
1008 we would need to have the tomcat compat package to work with Java 1.4-->
1009 <if>
1010 <bool><equals arg1="1.4" arg2="${ant.java.version}"/></bool>
1011 <get src="http://www.greenstone.org/gs3files/${tomcat.version}-compat.zip"
1012 dest="${packages.home}/${tomcat.version}-compat.zip"
1013 usetimestamp="true"/>
1014 <unzip src="${packages.home}/${tomcat.version}-compat.zip"
1015 dest="${packages.home}"/>
1016 </if>
1017
[16951]1018 <!-- delete any existing tomcat -->
1019 <delete dir="${packages.home}/tomcat"/>
1020 <move todir="${packages.home}/tomcat">
1021 <fileset dir="${packages.home}/${tomcat.version}"/>
1022 </move>
[25133]1023 <!--
[16951]1024 <copy file="${basedir}/resources/tomcat/setclasspath.bat"
1025 tofile="${packages.home}/tomcat/bin/setclasspath.bat"
1026 overwrite="true"/>
1027 <copy file="${basedir}/resources/tomcat/setclasspath.sh"
1028 tofile="${packages.home}/tomcat/bin/setclasspath.sh"
1029 overwrite="true"/>
[25133]1030 -->
[16951]1031 <!-- make sure we have execute permission for the .sh files -->
1032 <chmod dir="${packages.home}/tomcat/bin" perm="ugo+rx"
1033 includes="*.sh"/>
1034
1035 <echo file="${packages.home}/tomcat/.flagfile">
1036 the timestamp of this file is the time that tomcat was extracted from the zip files.
1037 it is used to figure out whether the files need to be refreshed or not in `ant prepare-tomcat`
1038 </echo>
1039
[20089]1040 <!-- this is not strictly a prepare tomcat thing, but if one changes
1041 Java, then they need to change tomcat as well, so might as well call
1042 it here -->
1043 <antcall target="configure-java-version"/>
[16951]1044 <else>
1045 <echo>Tomcat has been prepared, will not prepare</echo>
1046 <echo>Delete ${packages.home}/tomcat/.flagfile to force refresh</echo>
1047 </else>
1048
1049 </if>
1050
[15124]1051 </target>
1052
1053 <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/>
1054
[25570]1055 <target name="configure-tomcat-local" depends="init,perl-for-building" if="tomcat.islocal">
[15124]1056 <!-- re-setup the server.xml file -->
[20079]1057 <copy file="${basedir}/resources/tomcat/server_tomcat${tomcat.version.major}.xml"
1058 tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true">
[15124]1059 <filterset>
[16936]1060 <filter token="port" value="${tomcat.port}"/>
1061 <filter token="shutdown-port" value="${tomcat.shutdown.port}"/>
[15124]1062 </filterset>
1063 </copy>
1064 <!-- set up the greenstone3 context -->
1065 <copy file="${basedir}/resources/tomcat/greenstone3.xml" tofile="${packages.home}/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true">
1066 <filterset>
[16936]1067 <filter token="gsdl3webhome" value="${web.home}"/>
[22320]1068 <filter token="privilegedattribute" value ="${privileged.attribute}"/>
[15124]1069 </filterset>
1070 </copy>
[25570]1071
1072 <!-- set up the greenstone3 web.xml file -->
1073 <copy file="${basedir}/resources/tomcat/web.xml" tofile="${packages.home}/tomcat/conf/web.xml" overwrite="true">
1074 <filterset>
1075 <filter token="perlpath" value="${perl.path}"/>
1076 </filterset>
1077 </copy>
[15124]1078 </target>
1079
1080 <target name="configure-tomcat-external" depends="init" unless="tomcat.islocal">
1081 <!-- re-setup the server.xml file -->
1082 <!-- need to edit the config file, or do we get the user to do this???-->
1083 </target>
[22551]1084
[23854]1085
1086
[22551]1087<!-- Another way: http://ptrthomas.wordpress.com/2006/03/25/how-to-start-and-stop-tomcat-from-ant/ -->
[20089]1088 <target name="start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
[15799]1089 <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
[15124]1090 <property name="tomcat.path" refid="local.tomcat.path"/>
1091 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
[25095]1092
1093 <echo file="${catalina.home}/bin/setenv.bat">set CLASSPATH=${tomcat.classpath}</echo>
1094 <echo file="${catalina.home}/bin/setenv.sh">export CLASSPATH=${tomcat.classpath}</echo>
1095
[21351]1096 <exec executable="${catalina.home}/bin/startup.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
[15124]1097 <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
1098 <env key="GSDL3HOME" value="${basedir}"/>
1099 <env key="PATH" path="${tomcat.path}"/>
1100 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
1101 <env key="CATALINA_HOME" value="${catalina.home}"/>
1102 <env key="CLASSPATH" path="${tomcat.classpath}"/>
1103 <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
[22184]1104 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here these days ??-->
[15124]1105 <env key="WNHOME" path="${wn.home}"/>
1106 </exec>
[25616]1107 <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
[15124]1108 <env key="GSDLOS" value="windows"/>
1109 <env key="GSDL3HOME" value="${basedir}"/>
1110 <env key="Path" path="${tomcat.path}"/>
1111 <env key="PATH" path="${tomcat.path}"/>
1112 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
[16628]1113 <env key="CATALINA_HOME" value="${catalina.home}"/>
[15124]1114 <env key="CLASSPATH" path="${tomcat.classpath}"/>
1115 </exec>
1116 <!-- wait for the server to startup in case other targets need it running -->
1117 <waitfor maxwait="5" maxwaitunit="second">
1118 <and>
[16936]1119 <socket server="${tomcat.server}" port="${tomcat.port}"/>
1120 <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
[15124]1121 </and>
1122 </waitfor>
1123 </target>
1124
[22551]1125 <!--ant task http: http://www.jajakarta.org/ant/ant-1.6.1/docs/ja/manual/api/org/apache/tools/ant/taskdefs/condition/Http.html-->
1126 <target name="reconfigure" description="Reconfigure the message router">
1127 <waitfor maxwait="5" maxwaitunit="second">
1128 <http url="http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}?a=s&amp;sa=c"/>
1129 </waitfor>
1130 </target>
1131
1132 <!--Command-line args to Ant: http://www.jguru.com/faq/view.jsp?EID=471794-->
1133 <target name="reconfigure-collection" description="Reconfigure the collection">
1134 <waitfor maxwait="5" maxwaitunit="second">
1135 <http url="http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}?a=s&amp;sa=c&amp;sc=${collection}"/>
1136 </waitfor>
1137 </target>
1138
[15124]1139 <!-- windows: do we want to launch a webrowser?? -->
[25418]1140 <!-- shouldn't this test whether anything is running first?
1141 It's safer to always attempt to stop tomcat: that way we won't be dependent on the right time
1142 to check whether the server is stopped or still running before attempting to start again.
1143 This target, which was recently called force-stop-tomcat for a while but is back to being
1144 called stop-tomcat, now hides the Java exception output that appears whenever tomcat is already
1145 stopped as happens when stop-tomcat is called consecutively. -->
[25420]1146 <target name="force-stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
[21351]1147 <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
[15124]1148 <env key="CATALINA_HOME" value="${catalina.home}"/>
[25418]1149 <arg line=">/dev/null 2>&amp;1"/>
[15124]1150 </exec>
[21351]1151 <exec executable="${catalina.home}/bin/shutdown.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false">
[16628]1152 <env key="CATALINA_HOME" value="${catalina.home}"/>
[25418]1153 <arg line=">nul 2>&amp;1"/>
[25443]1154 </exec>
[15124]1155 </target>
1156
[25418]1157 <!-- Can also try the "socket" condition in place of the "http" condition
1158 And also use a <waitfor> in place of <condition>, such as:
1159 <waitfor maxwait="5" maxwaitunit="second" timeoutproperty="tomcat.isstopped"><http url="..."/></waitfor>
[25420]1160 The http URL resolves to host:port/greenstone3
1161 Condition uses <http/> rather than <socket/> for testing, since if the server was stopped, the socket
1162 might still be in use for some moments. We test the URL with the http condition since it's likelier to
1163 fail sooner if the server has indeed been stopped. -->
[25418]1164 <target name="check-tomcat-running">
1165 <condition property="tomcat.isrunning">
1166 <http url="http://${tomcat.server}:${tomcat.port}${app.path}"/>
1167 </condition>
[25321]1168 </target>
1169
[25443]1170 <!-- stop-tomcat checks if the tomcat server is already running. If it appears to be running
1171 (regardless of whether tomcat was just starting to shut down), this target calls force-stop-tomcat
1172 to issue the shutdown command to tomcat. Then it waits for at most 15 seconds for the server to
1173 actually stop by checking the socket at which tomcat listens every second, printing a warning
1174 at the end of the max wait time of 15 seconds if tomcat was still running. -->
1175 <target name="stop-tomcat" description="Shutdown only Tomcat if running" depends="check-tomcat-running" if="tomcat.isrunning">
[25321]1176 <antcall target="force-stop-tomcat"/>
[25443]1177
1178 <property name="wait.numchecks" value="15"/>
1179 <echo>Waiting for the server to shutdown... (${wait.numchecks} seconds max)</echo>
1180 <waitfor maxwait="${wait.numchecks}" maxwaitunit="second" checkevery="1" checkeveryunit="second" timeoutproperty="tomcat.timedout">
[25444]1181 <not><socket server="${tomcat.server}" port="${tomcat.port}"/></not>
[25443]1182 </waitfor>
1183
1184 <if>
1185 <bool>
1186 <isset property="${tomcat.timedout}"/>
1187 </bool>
1188 <property name="tomcat.isrunning" value="true"/>
1189 <echo>WARNING: Checked the socket ${wait.numchecks} times, but port ${tomcat.port} is still busy.</echo>
1190 <else>
1191 <echo>Tomcat is stopped.</echo>
1192 <property name="tomcat.isrunning" value="false"/>
1193 </else>
1194 </if>
[25420]1195 </target>
[25321]1196
[15124]1197 <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/>
1198
1199 <target name="setup-catalina-ant-tasks">
1200 <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
1201 <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
1202 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1203 <taskdef name="list" classname="org.apache.catalina.ant.ListTask"
1204 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1205 <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"
1206 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1207 <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
1208 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1209 <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"
1210 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1211 <taskdef name="start" classname="org.apache.catalina.ant.StartTask"
1212 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1213 <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"
1214 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1215 <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
1216 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1217 </target>
1218
[25449]1219 <!-- http://blog.andrewbeacock.com/2007/11/how-to-truncate-log-file-using-ubuntu.html
1220 Doing "cat </dev/null > packages/tomcat/logs/catalina.out" doesn't work as an ant target.
1221 It seems to have a problem with cat or </dev/null, with or without the < sign. -->
1222 <target name="clean-logs" description="Empties catalina.out, greenstone.log and contents of web/logs/tmp">
[26002]1223 <echo>Truncating catalina.out, greenstone.log and server.log, and emptying ${web.home}/logs/tmp</echo>
[25449]1224 <exec executable="truncate" os="${os.unix}" dir="${catalina.home}/logs" spawn="false">
1225 <arg value="-s0"/>
1226 <arg value="catalina.out"/>
1227 </exec>
1228 <exec executable="truncate" os="${os.unix}" dir="${web.home}/logs" spawn="false">
1229 <arg value="-s0"/>
1230 <arg value="greenstone.log"/>
1231 </exec>
[26002]1232 <exec executable="truncate" os="${os.unix}" dir="${web.home}/logs" spawn="false">
1233 <arg value="-s0"/>
1234 <arg value="server.log"/>
1235 </exec>
[15124]1236
[25449]1237 <exec executable="cmd" os="${os.windows}" dir="${catalina.home}/logs" spawn="false">
1238 <arg line="/c echo. > catalina.out"/>
1239 </exec>
1240 <exec executable="cmd" os="${os.windows}" dir="${web.home}/logs" spawn="false">
1241 <arg line="/c echo. > greenstone.log"/>
1242 </exec>
[26002]1243 <exec executable="cmd" os="${os.windows}" dir="${web.home}/logs" spawn="false">
1244 <arg line="/c echo. > server.log"/>
1245 </exec>
[25449]1246
[25501]1247 <if>
1248 <bool><available file="${web.home}/logs/tmp" type="dir"/></bool>
1249 <delete>
1250 <fileset dir="${web.home}/logs/tmp" includes="**/*"/>
1251 </delete>
1252 </if>
[25449]1253 </target>
1254
[15799]1255 <!-- ======================= ant Targets ============================ -->
[15124]1256 <target name="prepare-ant" depends="init">
[16951]1257 <if>
1258 <bool>
1259 <not><available file="${packages.home}/ant/.flagfile"/></not>
1260 </bool>
1261
1262 <get src="http://www.greenstone.org/gs3files/apache-ant-1.7.0-bin.zip"
1263 dest="${packages.home}/apache-ant-1.7.0-bin.zip"
1264 usetimestamp="true"/>
1265 <unzip src="${packages.home}/apache-ant-1.7.0-bin.zip"
1266 dest="${packages.home}"/>
1267 <move todir="${packages.home}/ant">
1268 <fileset dir="${packages.home}/apache-ant-1.7.0"/>
1269 </move>
1270 <echo file="${packages.home}/ant/.flagfile">
1271 the timestamp of this file is the time that ant was extracted from the zip files.
1272 it is used to figure out whether the files need to be refreshed or not in `ant prepare-ant`
1273 </echo>
1274
1275 <else>
1276 <echo>Ant has been prepared, will not prepare</echo>
1277 <echo>Delete ${packages.home}/ant/.flagfile to force refresh</echo>
1278 </else>
1279
1280 </if>
[15124]1281 </target>
1282
[25338]1283 <!-- ======================= Admin Targets ============================ -->
1284
1285 <!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it.
1286 See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant
1287 But you can do: echo mypassword | ant config-admin -->
1288 <target name="config-admin" description="Reset admin password">
1289 <input addproperty="admin.password" defaultvalue="admin" message="New admin password (3-8 characters):&gt;">
1290 <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen -->
1291 </input>
[25343]1292 <!--<echo>PWD: ${admin.password}</echo>-->
[25338]1293 <antcall target="update-userdb">
1294 <param name="user.username" value="admin"/>
1295 <param name="user.password" value="${admin.password}"/>
1296 <param name="user.groups" value=""/>
1297 <param name="user.status" value=""/>
1298 <param name="user.comment" value="Password updated."/>
1299 <param name="user.email" value=""/>
1300 </antcall>
1301 </target>
1302
1303 <target name="config-user" description="Add or modify users" depends="get-user-data,update-userdb"/>
1304
1305 <target name="get-user-data" description="Get user details">
1306 <input addproperty="user.username" message="Username:&gt;"/>
1307 <input addproperty="user.password" defaultvalue="" message="Password (3-8 characters):&gt;">
1308 <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen -->
1309 </input>
1310 <input addproperty="user.groups" defaultvalue="" message="Groups (comma-separated list):&gt;"/>
1311 <input addproperty="user.status" defaultvalue="true" message="Enabled (true/false):&gt;"/>
1312 <input addproperty="user.comment" defaultvalue="" message="Comment:&gt;"/>
1313 <input addproperty="user.email" defaultvalue="" message="Email:&gt;"/>
1314 </target>
1315
1316<!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it.
1317 See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant
1318 But you can do: echo mypassword | ant config-admin -->
[25418]1319 <target name="update-userdb" description="Add or modify users" depends="check-tomcat-running">
1320
1321 <!-- stop tomcat if running, since derby db is embedded and only allows connections from one jvm instance at a time
1322 See http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html
1323 The ${tomcat.isrunning} property is set by the depends-target "check-tomcat-running" -->
[25338]1324 <if>
1325 <bool>
1326 <istrue value="${tomcat.isrunning}"/>
1327 </bool>
[25418]1328 <antcall target="stop-tomcat"/>
[25338]1329 </if>
1330
1331 <!--<echo>${admin.password}</echo>--> <!-- for testing -->
1332 <java classname="org.greenstone.gsdl3.util.ModifyUsersDB">
1333 <classpath refid="compile.classpath"/> <!--for ${web.lib}/gsdl3.jar and supporting files-->
1334 <arg file="${web.home}/sites/localsite/etc/usersDB"/>
1335 <arg value="${user.username}"/>
1336 <arg value="password=${user.password}"/>
1337 <arg value="groups=${user.groups}"/>
1338 <arg value="status=${user.status}"/>
1339 <arg value="comment=${user.comment}"/>
1340 <arg value="email=${user.email}"/>
1341 </java>
1342
1343 <!-- run tomcat again if it used to be running -->
1344 <if>
1345 <bool>
1346 <istrue value="${tomcat.isrunning}"/>
1347 </bool>
1348 <antcall target="start-tomcat"/>
1349 </if>
1350 </target>
1351
1352
[20079]1353 <!-- ======================= Axis Targets ============================ -->
1354
[15124]1355 <target name="prepare-axis" depends="init">
[16951]1356
1357 <if>
1358 <bool>
1359 <not><available file="${packages.home}/axis/.flagfile"/></not>
1360 </bool>
1361
1362 <get src="http://www.greenstone.org/gs3files/${axis.zip.version}"
1363 dest="${packages.home}/${axis.zip.version}"
1364 usetimestamp="true"/>
1365 <unzip src="${packages.home}/${axis.zip.version}"
1366 dest="${packages.home}"/>
1367 <move todir="${packages.home}/axis">
1368 <fileset dir="${packages.home}/${axis.dir.version}"/>
1369 </move>
1370 <!-- install axis into greenstone web app -->
1371 <copy todir="${web.lib}">
1372 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/lib">
1373 <include name="*.jar"/>
1374 </fileset>
1375 </copy>
1376 <copy todir="${web.home}">
1377 <fileset dir="${packages.home}/axis/webapps/axis/">
1378 <include name="*.jsp"/>
1379 <include name="*.jws"/>
1380 </fileset>
1381 </copy>
1382 <copy tofile="${web.home}/axis.html" file="${packages.home}/axis/webapps/axis/index.html"/>
1383 <copy todir="${web.classes}">
1384 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/classes">
1385 <include name="*.properties"/>
1386 </fileset>
1387 </copy>
1388 <echo file="${packages.home}/axis/.flagfile">
1389 the timestamp of this file is the time that axis was extracted from the zip files.
1390 it is used to figure out whether the files need to be refreshed or not in `ant prepare-axis`
1391 </echo>
1392
1393 <else>
1394 <echo>Axis has been prepared, will not prepare</echo>
1395 <echo>Delete ${packages.home}/axis/.flagfile to force refresh</echo>
1396 </else>
1397
1398 </if>
[15124]1399 </target>
1400
[15229]1401 <target name="soap-deploy-site" depends="init,get-sitename,get-siteuri,get-webservices,create-deployment-files,deploy-site"
[15124]1402 description="Deploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."/>
[15799]1403
1404 <target name="deploy-site">
[15124]1405 <java classname="org.apache.axis.client.AdminClient">
1406 <classpath refid="compile.classpath"/>
1407 <arg value="-l"/>
1408 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
[15229]1409 <arg file="${basedir}/resources/soap/deploy.wsdd"/>
1410 </java>
1411 <delete file="${basedir}/resources/soap/deploy.wsdd"/> <!--clean up, no longer used-->
[15124]1412 </target>
1413
[15229]1414 <target name="soap-undeploy-site" depends="get-undeploy-service-name"
[15124]1415 description="Undeploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work.">
[15229]1416 <filter token="servicesname" value="${axis.undeploy.servicename}"/>
1417 <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
1418 tofile="${basedir}/resources/soap/undeploy.wsdd"
1419 filtering="true"
1420 overwrite="true"/>
[15124]1421 <java classname="org.apache.axis.client.AdminClient">
1422 <classpath refid="compile.classpath"/>
1423 <arg value="-l"/>
1424 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
[15229]1425 <arg file="${basedir}/resources/soap/undeploy.wsdd"/>
[15124]1426 </java>
[15229]1427 <delete file="${basedir}/resources/soap/undeploy.wsdd"/> <!--clean up, no longer used-->
[15799]1428 </target>
[15124]1429
[16936]1430 <!-- this target used to deploy the default web service SOAPServer (base.webservice.name) on the localsite server
1431 with the default servicename of localsite-->
[15124]1432 <target name="deploy-localsite" depends="init"
1433 description="Deploy the SOAP server for localsite. Will start and stop Tomcat.">
1434 <antcall target="start-tomcat"/>
[15235]1435 <echo>Deploying ${base.webservice.name} web services for localsite under service name: localsite</echo>
[15229]1436 <antcall target="create-deployment-files">
1437 <param name="axis.sitename" value="localsite"/>
[15235]1438 <param name="axis.servicesname" value="${base.webservice.name}"/>
[15229]1439 <param name="axis.siteuri" value="localsite"/>
1440 </antcall>
[15124]1441 <antcall target="deploy-site">
1442 <param name="axis.sitename" value="localsite"/>
[15235]1443 <param name="axis.servicesname" value="${base.webservice.name}"/>
[15229]1444 <param name="axis.siteuri" value="localsite"/>
[15124]1445 </antcall>
[15369]1446 <echo>The Greenstone server has been started up. If you do not want it running, please type: ant stop.</echo>
[15124]1447 </target>
[15799]1448
[16936]1449 <target name="get-sitename" unless="axis.sitename">
[15229]1450 <input addproperty="axis.sitename" defaultvalue="localsite">What site do you want to deploy services for?
[15235]1451Press Enter for default:localsite</input>
[15124]1452 </target>
1453
[15229]1454 <target name="get-undeploy-service-name" unless="axis.undeploy.servicename">
1455 <input addproperty="axis.undeploy.servicename" defaultvalue="localsite">Please enter the full name of the service you wish to undeploy.
1456To find out which web services you've got deployed, point your browser to http://HOST:PORT/greenstone3/services
[20209]1457Or press Enter for undeploying the default:localsite /&gt;</input>
[15229]1458 <echo>Name of service to undeploy: ${axis.undeploy.servicename}</echo>
[15124]1459 </target>
1460
[15229]1461 <target name="get-webservices" unless="axis.servicesname">
[15235]1462 <input addproperty="axis.servicesname" defaultvalue="${base.webservice.name}">Which set of web services do you want to deploy?
[15229]1463Choose from: ${web.services.list}
[20209]1464Or press Enter for default:${base.webservice.name} /&gt;</input>
[15229]1465 <echo>${axis.servicesname}</echo>
1466 </target>
1467
1468 <target name="get-siteuri" depends="get-sitename,get-webservices" unless="axis.siteuri">
[15235]1469 <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]1470 <echo>Site: ${axis.sitename}, services: ${axis.servicesname}, servicesname: ${axis.siteuri}</echo>
1471 </target>
1472
1473 <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">
1474 <condition property="soap.method" value="provider='java:MSG' style='message' use='literal'">
[15235]1475 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
[15124]1476 </condition>
[15229]1477
1478 <!--everything else defaults to java:RPC at present-->
1479 <condition property="soap.method" value="provider='java:RPC'">
1480 <not>
[15235]1481 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
[15229]1482 </not>
1483 </condition>
[16936]1484 </target>
[15799]1485
[16936]1486 <target name="create-deployment-files" depends="set-soapmethod" if="axis.sitename">
[15124]1487 <filter token="sitename" value="${axis.sitename}"/>
1488 <filter token="siteuri" value="${axis.siteuri}"/>
[15229]1489 <filter token="servicesname" value="${axis.servicesname}"/>
1490 <filter token="soapmethod" value="${soap.method}"/>
[15124]1491 <copy file="${basedir}/resources/soap/site.wsdd.template"
[15229]1492 tofile="${basedir}/resources/soap/deploy.wsdd"
1493 filtering="true"
1494 overwrite="true"/>
[15124]1495 <!-- create the java files and compile them -->
[15229]1496 <copy file="${basedir}/resources/java/${axis.servicesname}.java.in"
1497 tofile="${src.gsdl3.home}/${axis.servicesname}${axis.sitename}.java"
1498 filtering="true"
1499 overwrite="true"/>
[15124]1500 <mkdir dir="${build.home}"/>
1501 <javac srcdir="${src.home}"
1502 destdir="${build.home}"
1503 debug="${compile.debug}"
1504 deprecation="${compile.deprecation}"
1505 optimize="${compile.optimize}">
1506 <classpath refid="compile.classpath"/>
[15229]1507 <include name="org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.java" />
[15124]1508 </javac>
1509 <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
[15799]1510 <copy file="${build.home}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
1511 tofile="${web.classes}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
1512 overwrite="true" />
[15124]1513 </target>
[15799]1514
[15124]1515
[15799]1516 <!-- ====================== Core targets ============================== -->
1517 <!-- core targets refer to the core gsdl3 java src -->
[15124]1518
[19878]1519 <target name="prepare-core"/>
[15124]1520
1521 <target name="configure-core"/>
1522
1523 <target name="update-core" depends="init,svnupdate-core,clean-core,compile-core"
1524 description="Update only the Greenstone core" />
1525
[15799]1526 <target name="svnupdate-core" unless="nosvn.mode">
[20930]1527 <exec executable="svn">
1528 <arg value="update"/>
1529 <arg value="${basedir}"/>
1530 <arg value="-r"/><arg value="${branch.revision}"/>
1531 </exec>
[15124]1532 </target>
1533
1534 <target name="clean-core"
1535 description="Clean only the Greenstone core">
[19878]1536 <!-- should this delete the gsdl3.jar from web/WEB-INF?? -->
[15124]1537 <delete dir="${build.home}"/>
1538 </target>
1539
[15799]1540 <target name="compile-core" depends="init"
[15124]1541 description="Compile only the Greenstone core">
1542 <mkdir dir="${build.home}"/>
[25131]1543
[23803]1544 <if><bool><isset property="with.jni"/></bool>
1545 <javac srcdir="${src.home}"
1546 destdir="${build.home}"
1547 debug="${compile.debug}"
1548 deprecation="${compile.deprecation}"
1549 optimize="${compile.optimize}">
1550 <classpath>
1551 <path refid="compile.classpath"/>
1552 </classpath>
1553 </javac>
1554 <else>
1555 <property name="gsprefix" value=""/>
1556 <javac srcdir="${src.home}"
1557 destdir="${build.home}"
1558 debug="${compile.debug}"
1559 deprecation="${compile.deprecation}"
1560 optimize="${compile.optimize}">
1561 <classpath>
1562 <path refid="compile.classpath"/>
1563 </classpath>
1564 <exclude name="org/greenstone/gsdl3/service/GS2MGPPRetrieve.java"/>
1565 <exclude name="org/greenstone/gsdl3/service/GS2MGPPSearch.java"/>
1566 <exclude name="org/greenstone/gsdl3/service/GS2MGSearch.java"/>
1567 <exclude name="org/greenstone/gsdl3/service/GS2MGRetrieve.java"/>
1568 <exclude name="org/greenstone/gsdl3/service/GoogleNgramMGPPSearch.java"/>
1569 <exclude name="org/greenstone/gsdl3/service/PhindPhraseBrowse.java"/>
1570 <exclude name="org/greenstone/gsdl3/util/GDBMWrapper.java"/>
1571 </javac>
1572 </else>
1573 </if>
[15124]1574 <jar destfile="${build.home}/gsdl3.jar">
1575 <fileset dir="${build.home}">
[16936]1576 <include name="org/greenstone/gsdl3/**"/>
[15124]1577 <include name="org/flax/**"/>
[16936]1578 <exclude name="**/Test.class"/>
[15124]1579 </fileset>
1580 <manifest>
[16936]1581 <attribute name="Built-By" value="${user.name}" />
[15124]1582 </manifest>
1583 </jar>
1584 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
[22101]1585
1586 <jar destfile="${build.home}/gutil.jar">
1587 <fileset dir="${build.home}">
1588 <include name="org/greenstone/util/**"/>
1589 </fileset>
1590 <manifest>
1591 <attribute name="Built-By" value="${user.name}" />
1592 </manifest>
1593 </jar>
1594 <copy file="${build.home}/gutil.jar" todir="${web.lib}"/>
1595
[15124]1596 <!-- copy the localsite server in case we need it -->
[15235]1597 <copy file="${build.home}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" tofile="${web.classes}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" />
[15124]1598
[17918]1599 <!-- Greenstone Administrator Interface -->
[15124]1600 <jar destfile="${build.home}/GAI.jar">
1601 <fileset dir="${build.home}">
[16936]1602 <include name="org/greenstone/admin/**"/>
[15124]1603 </fileset>
1604 <manifest>
[16936]1605 <attribute name="Built-By" value="${user.name}" />
[15124]1606 </manifest>
1607 </jar>
[17917]1608 <copy file="${build.home}/GAI.jar" todir="${web.lib}"/>
[18124]1609 <copy file="${build.home}/GAI.jar" todir="${admin.dir}"/>
[15124]1610 <jar destfile="${build.home}/phind.jar">
1611 <fileset dir="${build.home}">
[16936]1612 <include name="org/greenstone/applet/phind/**"/>
[15124]1613 </fileset>
1614 <manifest>
[16936]1615 <attribute name="Built-By" value="${user.name}" />
[15124]1616 </manifest>
1617 </jar>
1618 <mkdir dir="${web.applet}"/>
1619 <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
1620 <!-- phind also needs xercesImpl.jar and xml-apis.jar to be in web/applet -->
[18515]1621 <if>
1622 <bool><istrue value="${tomcat.islocal}"/></bool>
[20085]1623 <copy file="${web.lib}/xercesImpl.jar" todir="${web.applet}"/>
1624 <copy file="${web.lib}/xml-apis.jar" todir="${web.applet}"/>
[18515]1625 </if>
1626
1627
[17116]1628 <!-- skip anttasks for now
[15124]1629 <jar destfile="${build.home}/anttasks.jar">
1630 <fileset dir="${build.home}">
[16936]1631 <include name="org/greenstone/anttasks/**"/>
[15124]1632 </fileset>
1633 <manifest>
[16936]1634 <attribute name="Built-By" value="${user.name}" />
[15124]1635 </manifest>
1636 </jar>
[17116]1637 <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>-->
[15124]1638 <jar destfile="${build.home}/gsdl3test.jar">
1639 <fileset dir="${build.home}">
[16936]1640 <include name="org/greenstone/gsdl3/**/*Test.class"/>
1641 <include name="org/greenstone/testing/**"/>
[15124]1642 </fileset>
1643 <manifest>
[16936]1644 <attribute name="Built-By" value="${user.name}" />
[15124]1645 </manifest>
1646 </jar>
1647 <jar destfile="${build.home}/server.jar">
1648 <fileset dir="${build.home}">
[16936]1649 <include name="org/greenstone/server/**"/>
[22634]1650 <include name="org/greenstone/util/**"/>
[15124]1651 </fileset>
1652 <fileset file="${basedir}/resources/java/server.properties"/>
1653 <manifest>
[16936]1654 <attribute name="Built-By" value="${user.name}"/>
[15124]1655 </manifest>
1656 </jar>
1657 <copy file="${build.home}/server.jar" todir="${basedir}"/>
1658 </target>
[15799]1659
1660 <!-- ================== Packages targets ================================ -->
[15124]1661 <!-- these targets refer to the greenstone source packages - these need
1662 updating less often, so are in separate targets to the core -->
[19871]1663 <target name="prepare-packages" depends="init"/>
[15124]1664
1665 <target name="update-packages" depends="init,svnupdate-packages,configure-packages,clean-packages,compile-packages"
1666 description="Update only the source packages"/>
1667
[15799]1668 <target name="svnupdate-packages" unless="nosvn.mode">
[20930]1669 <exec executable="svn">
1670 <arg value="update"/>
1671 <arg value="${src.packages.home}"/>
1672 <arg value="-r"/><arg value="${branch.revision}"/>
1673 </exec>
[15124]1674 </target>
[19931]1675
[15124]1676
[19871]1677 <target name="configure-packages" depends="init,configure-javagdbm"
[15124]1678 description="Configure only the packages."/>
1679
[22184]1680 <target name="configure-javagdbm" if="with.jni">
[15124]1681 <echo>
1682 Configuring JavaGDBM
1683 </echo>
[18417]1684
[19904]1685 <exec executable="${javagdbm.home}/configure" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
[15124]1686 <arg value="--prefix=${basedir}"/>
1687 <arg value="--libdir=${lib.jni}"/>
[19873]1688 <arg value="--with-gdbm=${gdbm.home}"/>
[15124]1689 </exec>
1690 </target>
1691
[19871]1692 <target name="clean-packages" depends="init,clean-javagdbm" description="Clean only the packages"/>
[15124]1693
1694 <target name="clean-javagdbm" depends="init">
[26082]1695 <if><bool><available file="${javagdbm.home}/Makefile"/></bool>
[15124]1696 <exec executable="make" os="${os.unix}"
[19904]1697 dir="${javagdbm.home}" failonerror="true">
[15124]1698 <arg value="clean"/>
1699 </exec>
[26082]1700 </if>
[15124]1701 </target>
1702
[19871]1703 <target name="distclean-packages" depends="init,distclean-javagdbm" description="Distclean only the packages"/>
[15185]1704
[15799]1705 <target name="distclean-javagdbm" depends="init">
[26079]1706 <if><bool><available file="${javagdbm.home}/Makefile"/></bool>
[15799]1707 <exec executable="make" os="${os.unix}"
[19904]1708 dir="${javagdbm.home}" failonerror="true">
[15799]1709 <arg value="distclean"/>
1710 </exec>
[26079]1711 </if>
[15799]1712 </target>
1713
1714 <target name="compile-packages" description="Compile only the source packages">
[22184]1715 <!-- javagdbm -->
1716 <antcall target="compile-javagdbm"/>
1717 <!-- Search4j -->
1718 <antcall target="compile-search4j"/>
1719 </target>
1720
1721 <target name="compile-javagdbm" description="Compile JavaGDBM" if="with.jni">
[15799]1722
[19878]1723 <!-- unix: -->
[15799]1724 <echo>compile javagdbm</echo>
[19904]1725 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true"/>
1726 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
[15799]1727 <arg value="install"/>
1728 </exec>
[15098]1729
[23852]1730 <!-- windows: Calling without the "compile" argument first will run winMake.bat with
1731 "all" which will then perform both the compile AND link targets in jni/win32.mak
1732 (thereby also generating gdbmjava.dll). Then we run the same command with
1733 the "install" argument to copy the gdbmjava.dll into the correct location. -->
[23849]1734 <echo>Windows: compile javagdbm</echo>
[24076]1735 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}" failonerror="true">
1736 <env key="GSDL3SRCHOME" path="${basedir}"/>
[23852]1737 </exec>
1738 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}" failonerror="true">
[24076]1739 <env key="GSDL3SRCHOME" path="${basedir}"/>
[23847]1740 <arg value="install"/>
[15799]1741 </exec>
[15124]1742
[15799]1743 <!-- install the jar file -->
[23847]1744 <echo>Install the javagdbm jar file ${javagdbm.home}/javagdbm.jar ${lib.jni}</echo>
[15799]1745 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
1746 </target>
1747
[17491]1748 <target name="compile-search4j">
[17509]1749
[19996]1750 <!-- windows -->
[19997]1751 <if><bool><istrue value="${current.os.iswindows}"/></bool>
[19996]1752 <exec executable="nmake" dir="${src.packages.home}/search4j" failonerror="true">
1753 <arg value="/f"/>
1754 <arg value="win32.mak"/>
1755 <arg value='BINDIR="${basedir}\bin"'/>
1756 </exec>
1757 <exec executable="nmake" dir="${src.packages.home}/search4j" failonerror="true">
1758 <arg value="/f"/>
1759 <arg value="win32.mak"/>
1760 <arg value="install"/>
1761 <arg value='BINDIR="${basedir}\bin"'/>
1762 </exec>
[17509]1763
[19996]1764 <!-- unix -->
[19997]1765 <else><if><bool><istrue value="${current.os.isunix}"/></bool>
[19996]1766 <exec executable="${src.packages.home}/search4j/configure" dir="${src.packages.home}/search4j" failonerror="true">
1767 <arg value="--bindir=${basedir}/bin"/>
1768 <arg value="${static.arg}"/>
1769 </exec>
1770 <exec executable="make" dir="${src.packages.home}/search4j" failonerror="true"/>
1771 <exec executable="make" dir="${src.packages.home}/search4j" failonerror="true">
1772 <arg value="install"/>
1773 </exec>
[17509]1774
[19996]1775 <!-- else warn -->
1776 <else>
1777 <fail>this target does not support the current os</fail>
[17509]1778
[19996]1779 </else></if></else></if>
1780
[17491]1781 </target>
1782
[19871]1783 <target name="install-auxiliary-jar-files" depends="init">
[22184]1784
1785 <if>
1786 <bool><available file="${mg.home}/mg.jar"/></bool>
1787 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
1788 </if>
1789
1790 <if>
[22199]1791 <bool><available file="${mgpp.home}/mgpp.jar"/></bool>
[22184]1792 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
1793 </if>
1794
[24744]1795 <copy file="${lucene.home}/LuceneWrapper3.jar" todir="${web.lib}"/>
[19871]1796 </target>
1797
[22976]1798 <target name="install-jni-files" depends="init" if="with.jni">
1799 <antcall target="install-jni-files-linux"/>
1800 <antcall target="install-jni-files-windows"/>
1801 <antcall target="install-jni-files-macos"/>
1802 </target>
[15124]1803
[15799]1804 <target name="install-jni-files-linux" depends="init" if="current.os.isunixnotmac">
[15124]1805 <copy file="${mg.home}/jni/libmgretrievejni.so" todir="${lib.jni}"/>
1806 <copy file="${mg.home}/jni/libmgsearchjni.so" todir="${lib.jni}"/>
[15799]1807 <copy file="${mg.home}/jni/libmgpassjni.so" todir="${lib.jni}"/>
[15124]1808 <copy file="${mgpp.home}/jni/libmgppretrievejni.so" todir="${lib.jni}"/>
1809 <copy file="${mgpp.home}/jni/libmgppsearchjni.so" todir="${lib.jni}"/>
[15799]1810 <copy file="${mgpp.home}/jni/libmgpppassjni.so" todir="${lib.jni}"/>
1811 </target>
1812 <target name="install-jni-files-windows" depends="init" if="current.os.iswindows">
[15124]1813 <copy file="${mg.home}/jni/mgretrievejni.dll" todir="${lib.jni}"/>
1814 <copy file="${mg.home}/jni/mgsearchjni.dll" todir="${lib.jni}"/>
[15799]1815 <copy file="${mg.home}/jni/mgpassjni.dll" todir="${lib.jni}"/>
[15124]1816 <copy file="${mgpp.home}/jni/mgppretrievejni.dll" todir="${lib.jni}"/>
1817 <copy file="${mgpp.home}/jni/mgppsearchjni.dll" todir="${lib.jni}"/>
[15799]1818 <copy file="${mgpp.home}/jni/mgpppassjni.dll" todir="${lib.jni}"/>
1819 </target>
1820 <target name="install-jni-files-macos" depends="init" if="current.os.ismac">
[15124]1821 <copy file="${mg.home}/jni/libmgretrievejni.jnilib" todir="${lib.jni}"/>
1822 <copy file="${mg.home}/jni/libmgsearchjni.jnilib" todir="${lib.jni}"/>
[15799]1823 <copy file="${mg.home}/jni/libmgpassjni.jnilib" todir="${lib.jni}"/>
[15124]1824 <copy file="${mgpp.home}/jni/libmgppretrievejni.jnilib" todir="${lib.jni}"/>
1825 <copy file="${mgpp.home}/jni/libmgppsearchjni.jnilib" todir="${lib.jni}"/>
[15799]1826 <copy file="${mgpp.home}/jni/libmgpppassjni.jnilib" todir="${lib.jni}"/>
1827 </target>
1828
[19871]1829 <!-- ========common-src targets =================================-->
1830 <!-- these are used to get common-src (for indexers, gdbm, sqlite etc) when
1831 collection building is not enabled -->
1832
1833 <target name="update-common-src" depends="init" if="collection.building.disabled">
1834 </target>
[19931]1835
[19871]1836 <target name="svnupdate-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
[20930]1837 <exec executable="svn">
1838 <arg value="update"/>
1839 <arg value="${common.src.home}"/>
1840 <arg value="-r"/><arg value="${branch.revision}"/>
1841 </exec>
[19871]1842 </target>
1843
[19878]1844 <target name="prepare-common-src" depends="init" if="collection.building.disabled" unless="common.src.present">
[19871]1845 <antcall target="checkout-common-src"/>
1846 <antcall target="unzip-windows-packages"/>
1847 </target>
1848
1849 <target name="checkout-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
1850 <echo>checking out common-src</echo>
[20930]1851 <exec executable="svn">
1852 <arg value="checkout"/>
[21196]1853 <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src"/>
[20930]1854 <arg value="common-src"/>
1855 <arg value="-r"/><arg value="${branch.revision}"/>
1856 </exec>
[19871]1857 </target>
1858
[19931]1859 <target name="configure-common-src" depends="init">
[19871]1860 <exec executable="${common.src.home}/configure" os="${os.unix}"
[19904]1861 dir="${common.src.home}" failonerror="true">
[19931]1862 <arg value="--prefix=${gs2build.home}"/> <!-- what value to use?? -->
[19933]1863 <arg value="--bindir=${gs2build.home}/bin/${os.bin.dir}"/> <!-- what value to use?? -->
[22184]1864 <arg line="${gs2.opt.args}"/>
[22854]1865 <arg line="${static.arg}"/>
[23611]1866 <arg line="${allargs}"/>
[19871]1867 </exec>
1868 </target>
1869
[19931]1870 <target name="clean-common-src" depends="init">
[19871]1871 <!-- unix: -->
[26082]1872 <if><bool><available file="${common.src.home}/Makefile"/></bool>
[19904]1873 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
[19871]1874 <arg value="clean"/>
1875 </exec>
[26082]1876 </if>
[19871]1877 <!-- windows: -->
[19904]1878 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
[19871]1879 <arg value="/f"/>
1880 <arg value="win32.mak"/>
1881 <arg value="clean"/>
[19960]1882 <arg value="GSDLHOME=${gs2build.home}"/>
[19871]1883 </exec>
1884 </target>
[19931]1885 <target name="distclean-common-src" depends="init">
[19960]1886 <!-- unix: -->
[26079]1887 <if><bool><available file="${common.src.home}/Makefile"/></bool>
[19904]1888 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
[19871]1889 <arg value="distclean"/>
1890 </exec>
[26079]1891 </if>
[19960]1892 <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
1893 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1894 <arg value="/f"/>
1895 <arg value="win32.mak"/>
1896 <arg value="clean"/>
1897 <arg value="GSDLHOME=${gs2build.home}"/>
1898 </exec>
[19871]1899 </target>
[19931]1900 <target name="compile-common-src" depends="init">
[19871]1901 <!-- unix: -->
[19904]1902 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
[22184]1903 <arg value="${gs2.compile.target}"/>
[19871]1904 </exec>
1905 <!-- windows: -->
[19904]1906 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
[19871]1907 <arg value="/f"/>
1908 <arg value="win32.mak"/>
[19934]1909 <arg value="GSDLHOME=${gs2build.home}"/>
[22184]1910 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
[22976]1911 <arg value="ENABLE_MG=${gs2.windows.enablemg}"/>
1912 <arg value="ENABLE_MGPP=${gs2.windows.enablemgpp}"/>
1913 <arg value="USE_GDBM=${gs2.windows.usegdbm}"/>
1914 <arg value="USE_SQLITE=${gs2.windows.usesqlite}"/>
[19871]1915 </exec>
1916 </target>
1917
[19843]1918 <!-- ======= collection-building targets ===========================-->
[15124]1919
[19843]1920 <target name="update-collection-building" if="collection.building.enabled"
[19931]1921 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]1922 description="Update (SVN update, configure, compile etc) only the collection building components"/>
[15124]1923
[19843]1924 <target name="svnupdate-collection-building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nosvn.mode"
1925 description="SVN update the collection building components">
1926 </target>
[15124]1927
[19843]1928 <target name="prepare-collection-building" depends="init,prepare-gs2build,prepare-gli" if="collection.building.enabled">
[15124]1929 </target>
1930
[19931]1931 <target name="configure-collection-building" depends="init,configure-build-src" if="collection.building.enabled"
1932 description="Configure the collection building components">
[19843]1933 </target>
[15098]1934
[19948]1935 <target name="clean-collection-building" depends="init,clean-gli,clean-build-src"
[19843]1936 description="Clean only the collection building components"
1937 if="collection.building.enabled"/>
[18495]1938
[19948]1939 <target name="distclean-collection-building" depends="init,clean-build-src,distclean-build-src"
[19843]1940 description="Distclean only the collection building components"
1941 if="collection.building.enabled"/>
1942
[19931]1943 <target name="compile-collection-building" depends="init,compile-build-src,compile-gli" if="collection.building.enabled"
[19843]1944 description="Compile only the collection building components">
[19931]1945 <!-- make install for common-src -->
1946 <!-- unix: -->
1947 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
[22184]1948 <arg value="${gs2.install.target}"/>
[19931]1949 </exec>
1950
1951 <!-- windows: -->
1952 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1953 <arg value="/f"/>
1954 <arg value="win32.mak"/>
[21370]1955 <arg value="install"/>
[23837]1956 <arg value="GSDLHOME=${gs2build.home}"/>
[22184]1957 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
[23837]1958 <arg value="ENABLE_MG=${gs2.windows.enablemg}"/>
1959 <arg value="ENABLE_MGPP=${gs2.windows.enablemgpp}"/>
1960 <arg value="USE_GDBM=${gs2.windows.usegdbm}"/>
1961 <arg value="USE_SQLITE=${gs2.windows.usesqlite}"/>
1962 <!--
1963 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
1964 <arg value="USE_SQLITE=0"/>--> <!-- why is this not on by default? -->
[19931]1965 </exec>
1966
1967 <!-- install gs2build indexers for windows -->
1968 <if>
1969 <bool><istrue value="${current.os.iswindows}"/></bool>
1970 <copy todir="${gs2build.home}/bin/windows">
1971 <fileset dir="${gs2build.home}/common-src/indexers/bin">
1972 <include name="*.*"/>
1973 </fileset>
1974 </copy>
1975 </if>
1976
1977 <!-- LuceneWrapper jar file not installed by default -->
1978 <mkdir dir="${gs2build.home}/bin/java"/>
[24744]1979 <copy file="${lucene.home}/LuceneWrapper3.jar" todir="${gs2build.home}/bin/java"/>
[19931]1980
[15124]1981 </target>
[19843]1982
1983 <!-- ============== gli targets ================================= -->
[15799]1984 <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nosvn.mode">
[19929]1985
[20930]1986 <exec executable="svn">
1987 <arg value="update"/>
1988 <arg value="${gli.home}"/>
1989 <arg value="-r"/><arg value="${branch.revision}"/>
1990 </exec>
1991
[21196]1992 <exec executable="svn" dir="web/WEB-INF/cgi">
[20930]1993 <arg value="export"/>
1994 <arg value="-r"/><arg value="${branch.revision}"/>
[25136]1995 <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/gliserver.pl"/>
[20930]1996 </exec>
[21196]1997 <exec executable="svn" dir="web/WEB-INF/cgi">
1998 <arg value="export"/>
1999 <arg value="-r"/><arg value="${branch.revision}"/>
[25136]2000 <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/gsdlCGI.pm"/>
[21196]2001 </exec>
[20930]2002
[15124]2003 </target>
2004
[19843]2005 <target name="prepare-gli" depends="init" if="collection.building.enabled" unless="gli.present">
[19911]2006 <!-- checkout -->
[23808]2007 <if><bool><and><not><istrue value="${nosvn.mode}"/></not><isset property="with.gli.and.gems"/></and></bool>
[19929]2008
[20930]2009 <exec executable="svn">
2010 <arg value="checkout"/>
[21196]2011 <arg value="${svn.root}/main/${branch.path}/gli"/>
[20930]2012 <arg value="-r"/><arg value="${branch.revision}"/>
2013 </exec>
2014
[21196]2015 <exec executable="svn" dir="web/WEB-INF/cgi">
[20930]2016 <arg value="export"/>
2017 <arg value="-r"/><arg value="${branch.revision}"/>
[25570]2018 <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/gliserver.pl"/>
[20930]2019 </exec>
[21196]2020 <exec executable="svn" dir="web/WEB-INF/cgi">
2021 <arg value="export"/>
2022 <arg value="-r"/><arg value="${branch.revision}"/>
[25570]2023 <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src/cgi-bin/gsdlCGI.pm"/>
[21196]2024 </exec>
[20930]2025
[19911]2026 </if>
[15124]2027 </target>
[19843]2028
2029 <target name="clean-gli" depends="init" if="collection.building.enabled">
2030 <!-- gli -->
2031 <property name="gli.home" value="${basedir}/gli"/>
2032 <!-- linux -->
2033 <exec executable="clean.sh" os="${os.unix}" dir="${gli.home}"
[20826]2034 resolveExecutable="true" failonerror="true"/>
[19843]2035 <!-- windows -->
2036 <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
[20826]2037 resolveExecutable="true" failonerror="true"/>
[19843]2038 </target>
2039
2040 <target name="compile-gli" depends="init" if="collection.building.enabled">
[23808]2041 <if><bool><isset property="with.gli.and.gems"/></bool>
[23807]2042 <!-- gli -->
2043 <property name="gli.home" value="${basedir}/gli"/>
[15098]2044
[23807]2045 <!-- linux -->
2046 <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
2047 <!--remote gli-->
2048 <exec executable="makejar.sh" os="${os.unix}" dir="${gli.home}"
2049 resolveExecutable="true" failonerror="true"/>
2050 <!-- windows -->
2051 <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
2052 <!--remote gli-->
2053 <exec executable="makejar.bat" os="${os.windows}" dir="${gli.home}"
2054 resolveExecutable="true" failonerror="true"/>
2055 <copy file="${gli.home}/GLIServer.jar" todir="${gs2build.home}/bin/java" />
2056 </if>
[19843]2057 </target>
[15124]2058
[19843]2059 <target name="gli" description="Run the Greenstone Librarian Interface" depends="init" if="collection.building.enabled">
[21351]2060 <exec executable="${basedir}/gli/gli.sh" os="${os.linux},${os.solaris}" dir="${basedir}/gli" spawn="true">
[19843]2061 <env key="gsdl3path" path="${basedir}"/>
[19871]2062 <env key="gsdlpath" path="${gs2build.home}"/>
[19843]2063 </exec>
[21351]2064 <exec executable="${basedir}/gli/gli.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
[19843]2065 <env key="gsdl3path" path="${basedir}"/>
[19871]2066 <env key="gsdlpath" path="${gs2build.home}"/>
[19873]2067 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.home}/lib"/>
[19843]2068 </exec>
[21351]2069 <exec executable="${basedir}/gli/gli.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
[19843]2070 <env key="GSDL3PATH" path="${basedir}"/>
[19871]2071 <env key="GSDLPATH" path="${gs2build.home}"/>
[19843]2072 </exec>
2073 <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.
2074 </echo>
2075 </target>
2076
2077 <!-- ================ gs2build targets =========================== -->
2078
2079 <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nosvn.mode">
2080 <echo>svn updating gs2build</echo>
[20930]2081 <exec executable="svn">
2082 <arg value="update"/>
2083 <arg value="${gs2build.home}"/>
2084 <arg value="-r"/><arg value="${branch.revision}"/>
2085 </exec>
[15799]2086 </target>
[19843]2087
[15124]2088 <target name="prepare-gs2build" depends="init" if="collection.building.enabled" unless="gs2build.present">
2089 <antcall target="checkout-gs2build"/>
2090 <antcall target="unzip-windows-packages"/>
2091 <antcall target="checkout-winbin"/>
2092 <antcall target="get-windows-binaries"/>
2093 <antcall target="delete-winbin"/>
2094 </target>
2095
[19843]2096 <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nosvn.mode">
2097 <echo>checking out gs2build</echo>
[20930]2098 <exec executable="svn">
2099 <arg value="checkout"/>
[21196]2100 <arg value="${svn.root}/main/${branch.path}/gs2build"/>
[20930]2101 <arg value="-r"/><arg value="${branch.revision}"/>
2102 </exec>
2103
[21196]2104
[19843]2105 </target>
2106
[15124]2107 <target name="checkout-winbin" depends="init" if="current.os.iswindows"
[15799]2108 unless="nosvn.mode">
[20930]2109
2110 <exec executable="svn">
2111 <arg value="checkout"/>
[21196]2112 <arg value="${svn.root}/main/${branch.path}/binaries/windows"/>
[20930]2113 <arg value="-r"/><arg value="${branch.revision}"/>
[21196]2114 <arg value="winbin"/>
[20930]2115 </exec>
2116
[15124]2117 </target>
2118
[15799]2119 <target name="update-winbin" depends="init" if="current.os.iswindows" unless="nosvn.mode">
[20930]2120 <exec executable="svn">
2121 <arg value="update"/>
2122 <arg value="winbin"/>
2123 <arg value="-r"/><arg value="${branch.revision}"/>
2124 </exec>
2125
[15799]2126 </target>
[15124]2127
2128 <target name="get-windows-binaries" depends="init" if="collection.building.enabled.windows">
2129 <move todir="${gs2build.home}/bin/windows" failonerror="false">
2130 <fileset dir="${basedir}/winbin/bin"/>
2131 </move>
2132 </target>
[19843]2133
[15124]2134 <target name="delete-winbin" depends="init" if="collection.building.enabled.windows">
2135 <delete dir="${basedir}/winbin"/>
2136 </target>
2137
[19871]2138 <target name="unzip-windows-packages" depends="init" if="current.os.iswindows">
2139 <unzip src="${common.src.home}/packages/windows/crypt/crypt.zip"
2140 dest="${common.src.home}/packages/windows/crypt"/>
[18179]2141 <untar compression="gzip"
[19871]2142 src="${common.src.home}/packages/sqlite/${sqlite.targz.version}"
2143 dest="${common.src.home}/packages/sqlite"/>
2144 <unzip src="${common.src.home}/indexers/packages/windows/iconv/iconv.zip"
2145 dest="${common.src.home}/indexers/packages/windows/iconv"/>
[15799]2146 </target>
[19878]2147
[15124]2148 <target name="gs2build-edit-setup-bat" if="collection.building.enabled.windows">
2149 <!-- we want a windows path in the setup.bat file -->
2150 <pathconvert targetos="windows" property="gs2build.home.windows">
2151 <path path="${gs2build.home}"/>
2152 </pathconvert>
2153 <move file="${gs2build.home}/setup.bat" tofile="${gs2build.home}/setup-tmp.bat">
2154 <filterset>
[16620]2155 <filter token="gsdlhome" value="${gs2build.home.windows}"/>
[15799]2156 </filterset>
[15124]2157 </move>
2158 <move file="${gs2build.home}/setup-tmp.bat" tofile="${gs2build.home}/setup.bat" />
2159 </target>
2160
[19843]2161
[19948]2162 <target name="clean-build-src" depends="init" if="collection.building.enabled">
[19871]2163 <!-- unix: -->
[26079]2164 <if><bool><available file="${build.src.home}/Makefile"/></bool>
[19948]2165 <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
[15124]2166 <arg value="clean"/>
2167 </exec>
[26079]2168 </if>
[15124]2169 <!-- windows: -->
[19948]2170 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
[15799]2171 <arg value="/f"/>
2172 <arg value="win32.mak"/>
2173 <arg value="clean"/>
[19960]2174 <arg value="GSDLHOME=${gs2build.home}"/>
[15124]2175 </exec>
2176 </target>
2177
[19948]2178
2179 <target name="distclean-build-src" depends="init,clean-build-src" if="collection.building.enabled">
[19960]2180 <!-- unix: -->
[26079]2181 <if><bool><available file="${build.src.home}/Makefile"/></bool>
[19948]2182 <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
[15124]2183 <arg value="distclean"/>
2184 </exec>
[26079]2185 </if>
[19960]2186 <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
2187 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
2188 <arg value="/f"/>
2189 <arg value="win32.mak"/>
2190 <arg value="clean"/>
2191 <arg value="GSDLHOME=${gs2build.home}"/>
2192 </exec>
[15124]2193 </target>
[19843]2194
[19931]2195 <target name="configure-build-src" depends="init" if="collection.building.enabled"
2196 description="Configure the build-src component">
2197 <exec executable="${build.src.home}/configure" os="${os.unix}"
2198 dir="${build.src.home}" failonerror="true">
2199 <arg value="--prefix=${gs2build.home}"/>
[23611]2200 <arg line="${gs2.opt.args} ${static.arg} ${allargs}"/>
[19931]2201 </exec>
2202 </target>
[19910]2203
[19931]2204 <!-- common-src is done separately and needs to be compiled first -->
2205 <target name="compile-build-src" depends="init" if="collection.building.enabled">
2206
2207 <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
[23611]2208 <arg line="${ldlpath.arg}"/>
[22845]2209 </exec>
2210
2211 <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
[19931]2212 <arg value="install"/>
2213 </exec>
[19910]2214
[19931]2215 <!-- run the setup script -->
[20826]2216 <!-- <exec executable="${compile.windows.c++.setup}" os="${os.windows}" failonerror="true"/>-->
[19910]2217 <!--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]2218 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
[19910]2219 <arg value="/f"/>
2220 <arg value="win32.mak"/>
[19934]2221 <arg value="GSDLHOME=${gs2build.home}"/>
[19910]2222 </exec>
[19931]2223 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
[19910]2224 <arg value="/f"/>
2225 <arg value="win32.mak"/>
2226 <arg value="install"/>
[19934]2227 <arg value="GSDLHOME=${gs2build.home}"/>
[19910]2228 </exec>
[15124]2229 </target>
2230
2231
[15799]2232 <!-- ======================== TESTING Targets ========================= -->
[15124]2233
2234 <target name="test" description="Run the (incomplete) JUnit test suite "
2235 depends="init">
2236 <mkdir dir="${basedir}/test"/>
2237 <junit printsummary="withOutAndErr"
2238 errorproperty="test.failed"
2239 failureproperty="test.failed"
2240 fork="${junit.fork}">
2241 <formatter type="plain"/>
2242 <classpath>
[16936]2243 <pathelement location="${build.home}/gsdl3test.jar"/>
2244 <path refid="compile.classpath"/>
[15124]2245 </classpath>
2246 <test name="${testcase}" if="testcase"/>
2247 <batchtest todir="${basedir}/test" unless="testcase">
[18505]2248 <fileset dir="${build.home}" includes="**/*Test.class" />
[15124]2249 </batchtest>
2250 </junit>
2251 <echo>
2252 *********************************************
[15799]2253 Test output can be found in directory 'test'
[15124]2254 *********************************************
2255 </echo>
2256 </target>
[15799]2257
[20950]2258 <!-- ======================== FLAX Targets ========================= -->
2259 <target name="prepare-flax" description="check out flax source code from another repository" if="install.flax">
2260 <echo>checking out flax ...</echo>
2261 <mkdir dir="${basedir}/src/java/org/flax"/>
2262 <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
[22198]2263 <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/action/flax"/>
[20950]2264 <mkdir dir="${web.home}/WEB-INF/classes/flax"/>
2265 <mkdir dir="${web.home}/interfaces/flax"/>
2266 <mkdir dir="${web.home}/sites/flax"/>
2267 <mkdir dir="${basedir}/flax-resources"/>
2268 <mkdir dir="${basedir}/flax-lib"/>
[21272]2269 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/flax"/>
2270 <arg value="src/java/org/flax"/></exec>
2271 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/greenstone/gsdl3/flax"/>
2272 <arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
[22198]2273 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/greenstone/gsdl3/action/flax"/>
2274 <arg value="src/java/org/greenstone/gsdl3/action/flax"/></exec>
2275 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/WEB-INF/classes/flax"/>
[21272]2276 <arg value="${web.home}/WEB-INF/classes/flax"/></exec>
2277 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/interfaces/flax"/>
2278 <arg value="${web.home}/interfaces/flax"/></exec>
2279 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/sites/flax"/>
2280 <arg value="${web.home}/sites/flax"/></exec>
2281 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/flax-resources"/>
2282 <arg value="flax-resources"/></exec>
2283 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/lib"/>
2284 <arg value="flax-lib"/></exec>
[25901]2285 <antcall target="flax-copy-del-files" />
[20950]2286 </target>
[23442]2287
[25901]2288 <target name="flax-copy-del-files" description="copy some flax files into the appropriate greenstone3 directories and delete some unwanted greenstone stuff">
[23442]2289 <copy file="${web.home}/WEB-INF/classes/flax/web.xml" todir="${web.home}/WEB-INF" overwrite="true" />
2290 <copy todir="${web.home}/WEB-INF/lib">
[25901]2291 <fileset dir="${basedir}/flax-lib">
2292 <include name="*.jar"/>
2293 </fileset>
[23442]2294 </copy>
[25904]2295 <!--<delete dir="${web.home}/sites/gateway"/>
2296 <delete dir="${web.home}/sites/localsite"/>-->
[23442]2297 </target>
[20950]2298
2299 <target name="update-flax" description="update flax from repository">
2300 <echo>updating flax ...</echo>
[21272]2301 <exec executable="svn"><arg value="update"/>
2302 <arg value="src/java/org/flax"/></exec>
2303 <exec executable="svn"><arg value="update"/>
[22198]2304 <arg value="src/java/org/greenstone/gsdl3/action/flax"/></exec>
2305 <exec executable="svn"><arg value="update"/>
[21272]2306 <arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
2307 <exec executable="svn"><arg value="update"/>
2308 <arg value="${web.home}/WEB-INF/classes/flax"/></exec>
2309 <exec executable="svn"><arg value="update"/>
2310 <arg value="${web.home}/interfaces/flax"/></exec>
2311 <exec executable="svn"><arg value="update"/>
[24366]2312 <arg value="${web.home}/web/sites/flax"/></exec>
2313 <exec executable="svn"><arg value="update"/>
[21272]2314 <arg value="flax-resources"/></exec>
2315 <exec executable="svn"><arg value="update"/>
2316 <arg value="flax-lib"/></exec>
[24098]2317 <antcall target="compile-core" />
[20950]2318 </target>
2319
[25901]2320 <!-- ========================End of FLAX Targets ========================= -->
[20963]2321
[19354]2322 <target name="compile-javadocs">
2323 <javadoc packagenames="org.greenstone.*"
2324 sourcepath="src/java"
2325 defaultexcludes="yes"
2326 destdir="docs/javadoc"
2327 author="true"
2328 version="true"
2329 use="true"
2330 windowtitle="Greenstone3 API">
2331 <doctitle><![CDATA[<h1>Greenstone3 API</h1>]]></doctitle>
2332 </javadoc>
2333 </target>
2334
[20089]2335<!-- ========== Some distribution targets ======================== -->
[19972]2336 <target name="remove-source">
[23809]2337 <if><bool><isset property="with.gli.and.gems"/></bool>
[19975]2338 <delete includeEmptyDirs="true">
2339 <fileset dir="." defaultexcludes="false">
2340 <patternset refid="greenstone3.source.component"/>
2341 </fileset>
2342 </delete>
[23809]2343
2344 <else>
2345 <delete includeEmptyDirs="true">
2346 <fileset dir="." defaultexcludes="false">
2347 <patternset refid="greenstone3.source.no.gli.component"/>
2348 </fileset>
2349 </delete>
2350 </else>
2351 </if>
[19972]2352 </target>
2353
[19903]2354 <target name="dist-tidy"
2355 description="'tidies-up' a greenstone3 installation for distribution.">
2356
2357 <!-- delete unneeded things -->
2358 <delete dir="${packages.home}/axis"/>
2359 <delete><fileset dir="${packages.home}" includes="*.zip"/></delete>
2360 <delete file="README-SVN.txt"/>
[20215]2361 <delete file="build.properties.in"/>
[19903]2362
[19961]2363 <!-- delete source files -->
[19972]2364 <antcall target="remove-source"/>
[19903]2365
2366 <!-- create empty directories -->
2367 <mkdir dir="${web.home}/applet"/>
2368 <mkdir dir="${web.home}/logs"/>
[25446]2369 <mkdir dir="${web.home}/logs/tmp"/>
[19903]2370
2371 <!-- os specific tidy-ups -->
[20051]2372 <!-- linux, mac -->
2373 <if><bool><istrue value="${current.os.isunix}"/></bool>
[19903]2374 <delete><fileset dir="." includes="*.bat"/></delete>
[23809]2375 <if><bool><isset property="with.gli.and.gems"/></bool>
2376 <delete><fileset dir="gli" includes="*.bat"/></delete>
2377 </if>
[19903]2378 <delete><fileset dir="gs2build" includes="*.bat"/></delete>
2379 <delete><fileset dir="bin/script" includes="*.bat"/></delete>
[19946]2380 <delete file="${basedir}/gs2build/win32cfg.h"/>
[19939]2381 <delete file="${basedir}/gs2build/win32.mak"/>
[20051]2382 <delete dir="${basedir}/winutil"/>
[19903]2383 <delete failonerror="false"><fileset dir="${lib.jni}" includes="*.dll"/></delete>
2384
[20051]2385 <!-- windows -->
2386 <else><if><bool><istrue value="${current.os.iswindows}"/></bool>
2387 <delete><fileset dir="." includes="*.sh,*.bash,*.csh"/></delete>
[23809]2388 <if><bool><isset property="with.gli.and.gems"/></bool>
2389 <delete><fileset dir="gli" includes="*.sh,*.bash,*.csh"/></delete>
2390 </if>
[20051]2391 <delete><fileset dir="gs2build" includes="*.sh,*.bash,*.csh"/></delete>
2392 <delete><fileset dir="bin/script" includes="*.sh,*.bash,*.csh"/></delete>
2393 </if></else></if>
2394
[19903]2395 </target>
2396
[20089]2397 <!-- fix up executable permissions for binary release -->
2398 <target name="fix-execute-permissions">
2399 <echo>Setting binaries to executable</echo>
[20127]2400 <chmod perm="775">
2401 <fileset dir="."><patternset refid="greenstone3.executables"/></fileset>
2402 </chmod>
[20089]2403 </target>
2404
2405 <!-- fix up executable permissions for source code release -->
2406 <target name="fix-execute-permissions-source">
[20127]2407 <chmod perm="775">
2408 <fileset dir="."><patternset refid="greenstone3.source.executables"/></fileset>
2409 </chmod>
[20089]2410 </target>
2411
2412
[19931]2413 <!-- ============= tweaks for making compilation static ========== -->
2414 <target name="tweak-makefiles" depends="init" if="compile.static">
2415 <antcall target="rtftohtml-add-static" />
2416 </target>
2417
2418 <target name="rtftohtml-add-static" depends="init" if="collection.building.enabled">
2419 <rsr file="${gs2build.home}/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="-o rtftohtml(.{2})EXEEXT(.{1})" replacement="-o rtftohtml$1EXEEXT$2 -static" />
2420 </target>
2421
[26002]2422</project>
Note: See TracBrowser for help on using the repository browser.