source: greenstone3/trunk/build.xml@ 15187

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

removed os.mac from os attribute for gdbm targets as os.unix includes macs. moved version number stuff for tomcat, axis, gdbm into a property so its easy to change if we change versions

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