source: trunk/gsdl3/build.xml@ 10829

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

prepare-for-dist should delete the build directory

  • Property svn:keywords set to Author Date Id Revision
File size: 64.8 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 </target>
363
364 <target name="setup-proxy" depends="init" if="proxy.present">
365 <condition property="ask.user">
366 <or>
367 <equals arg1="" arg2="${proxy.user}"/>
368 <equals arg1="" arg2="${proxy.password}"/>
369 </or>
370 </condition>
371 <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}" userproperty="proxy.username" pwordproperty="proxy.password"/>
372 <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
373 </target>
374
375 <!-- ========== Web app Targets ================================ -->
376
377 <target name="prepare-web">
378 <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
379 <!-- gs3mgdemo -->
380 <unzip src="${collect.dir}/gs3mgdemo/import.zip"
381 dest="${collect.dir}/gs3mgdemo"/>
382 <unzip src="${collect.dir}/gs3mgdemo/archives.zip"
383 dest="${collect.dir}/gs3mgdemo"/>
384 <unzip src="${collect.dir}/gs3mgdemo/index/index.zip"
385 dest="${collect.dir}/gs3mgdemo/index"/>
386 <delete file="${collect.dir}/gs3mgdemo/import.zip"/>
387 <delete file="${collect.dir}/gs3mgdemo/archives.zip"/>
388 <delete file="${collect.dir}/gs3mgdemo/index/index.zip"/>
389 <!-- gs2mgdemo -->
390 <unzip src="${collect.dir}/gs2mgdemo/import.zip"
391 dest="${collect.dir}/gs2mgdemo"/>
392 <unzip src="${collect.dir}/gs2mgdemo/metadata.zip"
393 dest="${collect.dir}/gs2mgdemo"/>
394 <unzip src="${collect.dir}/gs2mgdemo/index/index.zip"
395 dest="${collect.dir}/gs2mgdemo/index"/>
396 <delete file="${collect.dir}/gs2mgdemo/import.zip"/>
397 <delete file="${collect.dir}/gs2mgdemo/metadata.zip"/>
398 <delete file="${collect.dir}/gs2mgdemo/index/index.zip"/>
399 <!-- gs2mgppdemo -->
400 <unzip src="${collect.dir}/gs2mgppdemo/import.zip"
401 dest="${collect.dir}/gs2mgppdemo"/>
402 <unzip src="${collect.dir}/gs2mgppdemo/metadata.zip"
403 dest="${collect.dir}/gs2mgppdemo"/>
404 <unzip src="${collect.dir}/gs2mgppdemo/index/index.zip"
405 dest="${collect.dir}/gs2mgppdemo/index"/>
406 <delete file="${collect.dir}/gs2mgppdemo/import.zip"/>
407 <delete file="${collect.dir}/gs2mgppdemo/metadata.zip"/>
408 <delete file="${collect.dir}/gs2mgppdemo/index/index.zip"/>
409 <!-- gberg -->
410 <unzip src="${collect.dir}/gberg/index/index.zip"
411 dest="${collect.dir}/gberg/index"/>
412 <delete file="${collect.dir}/gberg/index/index.zip"/>
413 <mkdir dir="${web.home}/applet"/>
414
415 <condition property="need.xml.jars">
416 <equals arg1="1.5" arg2="${ant.java.version}"/>
417 </condition>
418 <antcall target="rename-xml-jars"/>
419 </target>
420
421 <target name="rename-xml-jars" if="need.xml.jars">
422 <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/>
423 <copy file="${web.lib}/xercesImpl.jar.tmp" tofile="${web.lib}/xercesImpl.jar"/>
424 </target>
425
426 <target name="configure-web" depends="init,get-mysql-reader-password,get-mysql-admin-password"
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 <!-- just in case these haven't been defined, we need something to write to
433 the file -->
434 <property name="mysql.admin.password" value=" "/>
435 <property name="mysql.reader.password" value=" "/>
436 <filter token="gsdl3home" value="${gsdl3.home.unix}"/>
437 <filter token="mysql.port" value="${mysql.port}"/>
438 <filter token="mysql.server" value="${mysql.server}"/>
439 <filter token="mysql.admin.pword" value="${mysql.admin.password}"/>
440 <filter token="mysql.reader.pword" value="${mysql.reader.password}"/>
441 <filter token="tomcat.server" value="${tomcat.server}"/>
442 <filter token="tomcat.port" value="${tomcat.port}"/>
443 <copy file="${basedir}/resources/java/global.properties.in" tofile="${web.classes}/global.properties" filtering="true" overwrite="true"/>
444 <chmod file="${web.classes}/global.properties" perm="600"/>
445 </target>
446
447 <target name="compile-web" depends="init">
448 <javac srcdir="${web.classes}"
449 destdir="${web.classes}"
450 debug="${compile.debug}"
451 deprecation="${compile.deprecation}"
452 optimize="${compile.optimize}">
453 <classpath>
454 <path refid="compile.classpath"/>
455 </classpath>
456 </javac>
457 </target>
458
459 <target name="cvsupdate-web" unless="nocvs.mode">
460 <cvs command="update -dP" dest="${web.home}"/>
461 </target>
462
463 <target name="update-web" depends="init,cvsupdate-web,configure-web"
464 description="update only the web stuff (config files)"/>
465
466
467<!-- ======================= Tomcat Targets ========================== -->
468
469 <!-- this target sets up tomcat for the first time, or resets it any subsequent times -->
470 <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal">
471 <get src="http://www.greenstone.org/gs3files/apache-tomcat-5.5.12.zip"
472 dest="${packages.home}/apache-tomcat-5.5.12.zip"
473 usetimestamp="true"/>
474 <delete dir="${packages.home}/tomcat.bak"/>
475 <move todir="${packages.home}/tomcat.bak" failonerror="false">
476 <fileset dir="${packages.home}/tomcat"/>
477 </move>
478 <unzip src="${packages.home}/apache-tomcat-5.5.12.zip"
479 dest="${packages.home}"/>
480 <condition property="need.tomcat.compat">
481 <equals arg1="1.4" arg2="${ant.java.version}"/>
482 </condition>
483 <antcall target="prepare-tomcat-compat"/>
484 <move todir="${packages.home}/tomcat">
485 <fileset dir="${packages.home}/apache-tomcat-5.5.12"/>
486 </move>
487 <copy file="${packages.home}/tomcat-extra/setclasspath.bat"
488 tofile="${packages.home}/tomcat/bin/setclasspath.bat"
489 overwrite="true"/>
490 <copy file="${packages.home}/tomcat-extra/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 </target>
497
498
499 <target name="prepare-tomcat-compat" if="need.tomcat.compat">
500 <get src="http://www.greenstone.org/gs3files/apache-tomcat-5.5.12-compat.zip"
501 dest="${packages.home}/apache-tomcat-5.5.12-compat.zip"
502 usetimestamp="true"/>
503 <unzip src="${packages.home}/apache-tomcat-5.5.12-compat.zip"
504 dest="${packages.home}"/>
505 <copy file="${packages.home}/apache-tomcat-5.5.12/common/endorsed/xml-apis.jar"
506 tofile="${web.applet}/xml-apis.jar"/>
507 <copy file="${packages.home}/apache-tomcat-5.5.12/common/endorsed/xercesImpl.jar"
508 tofile="${web.applet}/xercesImpl.jar"/>
509 </target>
510
511 <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/>
512
513 <target name="configure-tomcat-local" depends="init" if="tomcat.islocal">
514 <!-- re-setup the server.xml file -->
515 <copy file="${packages.home}/tomcat-extra/server.xml.in" tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true">
516 <filterset>
517 <filter token="port" value="${tomcat.port}"/>
518 <filter token="gsdl3home" value="${basedir}"/>
519 </filterset>
520 </copy>
521 </target>
522
523 <target name="configure-tomcat-external" depends="init" unless="tomcat.islocal">
524 <!-- re-setup the server.xml file -->
525 <!-- need to edit the config file, or do we get the user to do this???-->
526 </target>
527
528 <target name="reload" description="Reload web application"
529 depends="init,setup-catalina-ant-tasks">
530 <reload url="http://${tomcat.server}:${tomcat.port}/manager" username="admin" password="admin"
531 path="${app.path}"/>
532 </target>
533
534 <target name="start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
535 <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
536 <property name="tomcat.path" refid="local.tomcat.path"/>
537 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
538 <exec executable="${catalina.home}/bin/startup.sh" os="${os.linux},${os.mac}" dir="${catalina.home}/bin" spawn="false">
539 <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
540 <env key="GSDL3HOME" value="${basedir}"/>
541 <env key="PATH" path="${tomcat.path}"/>
542 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
543 <env key="CATALINA_HOME" value="${catalina.home}"/>
544 <env key="CLASSPATH" path="${tomcat.classpath}"/>
545 <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
546 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.installed.path}/lib"/> <!-- for mac os -->
547 </exec>
548 <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
549 <env key="GSDLOS" value="windows"/>
550 <env key="GSDL3HOME" value="${basedir}"/>
551 <env key="Path" path="${tomcat.path}"/>
552 <env key="PATH" path="${tomcat.path}"/>
553 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
554 <env key="CLASSPATH" path="${tomcat.classpath}"/>
555 </exec>
556 <!-- wait for the server to startup in case other targets need it running -->
557 <waitfor maxwait="5" maxwaitunit="second">
558 <and>
559 <socket server="${tomcat.server}" port="${tomcat.port}"/>
560 <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
561 </and>
562 </waitfor>
563 </target>
564 <!-- windows: do we want to launch a webrowser?? -->
565 <target name="stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
566 <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.linux},${os.mac}" dir="${catalina.home}/bin" spawn="false">
567 <env key="CATALINA_HOME" value="${catalina.home}"/>
568 </exec>
569 <exec executable="${catalina.home}/bin/shutdown.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false"/>
570 </target>
571
572 <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/>
573
574 <target name="setup-catalina-ant-tasks">
575 <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
576 <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
577 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
578 <taskdef name="list" classname="org.apache.catalina.ant.ListTask"
579 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
580 <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"
581 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
582 <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
583 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
584 <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"
585 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
586 <taskdef name="start" classname="org.apache.catalina.ant.StartTask"
587 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
588 <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"
589 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
590 <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
591 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
592 </target>
593
594
595<!-- ======================= Mysql Targets =========================== -->
596
597 <!-- this is one target that we only want to run once. -->
598 <target name="prepare-mysql" depends="init,init-mysql-vars,install-mysql,start-mysql,setup-mysql,stop-mysql-no-password-force"/>
599
600 <target name="init-mysql-vars">
601 <condition property="mysql.islocal.linux">
602 <and>
603 <isset property="mysql.islocal"/>
604 <isset property="current.os.isunixnotmac"/>
605 </and>
606 </condition>
607 <condition property="mysql.islocal.mac">
608 <and>
609 <isset property="mysql.islocal"/>
610 <isset property="current.os.ismac"/>
611 </and>
612 </condition>
613 <condition property="mysql.islocal.windows">
614 <and>
615 <isset property="mysql.islocal"/>
616 <isset property="current.os.iswindows"/>
617 </and>
618 </condition>
619 <condition property="mysql.islocal.usepassword">
620 <and>
621 <isset property="mysql.islocal"/>
622 <isset property="mysql.use.passwords"/>
623 <equals arg1="yes" arg2="${mysql.use.passwords}"/>
624 </and>
625 </condition>
626 <condition property="mysql.islocal.usepassword.windows">
627 <and>
628 <isset property="mysql.islocal.usepassword"/>
629 <isset property="current.os.iswindows"/>
630 </and>
631 </condition>
632 <condition property="mysql.islocal.usepassword.unix">
633 <and>
634 <isset property="mysql.islocal.usepassword"/>
635 <isset property="current.os.isunix"/>
636 </and>
637 </condition>
638 <condition property="mysql.islocal.nopassword">
639 <and>
640 <isset property="mysql.islocal"/>
641 <or>
642 <not>
643 <isset property="mysql.use.passwords"/>
644 </not>
645 <equals arg1="no" arg2="${mysql.use.passwords}"/>
646 </or>
647 </and>
648 </condition>
649 </target>
650
651 <target name="configure-mysql" depends="init,init-mysql-vars,start-mysql,set-mysql-account-passwords,stop-mysql" description="sets up the mysql account passwords"/>
652
653 <target name="get-mysql-root-password" depends="init,init-mysql-vars" if="mysql.islocal.usepassword" unless="mysql.root.password">
654 <echo>(Enter password in the Java popup)</echo>
655 <getuserandpassword message="Please specify a password for the root mysql user: this is to secure your database." username="root" pwordproperty="mysql.root.password"/>
656 </target>
657
658 <target name="get-mysql-root-password-windows" depends="init,init-mysql-vars" if="mysql.islocal.usepassword.windows" unless="mysql.root.password">
659 <echo>(Enter password in the Java popup)</echo>
660 <getuserandpassword message="Please enter the mysql root password" username="root" pwordproperty="mysql.root.password"/>
661 </target>
662
663 <target name="get-mysql-reader-password" depends="init,init-mysql-vars" if="mysql.islocal.usepassword" unless="mysql.reader.password" >
664 <echo>(Enter password in the Java popup)</echo>
665 <getuserandpassword message="Please specify the password for the gsdl3reader mysql user: this is used by greenstone" username="gsdl3reader" pwordproperty="mysql.reader.password"/>
666 </target>
667
668 <target name="get-mysql-admin-password" depends="init,init-mysql-vars" if="mysql.islocal.usepassword" unless="mysql.admin.password" >
669 <echo>(Enter password in the Java popup)</echo>
670 <getuserandpassword message="Please specify the password for the gsdl3admin mysql user: this is used by greenstone" username="gsdl3admin" pwordproperty="mysql.admin.password"/>
671 </target>
672
673 <target name="install-mysql" depends="init,init-mysql-vars,install-mysql-linux,install-mysql-windows,install-mysql-mac"/>
674
675 <!-- install the database : linux-->
676 <target name="install-mysql-linux" depends="init,init-mysql-vars" if="mysql.islocal.linux" unless="mysql.present">
677 <get src="http://www.greenstone.org/gs3files/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"
678 dest="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"
679 usetimestamp="true"/>
680 <untar src="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"
681 dest="${packages.home}"
682 compression="gzip"/>
683 <move todir="${packages.home}/mysql">
684 <fileset dir="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686"/>
685 </move>
686 <!-- file permissions are screwed up, so make executables executable -->
687 <chmod file="${mysql.home}/scripts/mysql_install_db" perm="a+x"/>
688 <chmod perm="a+x">
689 <fileset dir="${mysql.home}/bin" />
690 </chmod>
691 <mkdir dir="${mysql.home}/var/"/>
692 <mkdir dir="${mysql.home}/var/log/"/>
693 <chmod file="${mysql.home}/var/" perm="777"/>
694 <chmod file="${mysql.home}/var/log/" perm="777"/>
695
696 <exec executable="${mysql.home}/scripts/mysql_install_db" dir="${mysql.home}">
697 <arg value="--datadir=${mysql.datadir}"/>
698 <arg value="--basedir=."/>
699 <arg value="--user=root"/>
700 <arg value="--force"/>
701 </exec>
702 </target>
703
704
705 <!-- install the database : mac-->
706 <target name="install-mysql-mac" depends="init,init-mysql-vars" if="mysql.islocal.mac" unless="mysql.present">
707 <get src="http://www.greenstone.org/gs3files/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"
708 dest="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"
709 usetimestamp="true"/>
710 <untar src="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"
711 dest="${packages.home}"
712 compression="gzip"/>
713 <move todir="${packages.home}/mysql">
714 <fileset dir="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc"/>
715 </move>
716 <!-- file permissions are screwed up, so make executables executable -->
717 <chmod file="${mysql.home}/scripts/mysql_install_db" perm="a+x"/>
718 <chmod perm="a+x">
719 <fileset dir="${mysql.home}/bin" />
720 </chmod>
721 <mkdir dir="${mysql.home}/var/"/>
722 <mkdir dir="${mysql.home}/var/log/"/>
723 <chmod file="${mysql.home}/var/" perm="777" type="dir"/>
724 <chmod file="${mysql.home}/var/log/" perm="777" type="dir"/>
725 <exec executable="${mysql.home}/scripts/mysql_install_db" dir="${mysql.home}">
726 <arg value="--datadir=${mysql.datadir}"/>
727 <arg value="--basedir=."/>
728 <!--<arg value="- -user=root"/>
729 <arg value="- -force"/>-->
730 </exec>
731 </target>
732
733 <!-- install the database : windows -->
734 <target name="install-mysql-windows" depends="init,init-mysql-vars" if="mysql.islocal.windows" unless="mysql.present">
735 <get src="http://www.greenstone.org/gs3files/mysql-noinstall-4.1.15-win32.zip"
736 dest="${packages.home}/mysql-noinstall-4.1.15-win32.zip"
737 usetimestamp="true"/>
738 <!-- can we run the installer?? -->
739 <unzip src="${packages.home}/mysql-noinstall-4.1.15-win32.zip"
740 dest="${packages.home}"/>
741 <move todir="${packages.home}/mysql">
742 <fileset dir="${packages.home}/mysql-4.1.15-win32"/>
743 </move>
744 </target>
745
746 <target name="setup-mysql" depends="init" if="mysql.islocal">
747 <!-- setup the gsdl3 accounts -->
748 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
749 <arg value="--user=root"/>
750 <arg value="--execute=GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost"/>
751 </exec>
752 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
753 <arg value="--user=root"/>
754 <arg value="--execute=GRANT SELECT ON *.* TO gsdl3reader@localhost"/>
755 </exec>
756 <!--<exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
757 <arg value="- -user=root"/>
758 <arg value="- -execute=GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@'%';"/>
759 </exec>-->
760
761 <!-- remove the anonymous user -->
762 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
763 <arg value="--user=root"/>
764 <arg value="--execute=delete from mysql.user where Host='localhost' and User='';"/>
765 </exec>
766 <!-- load in the demo collection database -->
767 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
768 <arg value="--user=root"/>
769 <arg value="--execute=create database localsite_gs3mgdemo;"/>
770 </exec>
771 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}"
772 input="${web.home}/sites/localsite/collect/gs3mgdemo/mysqldatadump.sql">
773 <arg value="--user=root"/>
774 <arg value="localsite_gs3mgdemo"/>
775 </exec>
776 </target>
777
778 <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">
779 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
780 <arg value="--user=root"/>
781 <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;"/>
782 </exec>
783 </target>
784
785 <target name="start-mysql" depends="init,init-mysql-vars" if="mysql.islocal"
786 description="Startup only mysql">
787 <echo>Starting up the mysql server</echo>
788 <exec executable="${mysql.home}/bin/mysqld_safe" dir="${mysql.home}"
789 spawn="true" os="${os.linux},${os.mac}">
790 <arg value="--datadir=${mysql.datadir}"/>
791 <arg value="--basedir=."/>
792 <arg value="--pid_file=gsdl3.pid"/>
793 <arg value="--socket=/tmp/mysql.sock"/>
794 <arg value="--port=${mysql.port}"/>
795 <arg value="--err-log=./var/log/mysql.log"/>
796 </exec>
797 <exec executable="${mysql.home}/bin/mysqld" dir="${mysql.home}" spawn="true" os="${os.windows}">
798 <arg value="--port=${mysql.port}"/>
799 </exec>
800 <sleep seconds="2"/>
801 </target>
802
803 <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"
804 description="Shutdown only mysql">
805 <echo>MYSQL database server shutdown successfully</echo>
806 </target>
807
808 <target name="stop-mysql-no-password" depends="init" if="mysql.islocal.nopassword">
809 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
810 failonerror="true" os="${os.linux},${os.mac}">
811 <arg value="--user=root"/>
812 <arg value="--socket=/tmp/mysql.sock"/>
813 <arg value="shutdown"/>
814 </exec>
815 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
816 failonerror="true" os="${os.windows}">
817 <arg value="--user=root"/>
818 <arg value="shutdown"/>
819 </exec>
820 </target>
821
822 <target name="stop-mysql-no-password-force" depends="init">
823 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
824 failonerror="true" os="${os.linux},${os.mac}">
825 <arg value="--user=root"/>
826 <arg value="--socket=/tmp/mysql.sock"/>
827 <arg value="shutdown"/>
828 </exec>
829 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
830 failonerror="true" os="${os.windows}">
831 <arg value="--user=root"/>
832 <arg value="shutdown"/>
833 </exec>
834 </target>
835
836 <target name="stop-mysql-use-password-unix" depends="init" if="mysql.islocal.usepassword.unix">
837 <echo>At the password prompt, enter the mysql root password.</echo>
838 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
839 failonerror="true" os="${os.linux},${os.mac}">
840 <arg value="--user=root"/>
841 <arg value="-p"/>
842 <arg value="--socket=/tmp/mysql.sock"/>
843 <arg value="shutdown"/>
844 </exec>
845 </target>
846
847 <target name="stop-mysql-use-password-windows" depends="init,get-mysql-root-password-windows" if="mysql.islocal.usepassword.windows">
848 <!-- on windows it doesn't work unless the password is specified here -->
849 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
850 failonerror="true" os="${os.windows}">
851 <arg value="--user=root"/>
852 <arg value="-p${mysql.root.password}"/>
853 <arg value="shutdown"/>
854 </exec>
855 </target>
856
857 <target name="restart-mysql" description="Shutdown and restart only mysql" depends="init,stop-mysql,start-mysql"/>
858
859
860<!-- ======================= Axis Targets ============================ -->
861
862 <target name="prepare-axis" depends="init">
863 <get src="http://www.greenstone.org/gs3files/axis-bin-1_2_1.zip"
864 dest="${packages.home}/axis-bin-1_2_1.zip"
865 usetimestamp="true"/>
866 <unzip src="${packages.home}/axis-bin-1_2_1.zip"
867 dest="${packages.home}"/>
868 <move todir="${packages.home}/axis">
869 <fileset dir="${packages.home}/axis-1_2_1"/>
870 </move>
871 <!-- install axis into greenstone web app -->
872 <copy todir="${web.lib}">
873 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/lib">
874 <include name="*.jar"/>
875 </fileset>
876 </copy>
877 <copy todir="${web.home}">
878 <fileset dir="${packages.home}/axis/webapps/axis/">
879 <include name="*.jsp"/>
880 <include name="*.jws"/>
881 </fileset>
882 </copy>
883 <copy tofile="${web.home}/axis.html" file="${packages.home}/axis/webapps/axis/index.html"/>
884 <copy todir="${web.classes}">
885 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/classes">
886 <include name="*.properties"/>
887 </fileset>
888 </copy>
889 </target>
890
891 <target name="soap-deploy-site" depends="get-sitename,get-siteuri,create-deployment-files"
892 description="Deploy a SOAP web service for a local Greenstone site">
893 <java classname="org.apache.axis.client.AdminClient">
894 <classpath refid="compile.classpath"/>
895 <arg value="-l"/>
896 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
897 <arg file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
898 </java>
899 </target>
900
901 <target name="soap-undeploy-site" depends="get-sitename"
902 description="Undeploy a SOAP web service for a local Greenstone site">
903 <java classname="org.apache.axis.client.AdminClient">
904 <classpath refid="compile.classpath"/>
905 <arg value="-l"/>
906 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
907 <arg file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
908 </java>
909 </target>
910
911 <!-- this target used to deploy the localsite server for the default installation -->
912 <target name="deploy-localsite" depends="init">
913 <antcall target="start-tomcat"/>
914 <antcall target="soap-deploy-site">
915 <param name="axis.sitename" value="localsite"/>
916 <param name="axis.siteuri" value="localsite"/>
917 </antcall>
918 <antcall target="stop-tomcat"/>
919 </target>
920
921 <target name="get-sitename" unless="axis.sitename">
922 <input addproperty="axis.sitename" message="What site? (press enter for default:localsite)" defaultvalue="localsite"/>
923 </target>
924
925 <target name="get-siteuri" depends="get-sitename" unless="axis.siteuri">
926 <input addproperty="axis.siteuri" message="What name do you want the service to have? (press enter for default:${axis.sitename})" defaultvalue="${axis.sitename}"/>
927 <echo>${axis.sitename}, ${axis.siteuri}</echo>
928 </target>
929 <target name="check-deployment-files" depends="get-sitename">
930 <condition property="deploy.exists">
931 <and>
932 <available file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
933 <available file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
934 <available file="${web.classes}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class"/>
935 </and>
936 </condition>
937 </target>
938
939 <target name="create-deployment-files" depends="get-sitename,get-siteuri,check-deployment-files"
940 if="axis.sitename" unless="deploy.exists">
941 <filter token="sitename" value="${axis.sitename}"/>
942 <filter token="siteuri" value="${axis.siteuri}"/>
943 <copy file="${basedir}/resources/soap/site.wsdd.template"
944 tofile="${basedir}/resources/soap/${axis.sitename}.wsdd"
945 filtering="true"/>
946 <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
947 tofile="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"
948 filtering="true"/>
949 <!-- create the java files and compile them -->
950 <copy file="${gsdl3.home}/SOAPServer.java.in"
951 tofile="${gsdl3.home}/SOAPServer${axis.sitename}.java"
952 filtering="true"/>
953 <javac srcdir="${src.home}"
954 destdir="${build.home}"
955 debug="${compile.debug}"
956 deprecation="${compile.deprecation}"
957 optimize="${compile.optimize}">
958 <classpath refid="compile.classpath"/>
959 <include name="org/greenstone/gsdl3/SOAPServer${axis.sitename}.java" />
960 </javac>
961 <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
962 <copy file="${build.home}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class" tofile="${web.classes}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class" />
963 </target>
964
965
966<!-- ====================== Core targets ============================== -->
967<!-- core targets refer to the core gsdl3 java src -->
968
969 <target name="prepare-core" unless="nocvs.mode">
970 <!-- just get rid of empty directories-->
971 <cvs command="update -P"/>
972 </target>
973
974 <target name="configure-core"/>
975
976 <target name="update-core" depends="init,cvsupdate-core,clean-core,compile-core"
977 description="Update only the Greenstone core" />
978
979 <target name="cvsupdate-core" unless="nocvs.mode">
980 <cvs command="update -l"/>
981 <cvs command="update -dP bin comms dist-resources docs lib resources src winutil"/>
982 </target>
983
984 <target name="clean-core"
985 description="Clean only the Greenstone core">
986 <delete dir="${build.home}"/>
987 </target>
988
989 <target name="compile-core"
990 description="Compile only the Greenstone core">
991 <mkdir dir="${build.home}"/>
992 <javac srcdir="${src.home}"
993 destdir="${build.home}"
994 debug="${compile.debug}"
995 deprecation="${compile.deprecation}"
996 optimize="${compile.optimize}">
997 <classpath>
998 <path refid="compile.classpath"/>
999 </classpath>
1000 </javac>
1001 <jar destfile="${build.home}/gsdl3.jar">
1002 <fileset dir="${build.home}">
1003 <include name="org/greenstone/gsdl3/**"/>
1004 <exclude name="**/Test.class"/>
1005 </fileset>
1006 <manifest>
1007 <attribute name="Built-By" value="${user.name}" />
1008 </manifest>
1009 </jar>
1010 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
1011 <jar destfile="${build.home}/phind.jar">
1012 <fileset dir="${build.home}">
1013 <include name="org/greenstone/applet/phind/**"/>
1014 </fileset>
1015 <manifest>
1016 <attribute name="Built-By" value="${user.name}" />
1017 </manifest>
1018 </jar>
1019 <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
1020 <jar destfile="${build.home}/anttasks.jar">
1021 <fileset dir="${build.home}">
1022 <include name="org/greenstone/anttasks/**"/>
1023 </fileset>
1024 <manifest>
1025 <attribute name="Built-By" value="${user.name}" />
1026 </manifest>
1027 </jar>
1028 <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>
1029 <jar destfile="${build.home}/gsdl3test.jar">
1030 <fileset dir="${build.home}">
1031 <include name="org/greenstone/gsdl3/**/*Test.class"/>
1032 <include name="org/greenstone/testing/**"/>
1033 </fileset>
1034 <manifest>
1035 <attribute name="Built-By" value="${user.name}" />
1036 </manifest>
1037 </jar>
1038 </target>
1039
1040<!-- ================== Packages targets ================================ -->
1041 <!-- these targets refer to the greenstone source packages - these need
1042 updating less often, so are in separate targets to the core -->
1043 <target name="prepare-packages" depends="init,prepare-mgpp,prepare-windows"/>
1044
1045 <target name="prepare-windows" depends="init" if="current.os.iswindows">
1046 <!-- need to download precompiled binaries for mg and mgpp -->
1047 </target>
1048
1049 <target name="checkout-mgpp" depends="check-cvsroot,init" unless="nocvs.mode">
1050 <cvs command="checkout -P" package="mgpp" dest="${src.packages.home}"/>
1051 </target>
1052
1053 <target name="prepare-mgpp" depends="init" unless="mgpp.present">
1054 <antcall target="checkout-mgpp"/>
1055 </target>
1056
1057 <target name="update-packages" depends="init,cvsupdate-packages,configure-packages,clean-packages,compile-packages"
1058 description="Update only the source packages"/>
1059
1060 <target name="cvsupdate-packages" unless="nocvs.mode">
1061 <cvs command="update -dP" dest="${src.packages.home}"/>
1062 </target>
1063
1064 <target name="configure-packages" description="Configure only the packages.">
1065 <echo>
1066 Configuring MG
1067 </echo>
1068 <exec executable="${mg.home}/configure" os="${os.linux},${os.mac}"
1069 dir="${mg.home}">
1070 <arg value="--prefix=${basedir}"/>
1071 <arg value="--libdir=${lib.jni}"/>
1072 </exec>
1073 <echo>
1074 Configuring MGPP
1075 </echo>
1076 <exec executable="${mgpp.home}/configure" os="${os.linux},${os.mac}"
1077 dir="${mgpp.home}">
1078 <arg value="--prefix=${basedir}"/>
1079 <arg value="--libdir=${lib.jni}"/>
1080 </exec>
1081 <echo>
1082 Configuring JavaGDBM
1083 </echo>
1084 <exec executable="${javagdbm.home}/configure" os="${os.linux}"
1085 dir="${javagdbm.home}">
1086 <arg value="--prefix=${basedir}"/>
1087 <arg value="--libdir=${lib.jni}"/>
1088 </exec>
1089 <exec executable="${javagdbm.home}/configure" os="${os.mac}"
1090 dir="${javagdbm.home}">
1091 <arg value="--prefix=${basedir}"/>
1092 <arg value="--libdir=${lib.jni}"/>
1093 <arg value="--with-gdbm=${gdbm.installed.path}"/>
1094 </exec>
1095
1096 </target>
1097
1098 <target name="clean-packages" depends="init,clean-packages-c++" description="Clean only the packages"/>
1099
1100 <target name="clean-packages-c++" depends="init">
1101 <!-- mg : just call the make target -->
1102 <exec executable="make" os="${os.linux},${os.mac}"
1103 dir="${mg.home}">
1104 <arg value="clean"/>
1105 </exec>
1106 <!-- mgpp -->
1107 <exec executable="make" os="${os.linux},${os.mac}"
1108 dir="${mgpp.home}">
1109 <arg value="clean"/>
1110 </exec>
1111 <!-- javagdbm -->
1112 <exec executable="make" os="${os.linux},${os.mac}"
1113 dir="${javagdbm.home}">
1114 <arg value="clean"/>
1115 </exec>
1116 </target>
1117
1118 <target name="clean-windows-c++-packages" depends="init" if="current.os.iswindows"
1119 description="Clean only the C/C++ packages">
1120 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
1121 <arg value="clean"/>
1122 </exec>
1123 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
1124 <arg value="clean"/>
1125 </exec>
1126 </target>
1127
1128 <target name="compile-packages"
1129 description="Compile only the packages">
1130 <echo>Compiling MG</echo>
1131 <exec executable="make" os="${os.linux},${os.mac}"
1132 dir="${mg.home}">
1133 </exec>
1134 <exec executable="make" os="${os.linux},${os.mac}"
1135 dir="${mg.home}">
1136 <arg value="install"/>
1137 </exec>
1138 <!-- windows: just the java stuff. -->
1139 <exec executable="${mg.home}/winMake.bat" os="${os.windows}"
1140 dir="${mg.home}">
1141 <arg value="compile"/>
1142 <arg value="javaonly"/>
1143 </exec>
1144 <!-- install the jar file -->
1145 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
1146
1147 <!-- mgpp -->
1148 <echo>Compiling MGPP</echo>
1149 <exec executable="make" os="${os.linux},${os.mac}"
1150 dir="${mgpp.home}">
1151 </exec>
1152 <exec executable="make" os="${os.linux},${os.mac}"
1153 dir="${mgpp.home}">
1154 <arg value="install"/>
1155 </exec>
1156 <!-- windows: just the java stuff. -->
1157 <exec executable="${mgpp.home}/winMake.bat" os="${os.windows}"
1158 dir="${mgpp.home}">
1159 <arg value="compile"/>
1160 <arg value="javaonly"/>
1161 </exec>
1162 <!-- install the jar file -->
1163 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
1164
1165 <!-- javagdbm -->
1166 <exec executable="make" os="${os.linux},${os.mac}"
1167 dir="${javagdbm.home}">
1168 </exec>
1169 <exec executable="make" os="${os.linux},${os.mac}"
1170 dir="${javagdbm.home}">
1171 <arg value="install"/>
1172 </exec>
1173 <!-- windows: just the java stuff. -->
1174 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}"
1175 dir="${javagdbm.home}">
1176 <arg value="compile"/>
1177 <arg value="javaonly"/>
1178 </exec>
1179 <!-- install the jar file -->
1180 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
1181
1182 </target>
1183
1184 <target name="compile-windows-c++-packages" depends="init" if="current.os.iswindows"
1185 description="Compile only the C/C++ packages">
1186 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}"/>
1187 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
1188 <arg value="install"/>
1189 <env key="GSDL3HOME" value="${basedir}"/>
1190 </exec>
1191 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}"/>
1192 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
1193 <arg value="install"/>
1194 <env key="GSDL3HOME" value="${basedir}"/>
1195 </exec>
1196 <exec executable="${javagdbm.home}/winMake.bat" dir="${javagdbm.home}"/>
1197 <exec executable="${javagdbm.home}/winMake.bat" dir="${javagdbm.home}">
1198 <arg value="install"/>
1199 <env key="GSDL3HOME" value="${basedir}"/>
1200 </exec>
1201 </target>
1202
1203 <!-- =============== Extensions targets ==================== -->
1204
1205 <target name="prepare-extensions" depends="init"/>
1206
1207 <target name="cvsupdate-extensions" depends="init">
1208 <cvs command="update -dP" dest="${extensions.home}"/>
1209 </target>
1210
1211 <target name="configure-extensions"/>
1212
1213 <target name="clean-extensions" depends="init">
1214 <!-- vishnu : just call the ant target -->
1215 <ant antfile="${vishnu.home}/build.xml" dir="${vishnu.home}"
1216 inheritall="false" target="clean">
1217 <property name="catalina.home" value="${catalina.home}"/>
1218 </ant>
1219 <!-- gsdl-as : just call the ant target-->
1220 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
1221 inheritall="false" target="clean">
1222 <property name="catalina.home" value="${catalina.home}"/>
1223 </ant>
1224 </target>
1225
1226 <target name="compile-extensions">
1227 <!-- vishnu -->
1228 <echo>Compiling Vishnu</echo>
1229 <ant antfile="${vishnu.home}/build.xml" dir="${vishnu.home}"
1230 inheritall="false" target="compile">
1231 <property name="catalina.home" value="${catalina.home}"/>
1232 </ant>
1233
1234 <!-- gsdl-as -->
1235 <echo>Compiling GSDL-AS</echo>
1236 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
1237 inheritall="false" target="compile">
1238 <property name="catalina.home" value="${catalina.home}"/>
1239 </ant>
1240 </target>
1241
1242 <!-- ================== gs2building targets ===============-->
1243
1244
1245 <target name="update-gs2building" if="gsdl2.islocal"
1246 depends="init,cvsupdate-gs2building,rename-gs2build-files,configure-gs2building,clean-gs2building,compile-gs2building"
1247 description="Update only the Greenstone 2 building components"/>
1248
1249 <target name="cvsupdate-gs2building" if="gsdl2.islocal" depends="init" unless="nocvs.mode">
1250 <cvs command="update -dP" dest="${gli.home}"/>
1251 <!-- Note: can't do a -d update here cos it will get all of gsdl
1252 also, an update doesn't get new files, so we do a checkout instead. -->
1253 <cvs command="co gs2build" dest="${basedir}"/>
1254 </target>
1255
1256 <target name="prepare-gs2building" depends="init,prepare-gs2build,prepare-gli" if="gsdl2.islocal">
1257 </target>
1258
1259 <target name="checkout-gs2build" depends="check-cvsroot,init" unless="nocvs.mode">
1260 <echo>checking out gs2build</echo>
1261 <cvs command="checkout -P" package="gs2build"/>
1262 </target>
1263
1264 <target name="prepare-gs2build" depends="init" if="gsdl2.islocal" unless="gs2build.present">
1265 <antcall target="checkout-gs2build"/>
1266 <!-- rename the .gs2build files -->
1267 <antcall target="rename-gs2build-files"/>
1268 <antcall target="unzip-windows-packages"/>
1269 <antcall target="get-windows-binaries"/>
1270 <antcall target="get-macos-extra"/>
1271 </target>
1272
1273 <target name="checkout-winbin" depends="init" if="current.os.iswindows"
1274 unless="nocvs.mode">
1275 <cvs command="checkout -P" package="winbin"/>
1276 </target>
1277
1278 <target name="get-windows-binaries" depends="init,checkout-winbin" if="current.os.iswindows">
1279 <copy todir="${basedir}/bin">
1280 <fileset dir="${basedir}/winbin/bin" includes="mg*.exe"/>
1281 </copy>
1282 <move todir="${gs2build.home}/bin/windows" failonerror="false">
1283 <fileset dir="${basedir}/winbin/bin"/>
1284 </move>
1285 <delete dir="${basedir}/winbin"/>
1286 </target>
1287
1288 <target name="unzip-windows-packages" depends="init" if="current.os.iswindows">
1289 <unzip src="${gs2build.home}/packages/windows/gdbm/gdbm.zip"
1290 dest="${gs2build.home}/packages/windows/gdbm"/>
1291 <unzip src="${gs2build.home}/packages/windows/crypt/crypt.zip"
1292 dest="${gs2build.home}/packages/windows/crypt"/>
1293 <unzip src="${gs2build.home}/packages/windows/expat/expat.zip"
1294 dest="${gs2build.home}/packages/windows/expat"/>
1295 </target>
1296
1297 <target name="get-macos-extra" depends="init" if="current.os.ismac">
1298 <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz"
1299 dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1300 usetimestamp="true"/>
1301 <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1302 dest="${gs2build.home}/perllib/cpan/"
1303 compression="gzip"/>
1304 <delete file="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"/>
1305 </target>
1306
1307 <target name="rename-gs2build-files" depends="rename-gs2build-files-unix,rename-gs2build-files-windows"/>
1308
1309 <target name="rename-gs2build-files-windows" if="current.os.iswindows">
1310 <!-- we want a windows path in the setup.bat file -->
1311 <pathconvert targetos="windows" property="gs2build.home.windows">
1312 <path path="${gs2build.home}"/>
1313 </pathconvert>
1314
1315 <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
1316 <copy file="${gs2build-extra.home}/lib.win32.mak" tofile="${gs2build.home}/lib/win32.mak"/>
1317 <copy file="${gs2build-extra.home}/win32.mak" tofile="${gs2build.home}/win32.mak"/>
1318 <copy file="${gs2build-extra.home}/setup.bat" tofile="${gs2build.home}/setup.bat">
1319 <filterset>
1320 <filter token="gsdlhome" value="${gs2build.home.windows}"/>
1321 </filterset>
1322 </copy>
1323 </target>
1324 <target name="rename-gs2build-files-unix" if="current.os.isunix">
1325 <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
1326 <copy file="${gs2build-extra.home}/configure" tofile="${gs2build.home}/configure"/>
1327 <chmod file="${gs2build.home}/configure" perm="a+x"/>
1328 <copy file="${gs2build-extra.home}/configure.in" tofile="${gs2build.home}/configure.in"/>
1329 <copy file="${gs2build-extra.home}/Makefile.in" tofile="${gs2build.home}/Makefile.in"/>
1330 <copy file="${gs2build-extra.home}/packages.configure" tofile="${gs2build.home}/packages/configure"/>
1331 <chmod file="${gs2build.home}/packages/configure" perm="a+x"/>
1332 <copy file="${gs2build-extra.home}/packages.Makefile" tofile="${gs2build.home}/packages/Makefile"/>
1333 <copy file="${gs2build-extra.home}/lib.Makefile.in" tofile="${gs2build.home}/lib/Makefile.in"/>
1334
1335 </target>
1336 <target name="prepare-gli" depends="init" if="gsdl2.islocal" unless="gli.present">
1337 <antcall target="checkout-gli"/>
1338 </target>
1339
1340 <target name="checkout-gli" depends="check-cvsroot,init" if="gsdl2.islocal" unless="nocvs.mode">
1341 <echo>checking out gli</echo>
1342 <cvs command="checkout -P" package="gli"/>
1343 </target>
1344
1345 <target name="configure-gs2building" depends="init" if="gsdl2.islocal"
1346 description="Configure only the Greenstone 2 building components">
1347 <exec executable="${gs2build.home}/configure" os="${os.linux}"
1348 dir="${gs2build.home}">
1349 <arg value="--prefix=${gs2build.home}"/>
1350 </exec>
1351 <exec executable="${gs2build.home}/configure" os="${os.mac}"
1352 dir="${gs2build.home}">
1353 <arg value="--prefix=${gs2build.home}"/>
1354 <arg value="--with-gdbm=${gdbm.installed.path}"/>
1355 </exec>
1356 </target>
1357
1358 <target name="clean-gs2building" depends="init,clean-gli,clean-gs2build" if="gsdl2.islocal"
1359 description="Clean only the Greenstone 2 building components"/>
1360 <target name="clean-gli" depends="init">
1361 <!-- gli -->
1362 <property name="gli.home" value="${basedir}/gli"/>
1363 <!-- linux -->
1364 <exec executable="clean.sh" os="${os.linux},${os.mac}" dir="${gli.home}"
1365 resolveExecutable="true"/>
1366 <!-- windows -->
1367 <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
1368 resolveExecutable="true"/>
1369 </target>
1370 <target name="clean-gs2build" depends="init">
1371 <!-- gs2build -->
1372 <!--linux: -->
1373 <exec executable="make" os="${os.linux},${os.mac}" dir="${gs2build.home}">
1374 <arg value="clean"/>
1375 </exec>
1376 <!-- windows: -->
1377 </target>
1378
1379 <target name="clean-windows-c++-gs2building" depends="init" if="current.os.iswindows"
1380 description="remove all object files and executables">
1381 <!-- run the setup script -->
1382 <exec executable="${compile.windows.c++.setup}"/>
1383 <exec executable="nmake" dir="${gs2build.home}">
1384 <arg value="/f"/>
1385 <arg value="win32.mak"/>
1386 <arg value="clean"/>
1387 </exec>
1388 </target>
1389
1390 <target name="compile-gs2building" depends="init" if="gsdl2.islocal"
1391 description="Compile only the Greenstone 2 building components">
1392 <!-- gli -->
1393 <property name="gli.home" value="${basedir}/gli"/>
1394 <!-- linux -->
1395 <exec executable="makegli.sh" os="${os.linux},${os.mac}" dir="${gli.home}"
1396 resolveExecutable="true"/>
1397 <!-- windows -->
1398 <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}"
1399 resolveExecutable="true"/>
1400 <!-- gs2build -->
1401 <!--linux: make, make install -->
1402 <exec executable="make" os="${os.linux},${os.mac}" dir="${gs2build.home}">
1403 </exec>
1404 <exec executable="make" os="${os.linux},${os.mac}" dir="${gs2build.home}">
1405 <arg value="install"/>
1406 </exec>
1407 </target>
1408 <!-- windows: -->
1409 <target name="compile-windows-c++-gs2building" depends="init" if="current.os.iswindows"
1410 description="Use this if you want to compile the C++ code for the gs2build package">
1411 <!-- run the setup script -->
1412 <exec executable="${compile.windows.c++.setup}"/>
1413 <exec executable="nmake" dir="${gs2build.home}">
1414 <arg value="/f"/>
1415 <arg value="win32.mak"/>
1416 </exec>
1417 </target>
1418 <target name="gli" description="Run the Greenstone Librarian Interface" depends="gli-local,gli-external">
1419 </target>
1420
1421 <target name="gli-local" depends="init" if="gsdl2.islocal">
1422 <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.linux}" dir="${basedir}/gli" spawn="true">
1423 <env key="gsdl3path" path="${basedir}"/>
1424 <env key="gsdlpath" path="${basedir}/gs2build"/>
1425 </exec>
1426 <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
1427 <env key="gsdl3path" path="${basedir}"/>
1428 <env key="gsdlpath" path="${basedir}/gs2build"/>
1429 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.installed.path}/lib"/>
1430 </exec>
1431 <exec executable="${basedir}/gli/gli4gs3.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
1432 <env key="GSDL3PATH" path="${basedir}"/>
1433 <env key="GSDLPATH" path="${basedir}/gs2build"/>
1434 </exec>
1435 <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.
1436 </echo>
1437 </target>
1438
1439 <target name="gli-external" depends="init" unless="gsdl2.islocal">
1440 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.sh" os="${os.linux},${os.mac}" dir="${gsdl2.installed.path}/gli" spawn="true">
1441 <env key="gsdl3path" path="${basedir}"/>
1442 <env key="gsdlpath" path="${gsdl2.installed.path}"/>
1443 </exec>
1444 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.bat" os="${os.windows}" dir="${gsdl2.installed.path}/gli" spawn="true">
1445 <env key="GSDL3PATH" path="${basedir}"/>
1446 <env key="GSDLPATH" path="${gsdl2.installed.path}"/>
1447 </exec>
1448 <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:
1449 (Linux/Mac OS X / Windows)
1450in greenstone3 directory: source gs3-setup.sh / gs3-setup
1451in gsdl directory: source setup.bash / setup
1452in gli directory: gli4gs3.sh / gli4gs3
1453 </echo>
1454 </target>
1455
1456
1457<!-- ======================== TESTING Targets ========================= -->
1458
1459 <target name="test" description="Run the (incomplete) JUnit test suite "
1460 depends="init">
1461 <mkdir dir="${basedir}/test"/>
1462 <junit printsummary="withOutAndErr"
1463 errorproperty="test.failed"
1464 failureproperty="test.failed"
1465 fork="${junit.fork}">
1466 <formatter type="plain"/>
1467 <classpath>
1468 <pathelement location="${build.home}/gsdl3test.jar"/>
1469 <path refid="compile.classpath"/>
1470 </classpath>
1471 <test name="${testcase}" if="testcase"/>
1472 <batchtest todir="${basedir}/test" unless="testcase">
1473 <fileset dir="${build.home}"
1474 includes="**/*Test.class"
1475 />
1476 </batchtest>
1477 </junit>
1478 <echo>
1479 *********************************************
1480 Test output can be found in directory 'test'
1481 *********************************************
1482 </echo>
1483 </target>
1484
1485
1486<!-- ====================== DISTRIBUTION Targets ========================= -->
1487
1488 <target name="prepare-for-dist-1" depends="init">
1489 <cvs command="export -D '1 second ago'" package="mgpp"
1490 dest="${src.packages.home}"
1491 cvsRoot="${cvs.root}" />
1492 <cvs command="export -D '1 second ago'" package="gs2build"
1493 cvsRoot="${cvs.root}" />
1494 <cvs command="export -D '1 second ago'" package="gli"
1495 cvsRoot="${cvs.root}" />
1496 <antcall target="rename-gs2build-files-unix"/>
1497 <antcall target="unzip-windows-packages"/>
1498 <antcall target="get-windows-binaries"/>
1499 <antcall target="get-perl-for-windows"/>
1500 <antcall target="get-macos-extra"/>
1501 <antcall target="prepare-mysql"/>
1502 <delete file="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"/>
1503 <delete file="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"/>
1504 <delete file="${packages.home}/mysql-noinstall-4.1.15-win32.zip"/>
1505 <delete dir="${packages.home}/mysql/sql-bench"/>
1506 <delete dir="${packages.home}/mysql/tests"/>
1507 <delete dir="${packages.home}/mysql/mysql-test"/>
1508 <delete file="${packages.home}/mysql/var/log/mysql.log"/>
1509 <antcall target="prepare-tomcat"/>
1510 <delete file="${packages.home}/apache-tomcat-5.5.12.zip"/>
1511 <delete file="${packages.home}/apache-tomcat-5.5.12-compat.zip"/>
1512 <antcall target="configure-tomcat"/>
1513 <antcall target="prepare-axis"/>
1514 <delete file="${packages.home}/axis-bin-1_2_1.zip"/>
1515 <!-- delete old axis dir -->
1516 <delete dir="${packages.home}/axis"/>
1517 <antcall target="prepare-web"/>
1518 </target>
1519
1520 <target name="prepare-for-dist-2" depends="init">
1521 <antcall target="configure-c++"/>
1522 </target>
1523
1524 <target name="prepare-for-dist-3" depends="init">
1525 <antcall target="compile"/>
1526 <antcall target="clean-packages-c++"/>
1527 <antcall target="clean-gs2build"/>
1528 <xslt in="build.xml" out="dist-build.xml" style="dist-resources/convert-build-xml.xsl"/>
1529 <delete dir="${basedir}/build"/>
1530 <delete dir="${basedir}/dist-resources"/>
1531 </target>
1532
1533 <target name="get-perl-for-windows" if="current.os.iswindows">
1534 <get src="http://www.greenstone.org/gs3files/perl-for-windows.zip"
1535 dest="${gs2build.home}/bin/windows/perl-for-windows.zip"
1536 usetimestamp="true"/>
1537 <unzip src="${gs2build.home}/bin/windows/perl-for-windows.zip"
1538 dest="${gs2build.home}/bin/windows"/>
1539 <delete file="${gs2build.home}/bin/windows/perl-for-windows.zip"/>
1540 </target>
1541
1542 <target name="install-for-dist" depends="accept-properties,init,configure-mysql,configure,configure-tomcat">
1543 <condition property="need.xml.jars">
1544 <equals arg1="1.5" arg2="${ant.java.version}"/>
1545 </condition>
1546 <antcall target="rename-xml-jars"/>
1547 <antcall target="rename-gs2build-files-windows"/>
1548 <antcall target="deploy-localsite"/>
1549 </target>
1550</project>
1551
1552
Note: See TracBrowser for help on using the repository browser.