source: greenstone3/trunk/build.xml@ 15837

Last change on this file since 15837 was 15837, checked in by ak19, 16 years ago

Dr Nichols' ant prepare-collections works and so commented out the old code to extract demo-collections again

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