source: greenstone3/trunk/build.xml@ 15229

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