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

Last change on this file since 23807 was 23807, checked in by sjm84, 13 years ago

Created a property called gli.and.gems that will prevent gems and gli from being checked out and compiled

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