source: greenstone3/trunk/build.xml@ 15335

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

Moved web services property constants into build.properties file so that developers need not modify build.xml if they are adding new web services

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