source: greenstone3/trunk/build.xml@ 16628

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

When executing ant start or ant stop on Windows, the exec command now passes catalina.home env variable just like it already did for Linux. Otherwise the tomcat startup.bat script was guessing the location for catalina when on Windows (since it wasn't set previously) and guessing the location incorrectly as tomcat/bin instead of tomcat.

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