source: greenstone3/trunk/build.xml@ 15183

Last change on this file since 15183 was 15183, checked in by kjdon, 16 years ago

just tidied up the indentation using emacs, no other changes

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