source: trunk/gsdl3/build.xml@ 13733

Last change on this file since 13733 was 13733, checked in by kjdon, 17 years ago

updated for new indexers package. This works for when we have no collection building. Next we need to make it work when there is collection building

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