source: greenstone3/trunk/build.xml@ 18184

Last change on this file since 18184 was 18184, checked in by ak19, 15 years ago

Some tentative adjustments for GS3 to use the gdbm that Michael Dewsnip customised (inside gs2build's common-src) instead of checking out a regular version of gdbm

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