source: trunk/gsdl3/build.xml@ 11290

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

greenstone 3 context in tomcat now goes into a separate file in conf/Catalina/localhost, rather than into the main server.xml. also some files were moved from packages/tomcat-extra to resources/tomcat

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