source: trunk/gsdl3/build.xml@ 10897

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

added distclean for c++ packages and gs2build into the prepare-for-dist-4 target

  • Property svn:keywords set to Author Date Id Revision
File size: 67.1 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" type="dir"/>
700 <chmod file="${mysql.home}/var/log/" perm="777" type="dir"/>
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 <!-- install the database : mac-->
711 <target name="install-mysql-mac" depends="init,init-mysql-vars" if="mysql.islocal.mac" unless="mysql.present">
712 <get src="http://www.greenstone.org/gs3files/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"
713 dest="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"
714 usetimestamp="true"/>
715 <untar src="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"
716 dest="${packages.home}"
717 compression="gzip"/>
718 <move todir="${packages.home}/mysql">
719 <fileset dir="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc"/>
720 </move>
721 <!-- file permissions are screwed up, so make executables executable -->
722 <chmod file="${mysql.home}/scripts/mysql_install_db" perm="a+x"/>
723 <chmod perm="a+x">
724 <fileset dir="${mysql.home}/bin" />
725 </chmod>
726 <mkdir dir="${mysql.home}/var/log/"/>
727 <chmod file="${mysql.home}/var/" perm="777" type="dir"/>
728 <chmod file="${mysql.home}/var/log/" perm="777" type="dir"/>
729 <exec executable="${mysql.home}/scripts/mysql_install_db" dir="${mysql.home}">
730 <arg value="--datadir=${mysql.datadir}"/>
731 <arg value="--basedir=."/>
732 <!--<arg value="- -user=root"/>
733 <arg value="- -force"/>-->
734 </exec>
735 </target>
736
737 <!-- install the database : windows -->
738 <target name="install-mysql-windows" depends="init,init-mysql-vars" if="mysql.islocal.windows" unless="mysql.present">
739 <get src="http://www.greenstone.org/gs3files/mysql-noinstall-4.1.15-win32.zip"
740 dest="${packages.home}/mysql-noinstall-4.1.15-win32.zip"
741 usetimestamp="true"/>
742 <!-- can we run the installer?? -->
743 <unzip src="${packages.home}/mysql-noinstall-4.1.15-win32.zip"
744 dest="${packages.home}"/>
745 <move todir="${packages.home}/mysql">
746 <fileset dir="${packages.home}/mysql-4.1.15-win32"/>
747 </move>
748 </target>
749
750 <target name="setup-mysql" depends="init" if="mysql.islocal">
751 <!-- setup the gsdl3 accounts -->
752 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
753 <arg value="--user=root"/>
754 <arg value="--execute=GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost"/>
755 </exec>
756 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
757 <arg value="--user=root"/>
758 <arg value="--execute=GRANT SELECT ON *.* TO gsdl3reader@localhost"/>
759 </exec>
760 <!--<exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
761 <arg value="- -user=root"/>
762 <arg value="- -execute=GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@'%';"/>
763 </exec>-->
764
765 <!-- remove the anonymous user -->
766 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
767 <arg value="--user=root"/>
768 <arg value="--execute=delete from mysql.user where Host='localhost' and User='';"/>
769 </exec>
770 <!-- load in the demo collection database -->
771 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
772 <arg value="--user=root"/>
773 <arg value="--execute=create database localsite_gs3mgdemo;"/>
774 </exec>
775 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}"
776 input="${web.home}/sites/localsite/collect/gs3mgdemo/mysqldatadump.sql">
777 <arg value="--user=root"/>
778 <arg value="localsite_gs3mgdemo"/>
779 </exec>
780 </target>
781
782 <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">
783 <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
784 <arg value="--user=root"/>
785 <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;"/>
786 </exec>
787 </target>
788
789 <target name="start-mysql" depends="init,init-mysql-vars" if="mysql.islocal"
790 description="Startup only mysql">
791 <echo>Starting up the mysql server</echo>
792 <exec executable="${mysql.home}/bin/mysqld_safe" dir="${mysql.home}"
793 spawn="true" os="${os.linux},${os.mac}">
794 <arg value="--datadir=${mysql.datadir}"/>
795 <arg value="--basedir=."/>
796 <arg value="--pid_file=gsdl3.pid"/>
797 <arg value="--socket=/tmp/mysql.sock"/>
798 <arg value="--port=${mysql.port}"/>
799 <arg value="--err-log=./var/log/mysql.log"/>
800 </exec>
801 <exec executable="${mysql.home}/bin/mysqld" dir="${mysql.home}" spawn="true" os="${os.windows}">
802 <arg value="--port=${mysql.port}"/>
803 </exec>
804 <sleep seconds="2"/>
805 </target>
806
807 <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"
808 description="Shutdown only mysql">
809 <echo>MYSQL database server shutdown successfully</echo>
810 </target>
811
812 <target name="stop-mysql-no-password" depends="init" if="mysql.islocal.nopassword">
813 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
814 failonerror="true" os="${os.linux},${os.mac}">
815 <arg value="--user=root"/>
816 <arg value="--socket=/tmp/mysql.sock"/>
817 <arg value="shutdown"/>
818 </exec>
819 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
820 failonerror="true" os="${os.windows}">
821 <arg value="--user=root"/>
822 <arg value="shutdown"/>
823 </exec>
824 </target>
825
826 <target name="stop-mysql-no-password-force" depends="init">
827 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
828 failonerror="true" os="${os.linux},${os.mac}">
829 <arg value="--user=root"/>
830 <arg value="--socket=/tmp/mysql.sock"/>
831 <arg value="shutdown"/>
832 </exec>
833 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
834 failonerror="true" os="${os.windows}">
835 <arg value="--user=root"/>
836 <arg value="shutdown"/>
837 </exec>
838 </target>
839
840 <target name="stop-mysql-use-password-unix" depends="init" if="mysql.islocal.usepassword.unix">
841 <echo>At the password prompt, enter the mysql root password.</echo>
842 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
843 failonerror="true" os="${os.linux},${os.mac}">
844 <arg value="--user=root"/>
845 <arg value="-p"/>
846 <arg value="--socket=/tmp/mysql.sock"/>
847 <arg value="shutdown"/>
848 </exec>
849 </target>
850
851 <target name="stop-mysql-use-password-windows" depends="init,get-mysql-root-password-windows" if="mysql.islocal.usepassword.windows">
852 <!-- on windows it doesn't work unless the password is specified here -->
853 <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
854 failonerror="true" os="${os.windows}">
855 <arg value="--user=root"/>
856 <arg value="-p${mysql.root.password}"/>
857 <arg value="shutdown"/>
858 </exec>
859 </target>
860
861 <target name="restart-mysql" description="Shutdown and restart only mysql" depends="init,stop-mysql,start-mysql"/>
862
863
864<!-- ======================= Axis Targets ============================ -->
865
866 <target name="prepare-axis" depends="init">
867 <get src="http://www.greenstone.org/gs3files/axis-bin-1_2_1.zip"
868 dest="${packages.home}/axis-bin-1_2_1.zip"
869 usetimestamp="true"/>
870 <unzip src="${packages.home}/axis-bin-1_2_1.zip"
871 dest="${packages.home}"/>
872 <move todir="${packages.home}/axis">
873 <fileset dir="${packages.home}/axis-1_2_1"/>
874 </move>
875 <!-- install axis into greenstone web app -->
876 <copy todir="${web.lib}">
877 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/lib">
878 <include name="*.jar"/>
879 </fileset>
880 </copy>
881 <copy todir="${web.home}">
882 <fileset dir="${packages.home}/axis/webapps/axis/">
883 <include name="*.jsp"/>
884 <include name="*.jws"/>
885 </fileset>
886 </copy>
887 <copy tofile="${web.home}/axis.html" file="${packages.home}/axis/webapps/axis/index.html"/>
888 <copy todir="${web.classes}">
889 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/classes">
890 <include name="*.properties"/>
891 </fileset>
892 </copy>
893 </target>
894
895 <target name="soap-deploy-site" depends="get-sitename,get-siteuri,create-deployment-files"
896 description="Deploy a SOAP web service for a local Greenstone site">
897 <java classname="org.apache.axis.client.AdminClient">
898 <classpath refid="compile.classpath"/>
899 <arg value="-l"/>
900 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
901 <arg file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
902 </java>
903 </target>
904
905 <target name="soap-undeploy-site" depends="get-sitename"
906 description="Undeploy a SOAP web service for a local Greenstone site">
907 <java classname="org.apache.axis.client.AdminClient">
908 <classpath refid="compile.classpath"/>
909 <arg value="-l"/>
910 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
911 <arg file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
912 </java>
913 </target>
914
915 <!-- this target used to deploy the localsite server for the default installation -->
916 <target name="deploy-localsite" depends="init">
917 <antcall target="start-tomcat"/>
918 <antcall target="soap-deploy-site">
919 <param name="axis.sitename" value="localsite"/>
920 <param name="axis.siteuri" value="localsite"/>
921 </antcall>
922 <antcall target="stop-tomcat"/>
923 </target>
924
925 <target name="get-sitename" unless="axis.sitename">
926 <input addproperty="axis.sitename" message="What site? (press enter for default:localsite)" defaultvalue="localsite"/>
927 </target>
928
929 <target name="get-siteuri" depends="get-sitename" unless="axis.siteuri">
930 <input addproperty="axis.siteuri" message="What name do you want the service to have? (press enter for default:${axis.sitename})" defaultvalue="${axis.sitename}"/>
931 <echo>${axis.sitename}, ${axis.siteuri}</echo>
932 </target>
933 <target name="check-deployment-files" depends="get-sitename">
934 <condition property="deploy.exists">
935 <and>
936 <available file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
937 <available file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
938 <available file="${web.classes}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class"/>
939 </and>
940 </condition>
941 </target>
942
943 <target name="create-deployment-files" depends="get-sitename,get-siteuri,check-deployment-files"
944 if="axis.sitename" unless="deploy.exists">
945 <filter token="sitename" value="${axis.sitename}"/>
946 <filter token="siteuri" value="${axis.siteuri}"/>
947 <copy file="${basedir}/resources/soap/site.wsdd.template"
948 tofile="${basedir}/resources/soap/${axis.sitename}.wsdd"
949 filtering="true"/>
950 <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
951 tofile="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"
952 filtering="true"/>
953 <!-- create the java files and compile them -->
954 <copy file="${gsdl3.home}/SOAPServer.java.in"
955 tofile="${gsdl3.home}/SOAPServer${axis.sitename}.java"
956 filtering="true"/>
957 <mkdir dir="${build.home}"/>
958 <javac srcdir="${src.home}"
959 destdir="${build.home}"
960 debug="${compile.debug}"
961 deprecation="${compile.deprecation}"
962 optimize="${compile.optimize}">
963 <classpath refid="compile.classpath"/>
964 <include name="org/greenstone/gsdl3/SOAPServer${axis.sitename}.java" />
965 </javac>
966 <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
967 <copy file="${build.home}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class" tofile="${web.classes}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class" />
968 </target>
969
970
971<!-- ====================== Core targets ============================== -->
972<!-- core targets refer to the core gsdl3 java src -->
973
974 <target name="prepare-core" unless="nocvs.mode">
975 <!-- just get rid of empty directories-->
976 <cvs command="update -P"/>
977 </target>
978
979 <target name="configure-core"/>
980
981 <target name="update-core" depends="init,cvsupdate-core,clean-core,compile-core"
982 description="Update only the Greenstone core" />
983
984 <target name="cvsupdate-core" unless="nocvs.mode">
985 <cvs command="update -l"/>
986 <cvs command="update -dP bin comms dist-resources docs lib resources src winutil"/>
987 </target>
988
989 <target name="clean-core"
990 description="Clean only the Greenstone core">
991 <delete dir="${build.home}"/>
992 </target>
993
994 <target name="compile-core"
995 description="Compile only the Greenstone core">
996 <mkdir dir="${build.home}"/>
997 <javac srcdir="${src.home}"
998 destdir="${build.home}"
999 debug="${compile.debug}"
1000 deprecation="${compile.deprecation}"
1001 optimize="${compile.optimize}">
1002 <classpath>
1003 <path refid="compile.classpath"/>
1004 </classpath>
1005 </javac>
1006 <jar destfile="${build.home}/gsdl3.jar">
1007 <fileset dir="${build.home}">
1008 <include name="org/greenstone/gsdl3/**"/>
1009 <exclude name="**/Test.class"/>
1010 </fileset>
1011 <manifest>
1012 <attribute name="Built-By" value="${user.name}" />
1013 </manifest>
1014 </jar>
1015 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
1016 <jar destfile="${build.home}/phind.jar">
1017 <fileset dir="${build.home}">
1018 <include name="org/greenstone/applet/phind/**"/>
1019 </fileset>
1020 <manifest>
1021 <attribute name="Built-By" value="${user.name}" />
1022 </manifest>
1023 </jar>
1024 <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
1025 <jar destfile="${build.home}/anttasks.jar">
1026 <fileset dir="${build.home}">
1027 <include name="org/greenstone/anttasks/**"/>
1028 </fileset>
1029 <manifest>
1030 <attribute name="Built-By" value="${user.name}" />
1031 </manifest>
1032 </jar>
1033 <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>
1034 <jar destfile="${build.home}/gsdl3test.jar">
1035 <fileset dir="${build.home}">
1036 <include name="org/greenstone/gsdl3/**/*Test.class"/>
1037 <include name="org/greenstone/testing/**"/>
1038 </fileset>
1039 <manifest>
1040 <attribute name="Built-By" value="${user.name}" />
1041 </manifest>
1042 </jar>
1043 </target>
1044
1045<!-- ================== Packages targets ================================ -->
1046 <!-- these targets refer to the greenstone source packages - these need
1047 updating less often, so are in separate targets to the core -->
1048 <target name="prepare-packages" depends="init,prepare-mgpp,prepare-windows"/>
1049
1050 <target name="prepare-windows" depends="init" if="current.os.iswindows">
1051 <!-- need to download precompiled binaries for mg and mgpp -->
1052 </target>
1053
1054 <target name="checkout-mgpp" depends="check-cvsroot,init" unless="nocvs.mode">
1055 <cvs command="checkout -P" package="mgpp" dest="${src.packages.home}"/>
1056 </target>
1057
1058 <target name="prepare-mgpp" depends="init" unless="mgpp.present">
1059 <antcall target="checkout-mgpp"/>
1060 </target>
1061
1062 <target name="update-packages" depends="init,cvsupdate-packages,configure-packages,clean-packages,compile-packages"
1063 description="Update only the source packages"/>
1064
1065 <target name="cvsupdate-packages" unless="nocvs.mode">
1066 <cvs command="update -dP" dest="${src.packages.home}"/>
1067 </target>
1068
1069 <target name="configure-packages" description="Configure only the packages.">
1070 <echo>
1071 Configuring MG
1072 </echo>
1073 <exec executable="${mg.home}/configure" os="${os.linux},${os.mac}"
1074 dir="${mg.home}">
1075 <arg value="--prefix=${basedir}"/>
1076 <arg value="--libdir=${lib.jni}"/>
1077 </exec>
1078 <echo>
1079 Configuring MGPP
1080 </echo>
1081 <exec executable="${mgpp.home}/configure" os="${os.linux},${os.mac}"
1082 dir="${mgpp.home}">
1083 <arg value="--prefix=${basedir}"/>
1084 <arg value="--libdir=${lib.jni}"/>
1085 </exec>
1086 <echo>
1087 Configuring JavaGDBM
1088 </echo>
1089 <exec executable="${javagdbm.home}/configure" os="${os.linux}"
1090 dir="${javagdbm.home}">
1091 <arg value="--prefix=${basedir}"/>
1092 <arg value="--libdir=${lib.jni}"/>
1093 </exec>
1094 <exec executable="${javagdbm.home}/configure" os="${os.mac}"
1095 dir="${javagdbm.home}">
1096 <arg value="--prefix=${basedir}"/>
1097 <arg value="--libdir=${lib.jni}"/>
1098 <arg value="--with-gdbm=${gdbm.installed.path}"/>
1099 </exec>
1100
1101 </target>
1102
1103 <target name="clean-packages" depends="init,clean-packages-c++" description="Clean only the packages"/>
1104
1105 <target name="clean-packages-c++" depends="init">
1106 <!-- mg : just call the make target -->
1107 <exec executable="make" os="${os.linux},${os.mac}"
1108 dir="${mg.home}">
1109 <arg value="clean"/>
1110 </exec>
1111 <!-- mgpp -->
1112 <exec executable="make" os="${os.linux},${os.mac}"
1113 dir="${mgpp.home}">
1114 <arg value="clean"/>
1115 </exec>
1116 <!-- javagdbm -->
1117 <exec executable="make" os="${os.linux},${os.mac}"
1118 dir="${javagdbm.home}">
1119 <arg value="clean"/>
1120 </exec>
1121 </target>
1122
1123 <target name="distclean-packages-c++" depends="init">
1124 <!-- mg : just call the make target -->
1125 <exec executable="make" os="${os.linux},${os.mac}"
1126 dir="${mg.home}">
1127 <arg value="distclean"/>
1128 </exec>
1129 <!-- mgpp -->
1130 <exec executable="make" os="${os.linux},${os.mac}"
1131 dir="${mgpp.home}">
1132 <arg value="distclean"/>
1133 </exec>
1134 <!-- javagdbm -->
1135 <exec executable="make" os="${os.linux},${os.mac}"
1136 dir="${javagdbm.home}">
1137 <arg value="distclean"/>
1138 </exec>
1139 </target>
1140
1141 <target name="clean-windows-c++-packages" depends="init" if="current.os.iswindows"
1142 description="Clean only the C/C++ packages">
1143 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
1144 <arg value="clean"/>
1145 </exec>
1146 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
1147 <arg value="clean"/>
1148 </exec>
1149 </target>
1150
1151 <target name="compile-packages"
1152 description="Compile only the packages">
1153 <echo>Compiling MG</echo>
1154 <exec executable="make" os="${os.linux},${os.mac}"
1155 dir="${mg.home}">
1156 </exec>
1157 <exec executable="make" os="${os.linux},${os.mac}"
1158 dir="${mg.home}">
1159 <arg value="install"/>
1160 </exec>
1161 <!-- windows: just the java stuff. -->
1162 <exec executable="${mg.home}/winMake.bat" os="${os.windows}"
1163 dir="${mg.home}">
1164 <arg value="compile"/>
1165 <arg value="javaonly"/>
1166 </exec>
1167 <!-- install the jar file -->
1168 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
1169
1170 <!-- mgpp -->
1171 <echo>Compiling MGPP</echo>
1172 <exec executable="make" os="${os.linux},${os.mac}"
1173 dir="${mgpp.home}">
1174 </exec>
1175 <exec executable="make" os="${os.linux},${os.mac}"
1176 dir="${mgpp.home}">
1177 <arg value="install"/>
1178 </exec>
1179 <!-- windows: just the java stuff. -->
1180 <exec executable="${mgpp.home}/winMake.bat" os="${os.windows}"
1181 dir="${mgpp.home}">
1182 <arg value="compile"/>
1183 <arg value="javaonly"/>
1184 </exec>
1185 <!-- install the jar file -->
1186 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
1187
1188 <!-- javagdbm -->
1189 <exec executable="make" os="${os.linux},${os.mac}"
1190 dir="${javagdbm.home}">
1191 </exec>
1192 <exec executable="make" os="${os.linux},${os.mac}"
1193 dir="${javagdbm.home}">
1194 <arg value="install"/>
1195 </exec>
1196 <!-- windows: just the java stuff. -->
1197 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}"
1198 dir="${javagdbm.home}">
1199 <arg value="compile"/>
1200 <arg value="javaonly"/>
1201 </exec>
1202 <!-- install the jar file -->
1203 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
1204
1205 </target>
1206
1207 <target name="compile-windows-c++-packages" depends="init" if="current.os.iswindows"
1208 description="Compile only the C/C++ packages">
1209 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}"/>
1210 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
1211 <arg value="install"/>
1212 <env key="GSDL3HOME" value="${basedir}"/>
1213 </exec>
1214 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}"/>
1215 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
1216 <arg value="install"/>
1217 <env key="GSDL3HOME" value="${basedir}"/>
1218 </exec>
1219 <exec executable="${javagdbm.home}/winMake.bat" dir="${javagdbm.home}"/>
1220 <exec executable="${javagdbm.home}/winMake.bat" dir="${javagdbm.home}">
1221 <arg value="install"/>
1222 <env key="GSDL3HOME" value="${basedir}"/>
1223 </exec>
1224 </target>
1225
1226 <!-- =============== Extensions targets ==================== -->
1227
1228 <target name="prepare-extensions" depends="init"/>
1229
1230 <target name="cvsupdate-extensions" depends="init">
1231 <cvs command="update -dP" dest="${extensions.home}"/>
1232 </target>
1233
1234 <target name="configure-extensions"/>
1235
1236 <target name="clean-extensions" depends="init">
1237 <!-- vishnu : just call the ant target -->
1238 <ant antfile="${vishnu.home}/build.xml" dir="${vishnu.home}"
1239 inheritall="false" target="clean">
1240 <property name="catalina.home" value="${catalina.home}"/>
1241 </ant>
1242 <!-- gsdl-as : just call the ant target-->
1243 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
1244 inheritall="false" target="clean">
1245 <property name="catalina.home" value="${catalina.home}"/>
1246 </ant>
1247 </target>
1248
1249 <target name="compile-extensions">
1250 <!-- vishnu -->
1251 <echo>Compiling Vishnu</echo>
1252 <ant antfile="${vishnu.home}/build.xml" dir="${vishnu.home}"
1253 inheritall="false" target="compile">
1254 <property name="catalina.home" value="${catalina.home}"/>
1255 </ant>
1256
1257 <!-- gsdl-as -->
1258 <echo>Compiling GSDL-AS</echo>
1259 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
1260 inheritall="false" target="compile">
1261 <property name="catalina.home" value="${catalina.home}"/>
1262 </ant>
1263 </target>
1264
1265 <!-- ================== gs2building targets ===============-->
1266
1267
1268 <target name="update-gs2building" if="gsdl2.islocal"
1269 depends="init,cvsupdate-gs2building,rename-gs2build-files,configure-gs2building,clean-gs2building,compile-gs2building"
1270 description="Update only the Greenstone 2 building components"/>
1271
1272 <target name="cvsupdate-gs2building" if="gsdl2.islocal" depends="init" unless="nocvs.mode">
1273 <cvs command="update -dP" dest="${gli.home}"/>
1274 <!-- Note: can't do a -d update here cos it will get all of gsdl
1275 also, an update doesn't get new files, so we do a checkout instead. -->
1276 <cvs command="co gs2build" dest="${basedir}"/>
1277 </target>
1278
1279 <target name="prepare-gs2building" depends="init,prepare-gs2build,prepare-gli" if="gsdl2.islocal">
1280 </target>
1281
1282 <target name="checkout-gs2build" depends="check-cvsroot,init" unless="nocvs.mode">
1283 <echo>checking out gs2build</echo>
1284 <cvs command="checkout -P" package="gs2build"/>
1285 </target>
1286
1287 <target name="prepare-gs2build" depends="init" if="gsdl2.islocal" unless="gs2build.present">
1288 <antcall target="checkout-gs2build"/>
1289 <!-- rename the .gs2build files -->
1290 <antcall target="rename-gs2build-files"/>
1291 <antcall target="unzip-windows-packages"/>
1292 <antcall target="get-windows-binaries"/>
1293 <antcall target="get-macos-extra"/>
1294 </target>
1295
1296 <target name="checkout-winbin" depends="init" if="current.os.iswindows"
1297 unless="nocvs.mode">
1298 <cvs command="checkout -P" package="winbin"/>
1299 </target>
1300
1301 <target name="get-windows-binaries" depends="init,checkout-winbin" if="current.os.iswindows">
1302 <copy todir="${basedir}/bin">
1303 <fileset dir="${basedir}/winbin/bin" includes="mg*.exe"/>
1304 </copy>
1305 <move todir="${gs2build.home}/bin/windows" failonerror="false">
1306 <fileset dir="${basedir}/winbin/bin"/>
1307 </move>
1308 <delete dir="${basedir}/winbin"/>
1309 </target>
1310
1311 <target name="unzip-windows-packages" depends="init" if="current.os.iswindows">
1312 <unzip src="${gs2build.home}/packages/windows/gdbm/gdbm.zip"
1313 dest="${gs2build.home}/packages/windows/gdbm"/>
1314 <unzip src="${gs2build.home}/packages/windows/crypt/crypt.zip"
1315 dest="${gs2build.home}/packages/windows/crypt"/>
1316 <unzip src="${gs2build.home}/packages/windows/expat/expat.zip"
1317 dest="${gs2build.home}/packages/windows/expat"/>
1318 </target>
1319
1320 <!-- downloads a good XML-Parser -->
1321 <target name="get-macos-extra" depends="init" if="need.macos.extra">
1322 <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz"
1323 dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1324 usetimestamp="true"/>
1325 </target>
1326
1327 <!-- untars the XML-Parser. need to do this after compiling in gs2build-->
1328 <target name="install-macos-extra" depends="init" if="need.macos.extra">
1329 <!-- make sure these directories are present, otherwise chmod craps out
1330 this chmod is needed in case we are unpacking for a second time -->
1331 <mkdir dir="${gs2build.home}/perllib/cpan/perl-5.8"/>
1332 <mkdir dir="${gs2build.home}/perllib/cpan/perl-5.6"/>
1333 <chmod dir="${gs2build.home}/perllib/cpan/perl-5.8" perm="ug+w" includes="**"/>
1334 <chmod dir="${gs2build.home}/perllib/cpan/perl-5.6" perm="ug+w" includes="**"/>
1335 <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1336 dest="${gs2build.home}/perllib/cpan/"
1337 compression="gzip"/>
1338 </target>
1339
1340 <target name="rename-gs2build-files" depends="rename-gs2build-files-unix,rename-gs2build-files-windows"/>
1341
1342 <target name="rename-gs2build-files-windows" if="current.os.iswindows">
1343 <!-- we want a windows path in the setup.bat file -->
1344 <pathconvert targetos="windows" property="gs2build.home.windows">
1345 <path path="${gs2build.home}"/>
1346 </pathconvert>
1347
1348 <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
1349 <copy file="${gs2build-extra.home}/lib.win32.mak" tofile="${gs2build.home}/lib/win32.mak"/>
1350 <copy file="${gs2build-extra.home}/win32.mak" tofile="${gs2build.home}/win32.mak"/>
1351 <copy file="${gs2build-extra.home}/setup.bat" tofile="${gs2build.home}/setup.bat">
1352 <filterset>
1353 <filter token="gsdlhome" value="${gs2build.home.windows}"/>
1354 </filterset>
1355 </copy>
1356 </target>
1357 <target name="rename-gs2build-files-unix" if="current.os.isunix">
1358 <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
1359 <copy file="${gs2build-extra.home}/configure" tofile="${gs2build.home}/configure"/>
1360 <chmod file="${gs2build.home}/configure" perm="a+x"/>
1361 <copy file="${gs2build-extra.home}/configure.in" tofile="${gs2build.home}/configure.in"/>
1362 <copy file="${gs2build-extra.home}/Makefile.in" tofile="${gs2build.home}/Makefile.in"/>
1363 <copy file="${gs2build-extra.home}/packages.configure" tofile="${gs2build.home}/packages/configure"/>
1364 <chmod file="${gs2build.home}/packages/configure" perm="a+x"/>
1365 <copy file="${gs2build-extra.home}/packages.Makefile" tofile="${gs2build.home}/packages/Makefile"/>
1366 <copy file="${gs2build-extra.home}/lib.Makefile.in" tofile="${gs2build.home}/lib/Makefile.in"/>
1367
1368 </target>
1369 <target name="prepare-gli" depends="init" if="gsdl2.islocal" unless="gli.present">
1370 <antcall target="checkout-gli"/>
1371 </target>
1372
1373 <target name="checkout-gli" depends="check-cvsroot,init" if="gsdl2.islocal" unless="nocvs.mode">
1374 <echo>checking out gli</echo>
1375 <cvs command="checkout -P" package="gli"/>
1376 </target>
1377
1378 <target name="configure-gs2building" depends="init" if="gsdl2.islocal"
1379 description="Configure only the Greenstone 2 building components">
1380 <exec executable="${gs2build.home}/configure" os="${os.linux}"
1381 dir="${gs2build.home}">
1382 <arg value="--prefix=${gs2build.home}"/>
1383 </exec>
1384 <exec executable="${gs2build.home}/configure" os="${os.mac}"
1385 dir="${gs2build.home}">
1386 <arg value="--prefix=${gs2build.home}"/>
1387 <arg value="--with-gdbm=${gdbm.installed.path}"/>
1388 </exec>
1389 </target>
1390
1391 <target name="clean-gs2building" depends="init,clean-gli,clean-gs2build" if="gsdl2.islocal"
1392 description="Clean only the Greenstone 2 building components"/>
1393 <target name="clean-gli" depends="init">
1394 <!-- gli -->
1395 <property name="gli.home" value="${basedir}/gli"/>
1396 <!-- linux -->
1397 <exec executable="clean.sh" os="${os.linux},${os.mac}" dir="${gli.home}"
1398 resolveExecutable="true"/>
1399 <!-- windows -->
1400 <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
1401 resolveExecutable="true"/>
1402 </target>
1403 <target name="clean-gs2build" depends="init">
1404 <!-- gs2build -->
1405 <!--linux: -->
1406 <exec executable="make" os="${os.linux},${os.mac}" dir="${gs2build.home}">
1407 <arg value="clean"/>
1408 </exec>
1409 <!-- windows: -->
1410 </target>
1411 <target name="distclean-gs2build" depends="init">
1412 <!-- gs2build -->
1413 <!--linux: -->
1414 <exec executable="make" os="${os.linux},${os.mac}" dir="${gs2build.home}">
1415 <arg value="distclean"/>
1416 </exec>
1417 <!-- windows: -->
1418 </target>
1419
1420 <target name="clean-windows-c++-gs2building" depends="init" if="current.os.iswindows"
1421 description="remove all object files and executables">
1422 <!-- run the setup script -->
1423 <exec executable="${compile.windows.c++.setup}"/>
1424 <exec executable="nmake" dir="${gs2build.home}">
1425 <arg value="/f"/>
1426 <arg value="win32.mak"/>
1427 <arg value="clean"/>
1428 </exec>
1429 </target>
1430
1431 <target name="compile-gs2building" depends="init" if="gsdl2.islocal"
1432 description="Compile only the Greenstone 2 building components">
1433 <!-- gli -->
1434 <property name="gli.home" value="${basedir}/gli"/>
1435 <!-- linux -->
1436 <exec executable="makegli.sh" os="${os.linux},${os.mac}" dir="${gli.home}"
1437 resolveExecutable="true"/>
1438 <!-- windows -->
1439 <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}"
1440 resolveExecutable="true"/>
1441 <!-- gs2build -->
1442 <!--linux: make, make install -->
1443 <exec executable="make" os="${os.linux},${os.mac}" dir="${gs2build.home}">
1444 </exec>
1445 <exec executable="make" os="${os.linux},${os.mac}" dir="${gs2build.home}">
1446 <arg value="install"/>
1447 </exec>
1448 <antcall target="install-macos-extra"/>
1449 </target>
1450 <!-- windows: -->
1451 <target name="compile-windows-c++-gs2building" depends="init" if="current.os.iswindows"
1452 description="Use this if you want to compile the C++ code for the gs2build package">
1453 <!-- run the setup script -->
1454 <exec executable="${compile.windows.c++.setup}"/>
1455 <exec executable="nmake" dir="${gs2build.home}">
1456 <arg value="/f"/>
1457 <arg value="win32.mak"/>
1458 </exec>
1459 </target>
1460 <target name="gli" description="Run the Greenstone Librarian Interface" depends="gli-local,gli-external">
1461 </target>
1462
1463 <target name="gli-local" depends="init" if="gsdl2.islocal">
1464 <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.linux}" dir="${basedir}/gli" spawn="true">
1465 <env key="gsdl3path" path="${basedir}"/>
1466 <env key="gsdlpath" path="${basedir}/gs2build"/>
1467 </exec>
1468 <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
1469 <env key="gsdl3path" path="${basedir}"/>
1470 <env key="gsdlpath" path="${basedir}/gs2build"/>
1471 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.installed.path}/lib"/>
1472 </exec>
1473 <exec executable="${basedir}/gli/gli4gs3.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
1474 <env key="GSDL3PATH" path="${basedir}"/>
1475 <env key="GSDLPATH" path="${basedir}/gs2build"/>
1476 </exec>
1477 <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.
1478 </echo>
1479 </target>
1480
1481 <target name="gli-external" depends="init" unless="gsdl2.islocal">
1482 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.sh" os="${os.linux},${os.mac}" dir="${gsdl2.installed.path}/gli" spawn="true">
1483 <env key="gsdl3path" path="${basedir}"/>
1484 <env key="gsdlpath" path="${gsdl2.installed.path}"/>
1485 </exec>
1486 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.bat" os="${os.windows}" dir="${gsdl2.installed.path}/gli" spawn="true">
1487 <env key="GSDL3PATH" path="${basedir}"/>
1488 <env key="GSDLPATH" path="${gsdl2.installed.path}"/>
1489 </exec>
1490 <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:
1491 (Linux/Mac OS X / Windows)
1492in greenstone3 directory: source gs3-setup.sh / gs3-setup
1493in gsdl directory: source setup.bash / setup
1494in gli directory: gli4gs3.sh / gli4gs3
1495 </echo>
1496 </target>
1497
1498
1499<!-- ======================== TESTING Targets ========================= -->
1500
1501 <target name="test" description="Run the (incomplete) JUnit test suite "
1502 depends="init">
1503 <mkdir dir="${basedir}/test"/>
1504 <junit printsummary="withOutAndErr"
1505 errorproperty="test.failed"
1506 failureproperty="test.failed"
1507 fork="${junit.fork}">
1508 <formatter type="plain"/>
1509 <classpath>
1510 <pathelement location="${build.home}/gsdl3test.jar"/>
1511 <path refid="compile.classpath"/>
1512 </classpath>
1513 <test name="${testcase}" if="testcase"/>
1514 <batchtest todir="${basedir}/test" unless="testcase">
1515 <fileset dir="${build.home}"
1516 includes="**/*Test.class"
1517 />
1518 </batchtest>
1519 </junit>
1520 <echo>
1521 *********************************************
1522 Test output can be found in directory 'test'
1523 *********************************************
1524 </echo>
1525 </target>
1526
1527
1528<!-- ====================== DISTRIBUTION Targets ========================= -->
1529
1530 <target name="prepare-for-dist-1" depends="init">
1531 <cvs command="export -D '1 second ago'" package="mgpp"
1532 dest="${src.packages.home}"
1533 cvsRoot="${cvs.root}" />
1534 <cvs command="export -D '1 second ago'" package="gs2build"
1535 cvsRoot="${cvs.root}" />
1536 <cvs command="export -D '1 second ago'" package="gli"
1537 cvsRoot="${cvs.root}" />
1538 <delete file="${gli.home}/gli.bat"/>
1539 <delete file="${gli.home}/gli.sh"/>
1540 <antcall target="rename-gs2build-files-unix"/>
1541 <antcall target="unzip-windows-packages"/>
1542 <antcall target="get-windows-binaries"/>
1543 <antcall target="get-perl-for-windows"/>
1544 <antcall target="get-macos-extra"/>
1545 <antcall target="delete-windows-files"/>
1546 <antcall target="prepare-tomcat"/>
1547 <delete file="${packages.home}/apache-tomcat-5.5.12.zip"/>
1548 <delete file="${packages.home}/apache-tomcat-5.5.12-compat.zip"/>
1549 <antcall target="configure-tomcat"/>
1550 <antcall target="prepare-axis"/>
1551 <delete file="${packages.home}/axis-bin-1_2_1.zip"/>
1552 <!-- delete old axis dir -->
1553 <delete dir="${packages.home}/axis"/>
1554 <antcall target="prepare-web"/>
1555 </target>
1556
1557 <target name="prepare-for-dist-2" depends="init">
1558 <antcall target="prepare-mysql"/>
1559 <delete file="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"/>
1560 <delete file="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"/>
1561 <delete file="${packages.home}/mysql-noinstall-4.1.15-win32.zip"/>
1562 <delete dir="${packages.home}/mysql/sql-bench"/>
1563 <delete dir="${packages.home}/mysql/tests"/>
1564 <delete dir="${packages.home}/mysql/mysql-test"/>
1565 <delete file="${packages.home}/mysql/var/log/mysql.log"/>
1566 </target>
1567
1568 <target name="prepare-for-dist-3" depends="init">
1569 <antcall target="configure-c++"/>
1570 </target>
1571
1572 <target name="prepare-for-dist-4" depends="init">
1573 <antcall target="compile"/>
1574 <antcall target="clean-packages-c++"/>
1575 <antcall target="distclean-packages-c++"/>
1576 <antcall target="clean-gs2build"/>
1577 <antcall target="distclean-gs2build"/>
1578 <antcall target="install-macos-extra"/>
1579 <xslt in="build.xml" out="dist-build.xml" style="dist-resources/convert-build-xml.xsl"/>
1580 <delete dir="${basedir}/build"/>
1581 <delete dir="${basedir}/dist-resources"/>
1582 </target>
1583
1584 <target name="get-perl-for-windows" if="current.os.iswindows">
1585 <get src="http://www.greenstone.org/gs3files/perl-for-windows.zip"
1586 dest="${gs2build.home}/bin/windows/perl-for-windows.zip"
1587 usetimestamp="true"/>
1588 <unzip src="${gs2build.home}/bin/windows/perl-for-windows.zip"
1589 dest="${gs2build.home}/bin/windows"/>
1590 <delete file="${gs2build.home}/bin/windows/perl-for-windows.zip"/>
1591 </target>
1592
1593 <target name="delete-windows-files" depends="init" unless="current.os.iswindows">
1594 <delete dir="${basedir}/winutil"/>
1595 <delete>
1596 <fileset dir="${lib.jni}" includes="*.dll"/>
1597 </delete>
1598 </target>
1599
1600 <target name="install-for-dist" depends="accept-properties,init,configure-mysql,configure,configure-tomcat">
1601 <condition property="need.xml.jars">
1602 <equals arg1="1.5" arg2="${ant.java.version}"/>
1603 </condition>
1604 <antcall target="rename-xml-jars"/>
1605 <antcall target="rename-gs2build-files-windows"/>
1606 <antcall target="deploy-localsite"/>
1607 </target>
1608</project>
1609
1610
Note: See TracBrowser for help on using the repository browser.