source: greenstone3/trunk/build.xml@ 15241

Last change on this file since 15241 was 15241, checked in by davidb, 14 years ago

db2txt and txt2db are now group together in folder gdbmedit

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