source: greenstone3/trunk/build.xml@ 15185

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

changed nocvs.mode to nosvn.mode; added a distclean target and the necessary supporting targets. change basedir/web to web.home in the flax targets; removed some commented out stuff

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