source: greenstone3/branches/3.03/build.xml@ 14566

Last change on this file since 14566 was 14566, checked in by oranfry, 15 years ago

starting to purge the repository of hard-coded version numbers, so I can implement a version number parameter to the release maker script

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