source: greenstone3/trunk/build.xml@ 16944

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

tidied up whitespace in the build.xml file to make it easier to read and edit

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