source: greenstone3/trunk/build.xml@ 19996

Last change on this file since 19996 was 19996, checked in by oranfry, 13 years ago

can't use compile.bat anymore as it doesn't exist, do the proper make, make install instead

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