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

Last change on this file since 15787 was 15787, checked in by oranfry, 16 years ago

updating from trunk: brought in trunk changes from r15191 to r15785

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