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

Last change on this file since 14570 was 14570, checked in by oranfry, 17 years ago

modifying the build script to take a version number parameter

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