source: greenstone3/branches/customizingGreenstone3/build.xml@ 15191

Last change on this file since 15191 was 15191, checked in by dmn, 16 years ago

updating branch from trunk

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