source: greenstone3/trunk/build.xml@ 17918

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

Commit message covers previous commit as well: GAI.jar (Greenstone Administrator Interface) was created but not copied to the correct location previously. Dr Nichols identified this omission.

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