source: trunk/gsdl3/build.xml@ 10882

Last change on this file since 10882 was 10882, checked in by kjdon, 18 years ago

moved the prepare mysql stuff into its own parepare-for-dist target -sometimes it goes wrong, and we need to run it again

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