root/greenstone3/trunk/build.xml @ 15038

Revision 15038, 65.4 KB (checked in by shaoqun, 12 years ago)

add prepare, configure, compile stuff for gdbm

Line 
1<?xml version="1.0"?>
2
3<!-- ======================================================================
4     March 2005                                                   
5
6     Greenstone3 build and install script
7                   
8     kjdon                                                               
9     ====================================================================== -->
10<project name="greenstone3" default="usage" basedir=".">
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
21    <taskdef name="mysetproxy" classname="org.greenstone.anttasks.MySetProxy" classpath="${basedir}/lib/java/anttasks.jar"/>
22    <taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" classpath="${basedir}/lib/java/anttasks.jar"/>
23    <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>
24    <taskdef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpath="${basedir}/lib/java/anttasks.jar"/>
25
26<!-- ===================== Property Definitions =========================== -->
27
28<!--
29
30  Each of the following properties are used in the build script.
31  Values for these properties are set by the first place they are
32  defined, from the following list:
33
34  * Definitions on the "ant" command line (ant -Dfoo=bar compile).
35
36  * Definitions from a "build.properties" file in the top level
37    source directory of this application.
38
39  * Definitions from a "build.properties" file in the user's
40    home directory.
41
42  * Default definitions in this build.xml file.
43
44  You will note below that property values can be composed based on the
45  contents of previously defined properties.  This is a powerful technique
46  that helps you minimize the number of changes required when your development
47  environment is modified.  Note that property composition is allowed within
48  "build.properties" files as well as in the "build.xml" script.
49
50-->
51
52  <property file="build.properties"/>
53  <property file="${user.home}/build.properties"/>
54
55  <!-- get properties from the environment -->
56  <property environment="env"/>
57  <property name="build.home" value="${basedir}/build"/>
58  <property name="src.home" value="${basedir}/src/java"/>
59  <property name="src.packages.home" value="${basedir}/src/packages"/>
60  <property name="packages.home" value="${basedir}/packages"/>
61  <!-- this may be set in build.properties, eg if you move the web dir to
62  tomcats webapps directory -->
63  <property name="web.home" value="${basedir}/web"/>
64  <!-- jar files needed by applets go here -->
65  <property name="web.applet" value="${web.home}/applet"/>
66  <!-- jar files needed by the servlet (and extra ones) go here -->
67  <property name="web.lib" value="${web.home}/WEB-INF/lib"/>
68  <!-- other files needed by the servlet go here -->
69  <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
70  <!-- jni libraries and java wrappers go here -->
71  <property name="lib.jni" value="${basedir}/lib/jni"/>
72   
73  <property name="javadocs" value="${basedir}/docs/javadoc"/>
74
75  <property name="app.name"      value="greenstone3"/>
76  <property name="app.path"      value="/${app.name}"/>
77
78
79  <!-- version number stuff -->
80
81  <!-- app.version defaults to trunk -->
82  <condition property="app.version" value="trunk">
83    <not><isset property="app.version"/></not>
84  </condition>
85
86    <!-- determine the 'branch path' -->
87  <condition property="branch.path" value="trunk">
88    <equals arg1="${app.version}" arg2="trunk" />
89  </condition>
90  <condition property="branch.path" value="branches/${app.version}">
91    <not><equals arg1="${app.version}" arg2="trunk" /></not>
92  </condition>
93
94
95  <property name="flax.svn.root" value="http://svn.greenstone.org/flax"/>
96
97  <property name="svn.root" value="http://svn.greenstone.org"/>
98<!--  <property name="cvs.root" value=":pserver:cvs_anon@cvs.scms.waikato.ac.nz:2402/usr/local/global-cvs/gsdl-src"/> -->
99  <!-- catalina home is set to tomcat basedir is already installed, otherwise
100  use greenstone's tomcat -->
101  <condition property="catalina.home" value="${tomcat.installed.path}">
102    <and>
103      <isset property="tomcat.installed.path"/>
104      <not>
105    <equals arg1="" arg2="${tomcat.installed.path}"/>
106      </not>
107    </and>
108  </condition>
109  <property name="catalina.home" value="${packages.home}/tomcat"/>
110
111  <property name="os.linux" value="Linux"/>
112  <property name="os.mac" value="Mac OS X"/>
113  <property name="os.solaris" value="SunOS"/>
114  <property name="os.unix" value="${os.linux},${os.mac},${os.solaris}"/>
115  <property name="os.windows" value="Windows 95,Windows 98,Windows 2000,Windows XP,Windows NT,Windows ME"/> <!-- check this!!!-->
116
117  <!-- this is true for linux and macs -->
118  <condition property="current.os.isunix">
119    <os family="unix"/>
120  </condition>
121 
122  <condition property="current.os.isunixnotmac">
123    <and>
124      <os family="unix"/>
125      <not>
126    <os family="mac"/>
127      </not>
128    </and>
129  </condition>
130  <condition property="current.os.ismac">
131    <os family="mac"/>
132  </condition>
133 
134  <condition property="current.os.iswindows">
135    <os family="windows"/>
136  </condition>
137
138  <condition property="collection.building.enabled">
139    <not>
140      <isset property="disable.collection.building"/>
141    </not>
142  </condition>
143
144  <condition property="collection.building.enabled.windows">
145    <and>
146      <isset property="collection.building.enabled"/>
147      <isset property="current.os.iswindows"/>
148    </and>
149  </condition>
150 
151  <condition property="collection.building.enabled.unix">
152    <and>
153      <isset property="collection.building.enabled"/>
154      <isset property="current.os.isunix"/>
155    </and>
156  </condition>
157 
158  <condition property="independent-indexers">
159    <isset property="disable.collection.building"/>
160  </condition>
161   
162  <!-- ============= Base dirs for each package and component ============ -->
163  <property name="src.applet.home" value="${src.home}/org/greenstone/applet"/>
164  <property name="src.gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
165  <property name="anttasks.home" value="${src.home}/org/greenstone/anttasks"/>
166  <property name="gs2build.home" value="${basedir}/gs2build"/>
167  <property name="gli.home" value="${basedir}/gli"/>
168  <property name="javagdbm.home" value="${src.packages.home}/javagdbm"/>
169  <property name="gdbm.home" value="${src.packages.home}/gdbm-1.8.3"/>
170
171  <!--<property name="indexers.home" value="${basedir}/src/packages/indexers">-->
172  <condition property="indexers.home" value="${basedir}/src/packages/indexers">
173    <isset property="disable.collection.building"/>
174  </condition>
175  <condition property="indexers.home" value="${gs2build.home}/indexers">
176    <not>
177      <isset property="disable.collection.building"/>
178    </not>
179  </condition>
180
181  <property name="mg.home" value="${indexers.home}/mg"/>
182  <property name="mgpp.home" value="${indexers.home}/mgpp"/>
183  <property name="lucene.home" value="${indexers.home}/lucene-gs"/>
184
185
186<!--  ==================== Compilation Control Options ==================== -->
187
188<!--
189
190  These properties control option settings on the Javac compiler when it
191  is invoked using the <javac> task.
192
193  compile.debug        Should compilation include the debug option?
194
195  compile.deprecation  Should compilation include the deprecation option?
196
197  compile.optimize     Should compilation include the optimize option?
198
199-->
200
201  <property name="compile.debug"       value="true"/>
202  <property name="compile.deprecation" value="true"/>
203  <property name="compile.optimize"    value="true"/>
204
205<!--
206
207  Rather than relying on the CLASSPATH environment variable, Ant includes
208  features that makes it easy to dynamically construct the classpath you
209  need for each compilation.  The example below constructs the compile
210  classpath to include the servlet.jar file, as well as the other components
211  that Tomcat makes available to web applications automatically, plus anything
212  that you explicitly added.
213
214-->
215
216  <path id="compile.classpath">
217    <!-- Include all jar files and libraries in our jni lib directory -->
218    <pathelement location="${lib.jni}"/>
219    <fileset dir="${lib.jni}">
220      <include name="*.jar"/>
221    </fileset>
222    <!-- Include all jar files in our web lib directory -->
223    <pathelement location="${web.lib}"/>
224    <fileset dir="${web.lib}">
225      <include name="*.jar"/>
226    </fileset>
227   
228    <!-- Include the axis jar files -->
229    <!--<fileset dir="${basedir}/comms/soap/axis/lib">
230      <include name="*.jar"/>
231    </fileset>-->
232   
233    <!-- include the jar files from the source packages -->
234    <!-- mg and mgpp get installed into lib/jni but they may not be there yet
235    so we add them in by name -->
236    <pathelement location="${lib.jni}/mg.jar"/>
237    <pathelement location="${lib.jni}/mgpp.jar"/>
238   
239    <!-- Include all elements that Tomcat exposes to applications -->
240    <pathelement location="${catalina.home}/common/classes"/>
241    <fileset dir="${catalina.home}/common/endorsed">
242      <include name="*.jar"/>
243    </fileset>
244    <fileset dir="${catalina.home}/common/lib">
245      <include name="*.jar"/>
246    </fileset>
247    <pathelement location="${catalina.home}/shared/classes"/>
248    <fileset dir="${catalina.home}/shared/lib">
249      <include name="*.jar"/>
250    </fileset>
251  </path>
252
253  <path id="local.tomcat.classpath">
254    <!-- explicitly include the jni java wrappers in the classpath -->
255    <pathelement location="${lib.jni}"/>
256    <fileset dir="${lib.jni}">
257      <include name="*.jar"/>
258    </fileset>
259  </path>
260 
261  <path id="local.tomcat.path">
262    <pathelement location="${basedir}/bin/script"/>
263    <pathelement location="${basedir}/bin"/>
264    <pathelement location="${lib.jni}"/>
265    <pathelement path="${env.PATH}"/>
266    <pathelement path="${env.Path}"/>
267  </path>
268
269  <target name="test-setup">
270    <echo>ant java version=${ant.java.version}</echo>
271    <echo>is unix : ${current.os.isunix}</echo>
272    <echo>is mac : ${current.os.ismac}</echo>
273    <echo>is unixnotmac : ${current.os.isunixnotmac}</echo>
274    <echo>is windows : ${current.os.iswindows}</echo>
275    <echo>os.unix: ${os.unix}</echo>
276  </target>
277<!-- ==================== Primary and Global Targets ============================= -->
278
279  <!-- add comments about using xxx-core, xxx-packages if only want certain parts?? -->
280
281  <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections,prepare-gdbm"
282    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.">
283<!--  <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections"
284    description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional cvs checkouts and downloads, so you need to be online to run this.">-->
285
286    <!-- make sure .sh files are executable -->
287    <chmod dir="${basedir}" perm="ugo+rx"
288      includes="*.sh"/>
289    <chmod dir="${basedir}/bin/script" perm="ugo+rx"
290      includes="*.sh,*.pl"/>
291  </target>
292  <target name="install" depends="init,install-indexer-files,configure,configure-c++,compile"
293    description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare install'."/>
294 
295<!--  <target name="cvsupdate" depends="init,cvsupdate-packages,cvsupdate-core,cvsupdate-gs2building,cvsupdate-web"
296    description="Do a cvs update for all sources. Doesn't recompile the code. You need to be online to run this."/>-->
297  <target name="svnupdate" depends="init,svnupdate-packages,svnupdate-core,svnupdate-gs2building,svnupdate-web"
298    description="Do a `svn update` for all sources. Doesn't recompile the code. You need to be online to run this."/>
299
300
301  <target name="configure-c++" depends="init,configure-packages,configure-core,configure-gs2building"
302    description="Configure any C/C+/+ package code and gs2building code if necessary"/>
303 
304  <target name="configure" depends="init,configure-tomcat,configure-web"
305    description="Configure the installation. Includes setting up config files. Should be re-run if you change the build.properties file."/>
306
307  <target name="clean" depends="init,clean-gdbm,clean-packages,clean-core,clean-gs2building"
308    description="Remove all old compiled code. Includes core, packages and gs2building if necessary"/>
309 
310  <target name="compile" depends="init,compile-web,compile-packages,compile-core,compile-gs2building"
311    description="Compile all the source code, includes core, packages and gs2building if necessary. Copy jar files and executables to their correct places."/>
312   
313  <target name="update" depends="init,svnupdate,clean,configure,configure-c++,compile"
314    description="Update (thru Subversion) all the source (including core, packages and gs2building), then clean, configure and recompile."/>
315
316  <target name="start" depends="init,start-tomcat"
317    description="Startup the Tomcat server." >
318    <echo>${app.name} (${app.version}) server running using Apache Tomcat and Java</echo>
319    <echo>Tomcat:   ${catalina.home}</echo>
320    <echo>Java: ${java.home}</echo>
321        <echo>URL:  http://${tomcat.server}:${tomcat.port}${app.path}/</echo>
322        <!-- assuming that index.html is not needed here -->   
323  </target>
324
325  <target name="stop" depends="init,stop-tomcat"
326    description="Shutdown the Tomcat server."/>
327 
328  <target name="restart" description="Shutdown and restart Tomcat"  depends="init,stop,start"/>
329
330
331<!-- =========== Help targets ===================================  -->
332 
333  <property name="install-command" value="ant [options] prepare install"/>
334 
335  <target name="usage" description="Print a help message">
336    <echo message="  Execute 'ant -projecthelp' for a list of targets."/>
337    <echo message="  Execute 'ant -help' for Ant help."/>
338    <echo>To install Greenstone3, run '${install-command}'.
339There 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.
340To log the output, use the '-logfile build.log' option.
341The README.txt file has more information about the ant targets and install process.
342    </echo>
343  </target>
344 
345  <target name="help" depends="usage" description="Print a help message"/>
346 
347  <target name="debug" depends="init" description="Display all the currently used properties">
348    <echoproperties/>
349  </target>
350
351<!-- ====== initialization and setup targets ================== -->
352
353  <target name="accept-properties" unless="properties.accepted">
354    <input addproperty="properties.ok" validargs="y,n">The following properties (among others) are being used from a build.properties file found in this directory:
355tomcat.server=${tomcat.server}
356tomcat.port=${tomcat.port}
357tomcat.installed.path=${tomcat.installed.path} (this is the location of Tomcat's base dir if it is already installed)
358proxy.host=${proxy.host}
359proxy.port=${proxy.port}
360If these are not acceptable, please change them and rerun this target. Continue [y/n]? />
361    </input>
362    <condition property="do.abort">
363      <equals arg1="n" arg2="${properties.ok}"/>
364    </condition>
365    <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
366  </target>
367
368<!--  <target name="check-cvsroot">
369    <condition property="svnroot.notset">
370      <or>
371            <not>
372              <isset property="env.CVSROOT"/>
373            </not>
374            <equals arg1="" arg2="${env.CVSROOT}"/>
375      </or>
376    </condition>
377    <fail if="cvsroot.notset" message="You need to set the CVSROOT variable"/>
378  </target> -->
379
380  <!-- this sets up some initial properties -->
381  <target name="init">
382
383    <condition property="java.too.old">
384      <or>
385    <equals arg1="1.1" arg2="${ant.java.version}"/>
386    <equals arg1="1.2" arg2="${ant.java.version}"/>
387    <equals arg1="1.3" arg2="${ant.java.version}"/>
388      </or>
389    </condition>
390    <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
391   
392    <available file="${indexers.home}" property="indexers.present"/>
393    <available file="${basedir}/gli" property="gli.present"/>
394    <available file="${basedir}/gs2build" property="gs2build.present"/>
395
396    <condition property="tomcat.islocal">
397      <or>
398    <not>
399      <isset property="tomcat.installed.path"/>
400    </not>
401    <equals arg1="" arg2="${tomcat.installed.path}"/>
402      </or>
403    </condition>
404   
405      <echo>tomcat.port = ${tomcat.port}</echo>
406      <echo>gli.present = ${gli.present}</echo>
407      <echo>gs2build.present = ${gs2build.present}</echo>
408      <echo>gsdl2.installed.path = ${gsdl2.installed.path}</echo>
409     <!-- gsdl2.installed.path appears not to be set? -->
410
411    <condition property="proxy.present">
412      <and>
413    <isset property="proxy.host"/>
414    <not>
415      <equals arg1="" arg2="${proxy.host}"/>
416    </not>
417      </and>
418    </condition>
419
420    <condition property="need.macos.extra">
421      <and>
422    <isset property="current.os.ismac"/>
423    <not>
424      <isset property="disable.collection.building"/>
425    </not>
426      </and>
427    </condition>
428  </target>
429
430  <target name="setup-proxy" depends="init" if="proxy.present">
431    <condition property="ask.user">
432      <or>
433    <equals arg1="" arg2="${proxy.user}"/>
434    <equals arg1="" arg2="${proxy.password}"/>
435      </or>
436    </condition>
437    <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}" userproperty="proxy.username" pwordproperty="proxy.password"/>
438    <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
439  </target>
440     
441 <!-- ========== Web app Targets ================================ -->
442 
443  <target name="prepare-web" depends="init,configure-java-version">
444    <mkdir dir="${web.home}/applet"/>
445    <mkdir dir="${web.home}/logs"/>
446  </target>
447 
448  <!-- 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 -->
449  <target name="configure-java-version" depends="init"
450    description="Run this target if you have changed the default version of java since installing greenstone3">
451    <condition property="need.xalan.jar">
452      <equals arg1="1.5" arg2="${ant.java.version}"/>
453    </condition>
454    <antcall target="activate-xalan-jar"/>
455    <antcall target="deactivate-xalan-jar"/>
456  </target>
457 
458  <target name="activate-xalan-jar" if="need.xalan.jar">
459    <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/>
460    <antcall target="copy-xalan-for-mac" />
461  </target>
462
463  <target name="copy-xalan-for-mac" if="current.os.ismac">
464       <copy file="${web.lib}/xalan.jar.tmp" tofile="${tomcat.installed.path}/common/endorsed/xalan.jar"/>
465  </target>
466
467  <target name="deactivate-xalan-jar" unless="need.xalan.jar">
468    <delete file="${web.lib}/xalan.jar"/>
469  </target>
470
471  <target name="prepare-collections" depends="init">
472    <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
473    <!-- gs2mgdemo -->
474    <unzip src="${collect.dir}/gs2mgdemo/import.zip"
475      dest="${collect.dir}/gs2mgdemo"/>
476    <unzip src="${collect.dir}/gs2mgdemo/metadata.zip"
477      dest="${collect.dir}/gs2mgdemo"/>
478    <unzip src="${collect.dir}/gs2mgdemo/index/index.zip"
479      dest="${collect.dir}/gs2mgdemo/index"/>
480    <delete file="${collect.dir}/gs2mgdemo/import.zip"/>
481    <delete file="${collect.dir}/gs2mgdemo/metadata.zip"/>
482    <delete file="${collect.dir}/gs2mgdemo/index/index.zip"/>
483    <!-- gs2mgppdemo -->
484    <unzip src="${collect.dir}/gs2mgppdemo/import.zip"
485      dest="${collect.dir}/gs2mgppdemo"/>
486    <unzip src="${collect.dir}/gs2mgppdemo/metadata.zip"
487      dest="${collect.dir}/gs2mgppdemo"/>
488    <unzip src="${collect.dir}/gs2mgppdemo/index/index.zip"
489      dest="${collect.dir}/gs2mgppdemo/index"/>
490    <delete file="${collect.dir}/gs2mgppdemo/import.zip"/>
491    <delete file="${collect.dir}/gs2mgppdemo/metadata.zip"/>
492    <delete file="${collect.dir}/gs2mgppdemo/index/index.zip"/>
493    <!-- gberg -->
494    <unzip src="${collect.dir}/gberg/index/index.zip"
495      dest="${collect.dir}/gberg/index"/>
496    <delete file="${collect.dir}/gberg/index/index.zip"/>
497  </target>
498
499 
500  <target name="configure-web" depends="init"
501    description="Configure only the web app config files">
502    <!-- we want a unix path in the global.properties file -->
503    <pathconvert targetos="unix" property="src.gsdl3.home.unix">
504      <path path="${web.home}"/>
505    </pathconvert>
506    <filter token="gsdl3home" value="${src.gsdl3.home.unix}"/>
507    <filter token="gsdl3version" value="${app.version}"/>
508    <filter token="tomcat.server" value="${tomcat.server}"/>
509    <filter token="tomcat.port" value="${tomcat.port}"/>
510    <copy file="${basedir}/resources/java/global.properties.in" tofile="${web.classes}/global.properties" filtering="true" overwrite="true"/>
511    <copy file="${basedir}/resources/java/log4j.properties.in" tofile="${web.classes}/log4j.properties" filtering="true" overwrite="true"/>
512    <chmod file="${web.classes}/global.properties" perm="600"/>
513    <chmod file="${web.classes}/log4j.properties" perm="600"/>
514  </target>
515
516  <target name="compile-web" depends="init">
517    <javac srcdir="${web.classes}"
518      destdir="${web.classes}"
519      debug="${compile.debug}"
520      deprecation="${compile.deprecation}"
521      optimize="${compile.optimize}">
522      <classpath>
523    <path refid="compile.classpath"/>
524      </classpath>
525    </javac>
526  </target>
527
528    <target name="svnupdate-web" unless="nosvn.mode">
529        <svn>
530            <update dir="${web.home}"/>
531        </svn>
532    </target>
533
534  <target name="update-web" depends="init,svnupdate-web,configure-web"
535    description="update only the web stuff (config files)"/>
536
537
538<!-- ======================= Tomcat Targets ========================== -->
539 
540  <!-- this target downloads and installs Tomcat -->
541  <!-- we download tomcat and the compat module - its needed for 1.4, and doesn't seem to harm 1.5 -->
542  <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal">
543
544    <!-- check that packages dir is there -->
545    <mkdir dir="${packages.home}"/>
546    <get src="http://www.greenstone.org/gs3files/apache-tomcat-5.5.25.zip"
547      dest="${packages.home}/apache-tomcat-5.5.25.zip"
548      usetimestamp="true"/>
549    <unzip src="${packages.home}/apache-tomcat-5.5.25.zip"
550      dest="${packages.home}"/>
551    <get src="http://www.greenstone.org/gs3files/apache-tomcat-5.5.25-compat.zip"
552      dest="${packages.home}/apache-tomcat-5.5.25-compat.zip"
553      usetimestamp="true"/>
554    <unzip src="${packages.home}/apache-tomcat-5.5.25-compat.zip"
555      dest="${packages.home}"/>
556    <!-- delete any existing tomcat -->
557    <delete dir="${packages.home}/tomcat"/>
558    <move todir="${packages.home}/tomcat">
559      <fileset dir="${packages.home}/apache-tomcat-5.5.25"/>
560    </move>
561    <copy file="${basedir}/resources/tomcat/setclasspath.bat"
562      tofile="${packages.home}/tomcat/bin/setclasspath.bat"
563      overwrite="true"/>
564    <copy file="${basedir}/resources/tomcat/setclasspath.sh"
565      tofile="${packages.home}/tomcat/bin/setclasspath.sh"
566      overwrite="true"/>
567    <!-- make sure we have execute permission for the .sh files -->
568    <chmod dir="${packages.home}/tomcat/bin" perm="ugo+rx"
569      includes="*.sh"/>   
570  </target>
571 
572  <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/>
573 
574  <target name="configure-tomcat-local" depends="init" if="tomcat.islocal">
575    <!-- re-setup the server.xml file -->
576    <copy file="${basedir}/resources/tomcat/server.xml" tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true">
577      <filterset>
578    <filter token="port" value="${tomcat.port}"/>
579    <filter token="shutdown-port" value="${tomcat.shutdown.port}"/>
580      </filterset>
581    </copy>
582    <!-- set up the greenstone3 context -->
583    <copy file="${basedir}/resources/tomcat/greenstone3.xml" tofile="${packages.home}/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true">
584      <filterset>
585    <filter token="gsdl3webhome" value="${basedir}/web"/>
586      </filterset>
587    </copy>
588  </target>
589
590  <target name="configure-tomcat-external" depends="init" unless="tomcat.islocal">
591    <!-- re-setup the server.xml file -->
592    <!-- need to edit the config file, or do we get the user to do this???-->
593  </target>
594   
595  <target name="start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
596   <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
597    <property name="tomcat.path" refid="local.tomcat.path"/>
598    <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
599    <exec executable="${catalina.home}/bin/startup.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
600      <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
601      <env key="GSDL3HOME" value="${basedir}"/>
602      <env key="PATH" path="${tomcat.path}"/>
603      <env key="CATALINA_OPTS" value="${catalina.opts}"/>
604      <env key="CATALINA_HOME" value="${catalina.home}"/>
605      <env key="CLASSPATH" path="${tomcat.classpath}"/>
606      <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
607      <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.installed.path}/lib"/> <!-- for mac os -->
608    </exec>
609    <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
610      <env key="GSDLOS" value="windows"/>
611      <env key="GSDL3HOME" value="${basedir}"/>
612      <env key="Path" path="${tomcat.path}"/>
613      <env key="PATH" path="${tomcat.path}"/>
614      <env key="CATALINA_OPTS" value="${catalina.opts}"/>
615      <env key="CLASSPATH" path="${tomcat.classpath}"/>
616    </exec>
617    <!-- wait for the server to startup in case other targets need it running -->
618    <waitfor maxwait="5" maxwaitunit="second">
619      <and>
620    <socket server="${tomcat.server}" port="${tomcat.port}"/>
621    <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
622      </and>
623    </waitfor>
624  </target>
625
626  <!-- windows: do we want to launch a webrowser?? -->
627  <!-- shouldn't this test whether anything is running first? -->
628  <target name="stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
629    <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
630      <env key="CATALINA_HOME" value="${catalina.home}"/>
631    </exec>
632    <exec executable="${catalina.home}/bin/shutdown.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false"/>
633  </target>
634
635  <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/>
636
637  <target name="setup-catalina-ant-tasks">
638    <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
639    <taskdef name="deploy"    classname="org.apache.catalina.ant.DeployTask"
640      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
641    <taskdef name="list"      classname="org.apache.catalina.ant.ListTask"
642      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
643    <taskdef name="reload"    classname="org.apache.catalina.ant.ReloadTask"
644      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
645    <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
646      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
647    <taskdef name="roles"     classname="org.apache.catalina.ant.RolesTask"
648      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
649    <taskdef name="start"     classname="org.apache.catalina.ant.StartTask"
650      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
651    <taskdef name="stop"      classname="org.apache.catalina.ant.StopTask"
652      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
653    <taskdef name="undeploy"  classname="org.apache.catalina.ant.UndeployTask"
654      classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
655  </target>
656
657
658
659
660
661
662<!-- ======================= ant Targets ============================ -->
663  <target name="prepare-ant" depends="init">
664    <get src="http://www.greenstone.org/gs3files/apache-ant-1.7.0-bin.zip"
665      dest="${packages.home}/apache-ant-1.7.0-bin.zip"
666      usetimestamp="true"/>
667    <unzip src="${packages.home}/apache-ant-1.7.0-bin.zip"
668      dest="${packages.home}"/>
669    <move todir="${packages.home}/ant">
670      <fileset dir="${packages.home}/apache-ant-1.7.0"/>
671    </move>
672  </target>
673
674<!-- ======================= Axis Targets ============================ -->
675
676  <target name="prepare-axis" depends="init">
677    <get src="http://www.greenstone.org/gs3files/axis-bin-1_2_1.zip"
678      dest="${packages.home}/axis-bin-1_2_1.zip"
679      usetimestamp="true"/>
680    <unzip src="${packages.home}/axis-bin-1_2_1.zip"
681      dest="${packages.home}"/>
682    <move todir="${packages.home}/axis">
683      <fileset dir="${packages.home}/axis-1_2_1"/>
684    </move>
685    <!-- install axis into greenstone web app -->
686    <copy todir="${web.lib}">
687      <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/lib">
688    <include name="*.jar"/>
689      </fileset>
690    </copy>
691    <copy todir="${web.home}">
692      <fileset dir="${packages.home}/axis/webapps/axis/">
693    <include name="*.jsp"/>
694    <include name="*.jws"/>
695      </fileset>
696    </copy>
697    <copy tofile="${web.home}/axis.html" file="${packages.home}/axis/webapps/axis/index.html"/>
698    <copy todir="${web.classes}">
699      <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/classes">
700    <include name="*.properties"/>
701      </fileset>
702    </copy>
703  </target>
704
705  <target name="soap-deploy-site" depends="init,get-sitename,get-siteuri,create-deployment-files,deploy-site"
706    description="Deploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."/>
707 
708  <target name="deploy-site">
709    <java classname="org.apache.axis.client.AdminClient">
710      <classpath refid="compile.classpath"/>
711      <arg value="-l"/>
712      <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
713      <arg file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
714    </java>   
715  </target>
716 
717  <target name="soap-undeploy-site" depends="get-sitename"
718    description="Undeploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work.">
719    <java classname="org.apache.axis.client.AdminClient">
720      <classpath refid="compile.classpath"/>
721      <arg value="-l"/>
722      <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
723      <arg file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
724    </java>
725  </target>
726
727  <!-- this target used to deploy the preprepared localsite server  -->
728  <target name="deploy-localsite" depends="init"
729    description="Deploy the SOAP server for localsite. Will start and stop Tomcat.">
730    <antcall target="start-tomcat"/>
731    <antcall target="deploy-site">
732      <param name="axis.sitename" value="localsite"/>
733    </antcall>
734    <antcall target="stop-tomcat"/>
735  </target>
736 
737  <target name="get-sitename" unless="axis.sitename">
738    <input addproperty="axis.sitename" message="What site? (press enter for default:localsite)" defaultvalue="localsite"/>
739  </target>
740
741  <target name="get-siteuri" depends="get-sitename" unless="axis.siteuri">
742    <input addproperty="axis.siteuri" message="What name do you want the service to have? (press enter for default:${axis.sitename})" defaultvalue="${axis.sitename}"/>
743    <echo>${axis.sitename}, ${axis.siteuri}</echo>
744  </target>
745
746  <target name="check-deployment-files" depends="get-sitename">
747    <condition property="deploy.exists">
748      <and>
749    <available file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
750    <available file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
751    <available file="${web.classes}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class"/>
752      </and>
753    </condition>
754   </target>
755
756  <target name="create-deployment-files" depends="get-sitename,get-siteuri,check-deployment-files"
757    if="axis.sitename" unless="deploy.exists">
758    <filter token="sitename" value="${axis.sitename}"/>
759    <filter token="siteuri" value="${axis.siteuri}"/>
760    <copy file="${basedir}/resources/soap/site.wsdd.template"
761      tofile="${basedir}/resources/soap/${axis.sitename}.wsdd"
762      filtering="true"/>
763     <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
764      tofile="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"
765      filtering="true"/>
766    <!-- create the java files and compile them -->
767    <copy file="${basedir}/resources/java/SOAPServer.java.in"
768      tofile="${src.gsdl3.home}/SOAPServer${axis.sitename}.java"
769      filtering="true"/>
770    <mkdir dir="${build.home}"/>
771    <javac srcdir="${src.home}"
772      destdir="${build.home}"
773      debug="${compile.debug}"
774      deprecation="${compile.deprecation}"
775      optimize="${compile.optimize}">
776      <classpath refid="compile.classpath"/>
777      <include name="org/greenstone/gsdl3/SOAPServer${axis.sitename}.java" />
778    </javac>
779    <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
780    <copy file="${build.home}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class" tofile="${web.classes}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class" />
781  </target>
782   
783
784<!-- ====================== Core targets ============================== -->
785<!-- core targets refer to the core gsdl3 java src -->
786 
787  <target name="prepare-core" unless="nocvs.mode">
788    <!-- just get rid of empty directories-->
789    <svn>
790        <update dir="."/>
791    </svn>
792  </target>
793 
794  <target name="configure-core"/>
795
796  <target name="update-core" depends="init,svnupdate-core,clean-core,compile-core"
797    description="Update only the Greenstone core" />
798 
799  <target name="svnupdate-core" unless="nocvs.mode">
800
801    <svn>
802        <update dir="." recurse="false"/>
803    </svn>
804
805   <svn>
806        <update dir="bin"/>
807        <update dir="comms"/>
808        <update dir="dist-resources"/>
809        <update dir="docs"/>
810        <update dir="lib"/>
811        <update dir="resources"/>
812        <update dir="src"/>
813        <update dir="winutil"/>
814    </svn>
815
816  </target>
817
818  <target name="clean-core"
819    description="Clean only the Greenstone core">
820    <delete dir="${build.home}"/>
821  </target>
822
823   <target name="compile-core" depends="init"
824    description="Compile only the Greenstone core">
825    <mkdir dir="${build.home}"/>
826    <javac srcdir="${src.home}"
827      destdir="${build.home}"
828      debug="${compile.debug}"
829      deprecation="${compile.deprecation}"
830      optimize="${compile.optimize}">
831      <classpath>
832    <path refid="compile.classpath"/>
833      </classpath>
834    </javac>
835    <jar destfile="${build.home}/gsdl3.jar">
836      <fileset dir="${build.home}">
837    <include name="org/greenstone/gsdl3/**"/>
838        <include name="org/flax/**"/>
839    <exclude name="**/Test.class"/>
840      </fileset>
841      <manifest>
842    <attribute name="Built-By" value="${user.name}" />
843      </manifest>
844    </jar>
845    <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
846    <!-- copy the localsite server in case we need it -->
847    <copy file="${build.home}/org/greenstone/gsdl3/SOAPServerlocalsite.class" tofile="${web.classes}/org/greenstone/gsdl3/SOAPServerlocalsite.class" />
848
849    <jar destfile="${build.home}/GAI.jar">
850      <fileset dir="${build.home}">
851    <include name="org/greenstone/admin/**"/>
852      </fileset>
853      <manifest>
854    <attribute name="Built-By" value="${user.name}" />
855      </manifest>
856    </jar>
857     
858    <jar destfile="${build.home}/phind.jar">
859      <fileset dir="${build.home}">
860    <include name="org/greenstone/applet/phind/**"/>
861      </fileset>
862      <manifest>
863    <attribute name="Built-By" value="${user.name}" />
864      </manifest>
865    </jar>
866    <mkdir dir="${web.applet}"/>
867    <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
868    <!-- phind also needs xercesImpl.jar and xml-apis.jar to be in web/applet -->
869    <copy file="${packages.home}/tomcat/common/endorsed/xercesImpl.jar" todir="${web.applet}"/>
870    <copy file="${packages.home}/tomcat/common/endorsed/xml-apis.jar" todir="${web.applet}"/>
871    <jar destfile="${build.home}/anttasks.jar">
872      <fileset dir="${build.home}">
873    <include name="org/greenstone/anttasks/**"/>
874      </fileset>
875      <manifest>
876    <attribute name="Built-By" value="${user.name}" />
877      </manifest>
878    </jar>
879    <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>
880    <jar destfile="${build.home}/gsdl3test.jar">
881      <fileset dir="${build.home}">
882    <include name="org/greenstone/gsdl3/**/*Test.class"/>
883    <include name="org/greenstone/testing/**"/>
884      </fileset>
885      <manifest>
886    <attribute name="Built-By" value="${user.name}" />
887      </manifest>
888    </jar>
889    <jar destfile="${build.home}/server.jar">
890      <fileset dir="${build.home}">
891    <include name="org/greenstone/server/**"/>
892      </fileset>
893      <fileset file="${basedir}/resources/java/server.properties"/>
894      <manifest>
895    <attribute name="Built-By" value="${user.name}"/>
896      </manifest>
897    </jar>
898    <copy file="${build.home}/server.jar" todir="${basedir}"/>
899  </target>
900 
901<!-- ================== Packages targets ================================ -->
902  <!-- these targets refer to the greenstone source packages - these need
903  updating less often, so are in  separate targets to the core -->
904  <target name="prepare-packages" depends="init,prepare-indexers"/>
905 
906  <target name="checkout-indexers" depends="init" if="independent-indexers" unless="nocvs.mode">
907<!--  <target name="checkout-indexers" depends="check-svnroot,init" if="independent-indexers" unless="nocvs.mode"> -->
908    <svn>
909        <checkout url="${svn.root}/indexers/${branch.path}" dest="${src.packages.home}/indexers"/>
910    </svn>
911  </target>
912 
913  <target name="prepare-indexers" depends="init" if="independent-indexers" unless="indexers.present">
914    <antcall target="checkout-indexers"/>
915  </target>
916
917  <target name="update-packages" depends="init,svnupdate-packages,configure-packages,clean-packages,compile-packages"
918    description="Update only the source packages"/>
919
920  <target name="svnupdate-packages" unless="nocvs.mode">
921   <svn>
922        <update dir="${src.packages.home}"/>
923    </svn>
924  </target>
925 
926  <target name="configure-packages" depends="init,configure-gdbm,configure-javagdbm,configure-indexers"
927    description="Configure only the packages."/>
928 
929  <target name="configure-javagdbm">
930    <echo>
931      Configuring JavaGDBM
932    </echo>
933    <exec executable="${javagdbm.home}/configure" os="${os.linux},${os.solaris}"
934      dir="${javagdbm.home}">
935      <arg value="--prefix=${basedir}"/>
936      <arg value="--libdir=${lib.jni}"/>
937    </exec>   
938    <exec executable="${javagdbm.home}/configure" os="${os.mac}"
939      dir="${javagdbm.home}">
940      <arg value="--prefix=${basedir}"/>
941      <arg value="--libdir=${lib.jni}"/>
942     <arg value="--with-gdbm=${gdbm.installed.path}"/>
943    </exec>   
944  </target>
945
946<!-- Message from oran. I removed the condition from this line becuase it meant
947    the indexers would only be configured if collection building was DISabled.
948    Shouldn't they be configured when collection building is ENabled? -->
949
950<!--    <target name="configure-indexers" depends="init" if="independent-indexers"> -->
951<target name="configure-indexers" depends="init">
952        <echo>Configuring Indexers</echo>
953        <exec executable="${indexers.home}/configure" os="${os.unix}" dir="${indexers.home}">
954            <arg value="--prefix=${basedir}"/>
955            <arg value="--libdir=${lib.jni}"/>
956        </exec>         
957    </target>
958
959  <target name="clean-packages" depends="init,clean-javagdbm,clean-indexers" description="Clean only the packages"/>
960
961  <target name="clean-javagdbm" depends="init">
962    <exec executable="make" os="${os.unix}"
963      dir="${javagdbm.home}">
964      <arg value="clean"/>
965    </exec>
966  </target>
967 
968  <target name="clean-indexers" depends="init" if="independent-indexers">
969    <exec executable="make" os="${os.unix}"
970      dir="${indexers.home}">
971      <arg value="clean"/>
972    </exec>
973    <exec executable="${indexers.home}/winMake.bat" os="${os.windows}"
974       dir="${indexers.home}">
975       <arg value="clean"/>
976    </exec>
977
978  </target>
979   
980    <target name="compile-packages" description="Compile only the source packages">
981         
982                <!-- gdbm -->
983                <antcall target="compile-gdbm" />
984
985        <!-- javagdbm -->
986        <echo>compile javagdbm</echo>
987        <exec executable="make" os="${os.unix}" dir="${javagdbm.home}"/>
988        <exec executable="make" os="${os.unix}" dir="${javagdbm.home}">
989            <arg value="install"/>
990        </exec>
991
992        <!-- windows: just the java stuff. -->
993        <echo>Windows: compile javagdbm (java only)</echo>
994        <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}">
995            <arg value="compile"/>
996            <arg value="javaonly"/>
997        </exec>
998
999        <!-- install the jar file -->
1000        <echo>Install the javagdbm jar file</echo>
1001        <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
1002
1003        <!-- Indexers -->
1004
1005        <!-- this may be in gs2build - we will be recompiling, but never mind -->
1006        <echo>Indexers: make (from ${indexers.home})</echo>
1007        <exec executable="make" os="${os.unix}" dir="${indexers.home}"/>
1008        <echo>Indexers: make install</echo>
1009        <exec executable="make" os="${os.unix}" dir="${indexers.home}">
1010            <arg value="install"/>
1011        </exec>
1012
1013        <echo>Indexers: make</echo>
1014        <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" dir="${indexers.home}">
1015            <arg value="all"/>
1016        </exec>
1017        <echo>Indexers: make install</echo>
1018        <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" dir="${indexers.home}">
1019            <arg value="install"/>
1020        </exec>
1021
1022        <!-- install the jar and jni files -->
1023        <echo>Install the indexers' jar and jni files</echo>
1024        <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
1025        <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
1026        <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/>
1027        <antcall target="install-jni-files"/>
1028    </target>
1029
1030  <target name="install-jni-files" depends="init,install-jni-files-linux,install-jni-files-windows,install-jni-files-macos"/>
1031
1032    <target name="install-jni-files-linux" depends="init" if="current.os.isunixnotmac">
1033    <copy file="${mg.home}/jni/libmgretrievejni.so" todir="${lib.jni}"/>
1034    <copy file="${mg.home}/jni/libmgsearchjni.so" todir="${lib.jni}"/>
1035     <copy file="${mg.home}/jni/libmgpassjni.so" todir="${lib.jni}"/>
1036    <copy file="${mgpp.home}/jni/libmgppretrievejni.so" todir="${lib.jni}"/>
1037    <copy file="${mgpp.home}/jni/libmgppsearchjni.so" todir="${lib.jni}"/>
1038     <copy file="${mgpp.home}/jni/libmgpppassjni.so" todir="${lib.jni}"/>
1039   </target>
1040   <target name="install-jni-files-windows" depends="init" if="current.os.iswindows">
1041    <copy file="${mg.home}/jni/mgretrievejni.dll" todir="${lib.jni}"/>
1042    <copy file="${mg.home}/jni/mgsearchjni.dll" todir="${lib.jni}"/>
1043     <copy file="${mg.home}/jni/mgpassjni.dll" todir="${lib.jni}"/>
1044    <copy file="${mgpp.home}/jni/mgppretrievejni.dll" todir="${lib.jni}"/>
1045    <copy file="${mgpp.home}/jni/mgppsearchjni.dll" todir="${lib.jni}"/>
1046     <copy file="${mgpp.home}/jni/mgpppassjni.dll" todir="${lib.jni}"/>
1047   </target>
1048   <target name="install-jni-files-macos" depends="init" if="current.os.ismac">
1049    <copy file="${mg.home}/jni/libmgretrievejni.jnilib" todir="${lib.jni}"/>
1050    <copy file="${mg.home}/jni/libmgsearchjni.jnilib" todir="${lib.jni}"/>
1051     <copy file="${mg.home}/jni/libmgpassjni.jnilib" todir="${lib.jni}"/>
1052    <copy file="${mgpp.home}/jni/libmgppretrievejni.jnilib" todir="${lib.jni}"/>
1053    <copy file="${mgpp.home}/jni/libmgppsearchjni.jnilib" todir="${lib.jni}"/>
1054     <copy file="${mgpp.home}/jni/libmgpppassjni.jnilib" todir="${lib.jni}"/>
1055   </target>
1056 
1057  <!-- ================== gs2building targets ===============-->
1058
1059
1060  <target name="update-gs2building" if="collection.building.enabled"
1061    depends="init,svnupdate-gs2building,rename-gs2build-files,configure-gs2building,clean-gs2building,compile-gs2building"
1062    description="Update only the Greenstone 2 building components"/>
1063
1064  <target name="svnupdate-gs2building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nocvs.mode">
1065  </target>
1066  <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nocvs.mode">
1067    <!-- Note: can't do a -d update here cos it will get all of gsdl
1068     also, an update doesn't get new files, so we do a checkout instead. -->
1069        <antcall target="checkout-gs2build"/>
1070  </target>
1071 
1072  <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nocvs.mode">
1073    <svn>
1074        <update dir="${gli.home}"/>
1075    </svn>
1076  </target>
1077
1078  <target name="prepare-gs2building" depends="init,prepare-gs2build,prepare-gli" if="collection.building.enabled">
1079  </target>
1080
1081  <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nocvs.mode">
1082    <echo>checking out gs2build</echo>
1083        <!-- svn checkouts -->
1084        <svn>
1085            <!-- perllib -->
1086            <checkout url="${svn.root}/gsdl/${branch.path}/perllib" destPath="gs2build/perllib"/>
1087
1088            <!-- selected packages -->
1089            <checkout url="${svn.root}/gsdl/${branch.path}/packages/cpan" destPath="gs2build/packages/cpan"/>
1090            <checkout url="${svn.root}/gsdl/${branch.path}/packages/expat" destPath="gs2build/packages/expat"/>
1091            <checkout url="${svn.root}/gsdl/${branch.path}/packages/html-tidy" destPath="gs2build/packages/html-tidy"/>
1092            <checkout url="${svn.root}/gsdl/${branch.path}/packages/isis-gdl" destPath="gs2build/packages/isis-gdl"/>
1093            <checkout url="${svn.root}/gsdl/${branch.path}/packages/kea" destPath="gs2build/packages/kea"/>
1094            <checkout url="${svn.root}/gsdl/${branch.path}/packages/pdftohtml" destPath="gs2build/packages/pdftohtml"/>
1095            <checkout url="${svn.root}/gsdl/${branch.path}/packages/rtftohtml" destPath="gs2build/packages/rtftohtml"/>
1096            <checkout url="${svn.root}/gsdl/${branch.path}/packages/w3mir" destPath="gs2build/packages/w3mir"/>
1097            <checkout url="${svn.root}/gsdl/${branch.path}/packages/wget" destPath="gs2build/packages/wget"/>
1098            <checkout url="${svn.root}/gsdl/${branch.path}/packages/windows" destPath="gs2build/packages/windows"/>
1099            <checkout url="${svn.root}/gsdl/${branch.path}/packages/wv" destPath="gs2build/packages/wv"/>
1100            <checkout url="${svn.root}/gsdl/${branch.path}/packages/xlhtml" destPath="gs2build/packages/xlhtml"/>
1101            <checkout url="${svn.root}/gsdl/${branch.path}/packages/yaz" destPath="gs2build/packages/yaz"/>
1102           
1103            <!-- some of src (db2txt hashfile phind txt2db) -->
1104            <checkout url="${svn.root}/gsdl/${branch.path}/src/db2txt" destPath="gs2build/src/db2txt"/>
1105            <checkout url="${svn.root}/gsdl/${branch.path}/src/hashfile" destPath="gs2build/src/hashfile"/>
1106            <checkout url="${svn.root}/gsdl/${branch.path}/src/phind" destPath="gs2build/src/phind"/>
1107            <checkout url="${svn.root}/gsdl/${branch.path}/src/txt2db" destPath="gs2build/src/txt2db"/>
1108
1109            <!-- bin -->
1110            <checkout url="${svn.root}/gsdl/${branch.path}/bin/script" destPath="gs2build/bin/script"/>
1111
1112            <!-- mappings -->
1113            <checkout url="${svn.root}/gsdl/${branch.path}/mappings" destPath="gs2build/mappings"/>
1114
1115            <!-- etc/packages -->
1116            <checkout url="${svn.root}/gsdl/${branch.path}/etc/packages" destPath="gs2build/etc/packages"/>
1117   
1118            <!-- collect -->
1119            <checkout url="${svn.root}/gsdl/${branch.path}/collect/modelcol" destPath="gs2build/collect/modelcol"/>
1120
1121            <!-- gs2build-extra -->
1122            <checkout url="${svn.root}/other-projects/trunk/gs2build-extra" destPath="gs2build/gs2build-extra"/>
1123
1124            <!-- indexers -->
1125            <checkout url="${svn.root}/indexers/${branch.path}" destPath="gs2build/indexers"/>
1126
1127
1128        </svn>
1129        <!-- regular downloads -->
1130
1131        <!-- some files from lib -->
1132        <mkdir dir="gs2build/lib"/>
1133        <get src="${svn.root}/gsdl/${branch.path}/lib/text_t.h" dest="gs2build/lib/text_t.h"/>
1134        <get src="${svn.root}/gsdl/${branch.path}/lib/text_t.cpp" dest="gs2build/lib/text_t.cpp"/>
1135        <get src="${svn.root}/gsdl/${branch.path}/lib/gsdlconf.h" dest="gs2build/lib/gsdlconf.h"/>
1136
1137        <!-- some files from etc -->
1138        <get src="${svn.root}/gsdl/${branch.path}/etc/marctodc.txt" dest="gs2build/etc/marctodc.txt"/>
1139        <get src="${svn.root}/gsdl/${branch.path}/etc/dc2marc-mapping.xml" dest="gs2build/etc/dc2marc-mapping.xml"/>
1140        <get src="${svn.root}/gsdl/${branch.path}/etc/dc2marc.xsl" dest="gs2build/etc/dc2marc.xsl"/>
1141        <get src="${svn.root}/gsdl/${branch.path}/etc/qdc2marc-mapping.xml" dest="gs2build/etc/qdc2marc-mapping.xml"/>
1142
1143        <!-- some files from the gsdl root directory -->
1144        <get src="${svn.root}/gsdl/${branch.path}/setup.bash" dest="gs2build/setup.bash"/>
1145        <get src="${svn.root}/gsdl/${branch.path}/config.sub" dest="gs2build/config.sub"/>
1146        <get src="${svn.root}/gsdl/${branch.path}/config.guess" dest="gs2build/config.guess"/>
1147        <get src="${svn.root}/gsdl/${branch.path}/config.h.in" dest="gs2build/config.h.in"/>
1148        <get src="${svn.root}/gsdl/${branch.path}/configtest.pl" dest="gs2build/configtest.pl"/>
1149        <get src="${svn.root}/gsdl/${branch.path}/install-sh" dest="gs2build/install-sh"/>
1150        <get src="${svn.root}/gsdl/${branch.path}/acconfig.h" dest="gs2build/acconfig.h"/>
1151        <get src="${svn.root}/gsdl/${branch.path}/aclocal.m4" dest="gs2build/aclocal.m4"/>
1152        <get src="${svn.root}/gsdl/${branch.path}/WIN32cfg.h" dest="gs2build/WIN32cfg.h"/>
1153
1154    </target>
1155
1156  <target name="prepare-gs2build" depends="init" if="collection.building.enabled" unless="gs2build.present">
1157    <antcall target="checkout-gs2build"/>
1158    <antcall target="rename-gs2build-files"/>
1159    <antcall target="unzip-windows-packages"/>
1160    <antcall target="checkout-winbin"/>
1161    <antcall target="get-windows-binaries"/>
1162    <antcall target="delete-winbin"/>
1163    <antcall target="get-macos-extra"/>
1164  </target>
1165
1166  <target name="checkout-winbin" depends="init" if="current.os.iswindows"
1167    unless="nocvs.mode">
1168    <svn>
1169        <checkout url="${svn.root}/other-projects/trunk/winbin" destPath="${basedir}/winbin"/>
1170    </svn> 
1171  </target>
1172
1173  <target name="update-winbin" depends="init" if="current.os.iswindows" unless="nocvs.mode">
1174        <svn>
1175            <update dir="winbin"/>
1176        </svn> 
1177    </target>
1178 
1179  <target name="get-windows-binaries" depends="init" if="collection.building.enabled.windows">
1180    <move todir="${gs2build.home}/bin/windows" failonerror="false">
1181      <fileset dir="${basedir}/winbin/bin"/>
1182    </move>
1183  </target>
1184  <target name="delete-winbin" depends="init" if="collection.building.enabled.windows">
1185    <delete dir="${basedir}/winbin"/>
1186  </target>
1187 
1188  <target name="unzip-windows-packages" depends="init" if="collection.building.enabled.windows"> 
1189    <unzip src="${gs2build.home}/packages/windows/gdbm/gdbm.zip"
1190    dest="${gs2build.home}/packages/windows/gdbm"/>
1191   <unzip src="${gs2build.home}/packages/windows/crypt/crypt.zip"
1192    dest="${gs2build.home}/packages/windows/crypt"/>
1193       <unzip src="${gs2build.home}/packages/windows/expat/expat.zip"
1194    dest="${gs2build.home}/packages/windows/expat"/>
1195   </target>
1196 
1197  <!-- downloads a good XML-Parser -->
1198  <target name="get-macos-extra" depends="init" if="need.macos.extra"> 
1199      <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz"
1200      dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1201      usetimestamp="true"/>
1202  </target> 
1203
1204  <!-- untars the XML-Parser. need to do this after compiling in gs2build-->
1205  <target name="install-macos-extra" depends="init,get-macos-extra" if="need.macos.extra">
1206    <!-- make sure these directories are present, otherwise chmod craps out
1207    this chmod is needed in case we are unpacking for a second time -->
1208    <mkdir dir="${gs2build.home}/perllib/cpan/perl-5.8"/>
1209    <mkdir dir="${gs2build.home}/perllib/cpan/perl-5.6"/>
1210    <chmod dir="${gs2build.home}/perllib/cpan/perl-5.8" perm="ug+w" includes="**"/>
1211    <chmod dir="${gs2build.home}/perllib/cpan/perl-5.6" perm="ug+w" includes="**"/>
1212    <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1213      dest="${gs2build.home}/perllib/cpan/"
1214      compression="gzip"/>
1215  </target>
1216
1217  <target name="install-indexer-files" depends="init" unless="indexers.present">
1218    <copy todir="${indexers.home}">
1219      <fileset dir="${gs2build.home}/indexers" />
1220    </copy>
1221    <chmod file="${indexers.home}/configure" perm="a+x"/>
1222  </target>
1223
1224  <target name="rename-gs2build-files" depends="rename-gs2build-files-unix,rename-gs2build-files-windows,gs2build-edit-setup-bat" if="collection.building.enabled"/>
1225 
1226  <target name="gs2build-edit-setup-bat" if="collection.building.enabled.windows">
1227    <!-- we want a windows path in the setup.bat file -->
1228    <pathconvert targetos="windows" property="gs2build.home.windows">
1229      <path path="${gs2build.home}"/>
1230    </pathconvert>
1231    <move file="${gs2build.home}/setup.bat" tofile="${gs2build.home}/setup-tmp.bat">
1232      <filterset>
1233    <filter token="gsdlhome" value="${gs2build.home.windows}"/>
1234     </filterset>
1235    </move> 
1236    <move file="${gs2build.home}/setup-tmp.bat" tofile="${gs2build.home}/setup.bat" />
1237  </target>
1238 
1239  <target name="rename-gs2build-files-windows" if="collection.building.enabled.windows">
1240    <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
1241    <copy file="${gs2build-extra.home}/lib.win32.mak" tofile="${gs2build.home}/lib/win32.mak"/>
1242    <copy file="${gs2build-extra.home}/win32.mak" tofile="${gs2build.home}/win32.mak"/>
1243    <copy file="${gs2build-extra.home}/setup.bat" tofile="${gs2build.home}/setup.bat"/>
1244  </target>
1245 
1246  <target name="rename-gs2build-files-unix" if="collection.building.enabled.unix">
1247    <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
1248    <copy file="${gs2build-extra.home}/configure" tofile="${gs2build.home}/configure"/>   
1249    <chmod file="${gs2build.home}/configure" perm="a+x"/>
1250    <copy file="${gs2build-extra.home}/configure.in" tofile="${gs2build.home}/configure.in"/>
1251    <copy file="${gs2build-extra.home}/Makefile.in" tofile="${gs2build.home}/Makefile.in"/> 
1252    <copy file="${gs2build-extra.home}/packages.configure" tofile="${gs2build.home}/packages/configure"/>
1253    <chmod file="${gs2build.home}/packages/configure" perm="a+x"/>
1254    <copy file="${gs2build-extra.home}/packages.Makefile.in" tofile="${gs2build.home}/packages/Makefile.in"/>
1255    <copy file="${gs2build-extra.home}/lib.Makefile.in" tofile="${gs2build.home}/lib/Makefile.in"/> 
1256  </target>
1257 
1258  <target name="prepare-gli" depends="init" if="collection.building.enabled" unless="gli.present">
1259    <antcall target="checkout-gli"/>
1260  </target>
1261 
1262<!--  <target name="checkout-gli" depends="check-cvsroot,init" if="collection.building.enabled" unless="nocvs.mode"> -->
1263  <target name="checkout-gli" depends="init" if="collection.building.enabled" unless="nocvs.mode">
1264    <echo>checking out gli</echo>
1265    <svn>
1266        <checkout url="${svn.root}/gli/${branch.path}" destPath="gli"/>
1267    </svn>
1268  </target>
1269   
1270  <target name="configure-gs2building" depends="init" if="collection.building.enabled"
1271    description="Configure only the Greenstone 2 building components">
1272    <exec executable="${gs2build.home}/configure" os="${os.linux},${os.solaris}"
1273      dir="${gs2build.home}">
1274      <arg value="--prefix=${gs2build.home}"/>
1275    </exec>
1276    <exec executable="${gs2build.home}/configure" os="${os.mac}"
1277      dir="${gs2build.home}">
1278      <arg value="--prefix=${gs2build.home}"/>
1279      <arg value="--with-gdbm=${gdbm.installed.path}"/>
1280    </exec>
1281  </target>
1282
1283  <target name="clean-gs2building" depends="init,clean-gli,clean-gs2build"
1284    description="Clean only the Greenstone 2 building components"
1285    if="collection.building.enabled"/>
1286 
1287  <target name="clean-gli" depends="init" if="collection.building.enabled">
1288    <!-- gli -->
1289    <property name="gli.home" value="${basedir}/gli"/>
1290    <!-- linux -->
1291    <exec executable="clean.sh" os="${os.unix}" dir="${gli.home}"
1292      resolveExecutable="true"/>
1293    <!-- windows -->
1294    <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
1295      resolveExecutable="true"/>
1296  </target>
1297 
1298  <target name="clean-gs2build" depends="init" if="collection.building.enabled">
1299    <!-- gs2build -->
1300    <!--linux:  -->
1301    <exec executable="make" os="${os.unix}" dir="${gs2build.home}">
1302      <arg value="clean"/>
1303    </exec>
1304    <!-- windows: -->   
1305    <!-- run the setup script -->
1306    <exec executable="${compile.windows.c++.setup}" os="${os.windows}" />
1307    <exec executable="nmake" dir="${gs2build.home}" os="${os.windows}" >
1308     <arg value="/f"/>
1309     <arg value="win32.mak"/>
1310     <arg value="clean"/>
1311    </exec>
1312  </target>
1313 
1314  <target name="distclean-gs2build" depends="init" if="collection.building.enabled">
1315    <!-- gs2build -->
1316    <!--linux:  -->
1317    <exec executable="make" os="${os.unix}" dir="${gs2build.home}">
1318      <arg value="distclean"/>
1319    </exec>
1320    <!-- windows: -->   
1321  </target>
1322 
1323  <target name="compile-gs2building" depends="init,compile-gs2build,compile-gli" if="collection.building.enabled"
1324    description="Compile only the Greenstone 2 building components">
1325  </target>
1326 
1327  <target name="compile-gli" depends="init" if="collection.building.enabled">
1328    <!-- gli -->
1329    <property name="gli.home" value="${basedir}/gli"/>
1330
1331        <!-- change the version number -->
1332        <rsr file="${gli.home}/src/org/greenstone/gatherer/Gatherer.java" pattern="^(.*)String\s*PROGRAM_VERSION\s*=\s*&quot;(.*)&quot;" replacement="$1String PROGRAM_VERSION = &quot;${app.version}&quot;"/>
1333    <!-- linux -->
1334    <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}" resolveExecutable="true"/>
1335     <!--remote gli-->
1336     <exec executable="makejar.sh" os="${os.unix}" dir="${gli.home}"
1337      resolveExecutable="true"/>
1338    <!-- windows -->
1339    <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}" resolveExecutable="true"/>
1340    <!--remote gli-->
1341     <exec executable="makejar.bat" os="${os.windows}" dir="${gli.home}"
1342      resolveExecutable="true"/>
1343     <copy file="${gli.home}/GLIServer.jar" todir="${gs2build.home}/bin/java" />
1344  </target>
1345 
1346  <target name="compile-gs2build" depends="init" if="collection.building.enabled">
1347    <!-- gs2build -->
1348    <!--linux: make, make install -->
1349    <exec executable="make" os="${os.unix}" dir="${gs2build.home}">
1350    </exec>
1351    <exec executable="make" os="${os.unix}" dir="${gs2build.home}">
1352      <arg value="install"/>
1353    </exec>
1354    <!-- run the setup script -->
1355    <exec executable="${compile.windows.c++.setup}" os="${os.windows}"/>
1356    <exec executable="nmake" dir="${gs2build.home}" os="${os.windows}">
1357     <arg value="/f"/>
1358     <arg value="win32.mak"/>
1359    </exec>
1360    <exec executable="nmake" dir="${gs2build.home}" os="${os.windows}">
1361     <arg value="/f"/>
1362     <arg value="win32.mak"/>
1363     <arg value="install"/>
1364    </exec>
1365    <!-- LuceneWrapper jar file not installed by default -->
1366    <mkdir dir="${gs2build.home}/bin/java"/>
1367    <copy file="${lucene.home}/LuceneWrapper.jar" todir="${gs2build.home}/bin/java"/>
1368    <antcall target="install-gs2build-indexers-windows"/>
1369    <antcall target="install-macos-extra"/>
1370  </target>
1371 
1372  <target name="install-gs2build-indexers-windows" depends="init" if="collection.building.enabled.windows">
1373    <copy todir="${gs2build.home}/bin/windows">
1374      <fileset dir="${gs2build.home}/indexers/bin">
1375    <include name="*.*"/>
1376      </fileset>
1377    </copy>
1378  </target>
1379
1380  <target name="gli" description="Run the Greenstone Librarian Interface" depends="init" if="collection.building.enabled">
1381    <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.linux},${os.solaris}" dir="${basedir}/gli" spawn="true">
1382      <env key="gsdl3path" path="${basedir}"/>
1383      <env key="gsdlpath" path="${basedir}/gs2build"/>
1384    </exec>
1385    <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
1386      <env key="gsdl3path" path="${basedir}"/>
1387      <env key="gsdlpath" path="${basedir}/gs2build"/>
1388      <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.installed.path}/lib"/>
1389    </exec>
1390    <exec executable="${basedir}/gli/gli4gs3.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
1391      <env key="GSDL3PATH" path="${basedir}"/>
1392      <env key="GSDLPATH" path="${basedir}/gs2build"/>
1393    </exec>
1394    <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 gli4gs3.sh/bat from the greenstone3/gli directory.
1395    </echo>
1396  </target>
1397 
1398
1399<!-- ======================== TESTING Targets ========================= -->
1400 
1401  <target name="test" description="Run the (incomplete) JUnit test suite "
1402    depends="init">
1403    <mkdir dir="${basedir}/test"/>
1404    <junit printsummary="withOutAndErr"
1405      errorproperty="test.failed"
1406      failureproperty="test.failed"
1407      fork="${junit.fork}">
1408      <formatter type="plain"/>
1409      <classpath>
1410    <pathelement location="${build.home}/gsdl3test.jar"/>
1411    <path refid="compile.classpath"/>
1412      </classpath>
1413      <test name="${testcase}" if="testcase"/>
1414      <batchtest todir="${basedir}/test" unless="testcase">
1415    <fileset dir="${build.home}"
1416      includes="**/*Test.class"
1417      />
1418      </batchtest>
1419    </junit>
1420    <echo>
1421      *********************************************
1422       Test output can be found in directory 'test'
1423      *********************************************
1424    </echo>
1425  </target>
1426  <target name="checkout-flax" description="check out flax source code from another repository">
1427    <echo>checking out flax ...</echo>
1428    <mkdir dir="${basedir}/src/java/org/flax"/>
1429    <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
1430    <mkdir dir="${basedir}/web/WEB-INF/classes/flax"/>
1431    <mkdir dir="${basedir}/web/interfaces/flax"/>
1432    <mkdir dir="${basedir}/web/sites/flax"/>
1433    <svn>
1434      <checkout url="${flax.svn.root}/flax1.0/trunk/src/java/org/flax/" 
1435                destPath="${basedir}/src/java/org/flax"/>
1436      <checkout url="${flax.svn.root}/flax1.0/trunk/src/java/org/greenstone/gsdl3/flax/"
1437                destPath="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
1438      <checkout url="${flax.svn.root}/flax1.0/trunk/web/WEB-INF/classes/flax/"
1439                destPath="${basedir}/web/WEB-INF/classes/flax"/>
1440      <checkout url="${flax.svn.root}/flax1.0/trunk/web/interfaces/flax/"
1441                destPath="${basedir}/web/interfaces/flax"/>
1442      <checkout url="${flax.svn.root}/flax1.0/trunk/web/sites/flax/"
1443                destPath="${basedir}/web/sites/flax"/>
1444      <checkout url="${flax.svn.root}/flax1.0/trunk/flax-resources"
1445                destPath="${basedir}"/>
1446    </svn>
1447    <move file="${basedir}/web/WEB-INF/web.xml" tofile="${basedir}/web/WEB-INF/web.xml.greenstone3backup"/>
1448    <svncall target="flax-copy-files" />
1449
1450    <property name="coll.dir" value="${basedir}/web/sites/flax/collect"/>
1451    <unzip dest="${coll.dir}"> 
1452       <fileset dir="${coll.dir}">
1453          <include name="*.zip"/>
1454       </fileset>   
1455    </unzip>   
1456    <delete>
1457     <fileset dir="${coll.dir}" includes="*.zip"/>
1458    </delete>
1459  </target>
1460    <target name="update-flax" description="update flax from repository">
1461      <echo>updating flax ...</echo>
1462      <svn>
1463        <update dir="${basedir}/src/java/org/flax"/>
1464        <update dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
1465        <update dir="${basedir}/web/WEB-INF/classes/flax"/>
1466        <update dir="${basedir}/web/interfaces/flax"/>
1467        <update dir="${basedir}/web/sites/flax"/>
1468        <svncall target="flax-copy-files" />
1469      </svn>
1470    </target>
1471    <target name="flax-copy-files" description="copy some flax files into the appropriate greenstone3 directories">
1472      <echo>copying flax files ...</echo>
1473      <copy file="${basedir}/web/WEB-INF/classes/flax/web.xml" todir="${basedir}/web/WEB-INF" overwrite="true" />
1474      <!-- A configuration file containing web service binding information for the axis engine -->
1475      <copy file="${basedir}/web/WEB-INF/classes/flax/server-config.wsdd" todir="${basedir}/web/WEB-INF" overwrite="true" />
1476    </target>
1477      <!--install gdbm stuff -->
1478
1479  <!-- downloads the gdbm library -->
1480  <target name="prepare-gdbm" depends="init" if="install.gdbm">
1481      <get src="http://www.greenstone.org/gs3files/gdbm-1.8.3.tar.gz"
1482       dest="${src.packages.home}/gdbm-1.8.3.tar.gz"  usetimestamp="true"/>
1483      <untar compression= "gzip" src="${src.packages.home}/gdbm-1.8.3.tar.gz" dest="${src.packages.home}" /> 
1484      <chmod dir="${src.packages.home}/gdbm-1.8.3" perm="ugo+wrx" includes="**" />
1485  </target> 
1486
1487   <target name="configure-gdbm" if="install.gdbm">
1488    <echo>
1489      Configuring GDBM
1490    </echo>
1491    <exec executable="${gdbm.home}/configure" os="${os.mac},${os.unix}"
1492      dir="${gdbm.home}">
1493      <arg value="--prefix=${gdbm.home}"/>
1494    </exec>   
1495   </target>
1496
1497 <target name="clean-gdbm" depends="init"  if="install.gdbm">   
1498    <echo>clean GDBM</echo>
1499    <exec executable="make" os="${os.unix},${os.mac}" dir="${gdbm.home}" >
1500     <arg value="clean"/>
1501    </exec>
1502  </target>
1503
1504  <target name="compile-gdbm" depends="init"  if="install.gdbm">   
1505    <echo>compile GDBM</echo>
1506    <exec executable="make" os="${os.unix},${os.mac}" dir="${gdbm.home}"/>
1507    <exec executable="make" os="${os.unix},${os.mac}" dir="${gdbm.home}">
1508      <arg value="install"/>
1509    </exec>
1510  </target>
1511
1512
1513
1514</project>
1515
1516
Note: See TracBrowser for help on using the browser.