source: greenstone3/trunk/build.xml@ 14995

Last change on this file since 14995 was 14995, checked in by oranfry, 16 years ago

changed a URL to a filesystem path

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