source: trunk/gsdl3/build.xml@ 12207

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

removed mysql and gs3mgdemo collection stuff

  • Property svn:keywords set to Author Date Id Revision
File size: 55.5 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="gsdl-as.home" value="${extensions.home}/gsdl-as"/>
124
125<!-- ==================== Compilation Control Options ==================== -->
126
127<!--
128
129 These properties control option settings on the Javac compiler when it
130 is invoked using the <javac> task.
131
132 compile.debug Should compilation include the debug option?
133
134 compile.deprecation Should compilation include the deprecation option?
135
136 compile.optimize Should compilation include the optimize option?
137
138-->
139
140 <property name="compile.debug" value="true"/>
141 <property name="compile.deprecation" value="true"/>
142 <property name="compile.optimize" value="true"/>
143
144<!--
145
146 Rather than relying on the CLASSPATH environment variable, Ant includes
147 features that makes it easy to dynamically construct the classpath you
148 need for each compilation. The example below constructs the compile
149 classpath to include the servlet.jar file, as well as the other components
150 that Tomcat makes available to web applications automatically, plus anything
151 that you explicitly added.
152
153-->
154
155 <path id="compile.classpath">
156 <!-- Include all jar files and libraries in our jni lib directory -->
157 <pathelement location="${lib.jni}"/>
158 <fileset dir="${lib.jni}">
159 <include name="*.jar"/>
160 </fileset>
161 <!-- Include all jar files in our web lib directory -->
162 <pathelement location="${web.lib}"/>
163 <fileset dir="${web.lib}">
164 <include name="*.jar"/>
165 </fileset>
166
167 <!-- Include the axis jar files -->
168 <!--<fileset dir="${basedir}/comms/soap/axis/lib">
169 <include name="*.jar"/>
170 </fileset>-->
171
172 <!-- include the jar files from the source packages -->
173 <!-- mg and mgpp get installed into lib/jni but they may not be there yet
174 so we add them in by name -->
175 <pathelement location="${lib.jni}/mg.jar"/>
176 <pathelement location="${lib.jni}/mgpp.jar"/>
177 <pathelement location="${vishnu.home}/build/vishnu.jar"/>
178
179 <!-- Include all elements that Tomcat exposes to applications -->
180 <pathelement location="${catalina.home}/common/classes"/>
181 <fileset dir="${catalina.home}/common/endorsed">
182 <include name="*.jar"/>
183 </fileset>
184 <fileset dir="${catalina.home}/common/lib">
185 <include name="*.jar"/>
186 </fileset>
187 <pathelement location="${catalina.home}/shared/classes"/>
188 <fileset dir="${catalina.home}/shared/lib">
189 <include name="*.jar"/>
190 </fileset>
191 </path>
192
193 <path id="local.tomcat.classpath">
194 <!-- explicitly include the jni java wrappers in the classpath -->
195 <pathelement location="${lib.jni}"/>
196 <fileset dir="${lib.jni}">
197 <include name="*.jar"/>
198 </fileset>
199 </path>
200
201 <path id="local.tomcat.path">
202 <pathelement location="${mysql.home}/bin"/>
203 <pathelement location="${basedir}/bin/script"/>
204 <pathelement location="${basedir}/bin"/>
205 <pathelement location="${lib.jni}"/>
206 <pathelement path="${env.PATH}"/>
207 <pathelement path="${env.Path}"/>
208 </path>
209
210 <target name="test-setup">
211 <echo>ant java version=${ant.java.version}</echo>
212 <echo>is linux : ${current.os.isunix}</echo>
213 <echo>is mac : ${current.os.ismac}</echo>
214 <echo>is unixnotmac : ${current.os.isunixnotmac}</echo>
215 <echo>is windows : ${current.os.iswindows}</echo>
216 <echo>os.unix: ${os.unix}</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-web,prepare-collections"
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,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-tomcat"
252 description="Startup the Tomcat server." />
253
254 <target name="stop" depends="init,stop-tomcat"
255 description="Shutdown the Tomcat server."/>
256
257 <target name="restart" description="Shutdown and restart Tomcat" 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}
290If these are not acceptable, please change them and rerun this target. Continue [y/n]? />
291 </input>
292 <condition property="do.abort">
293 <equals arg1="n" arg2="${properties.ok}"/>
294 </condition>
295 <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
296 </target>
297
298 <target name="check-cvsroot">
299 <condition property="cvsroot.notset">
300 <or>
301 <not>
302 <isset property="env.CVSROOT"/>
303 </not>
304 <equals arg1="" arg2="${env.CVSROOT}"/>
305 </or>
306 </condition>
307 <fail if="cvsroot.notset" message="You need to set the CVSROOT variable"/>
308 </target>
309
310 <!-- this sets up some initial properties -->
311 <target name="init">
312
313 <condition property="java.too.old">
314 <or>
315 <equals arg1="1.1" arg2="${ant.java.version}"/>
316 <equals arg1="1.2" arg2="${ant.java.version}"/>
317 <equals arg1="1.3" arg2="${ant.java.version}"/>
318 </or>
319 </condition>
320 <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
321
322 <available file="${src.packages.home}/mgpp/text" property="mgpp.present"/>
323 <available file="${basedir}/gli" property="gli.present"/>
324 <available file="${basedir}/gs2build" property="gs2build.present"/>
325 <condition property="gsdl2.islocal">
326 <or>
327 <not>
328 <isset property="gsdl2.installed.path"/>
329 </not>
330 <equals arg1="" arg2="${gsdl2.installed.path}"/>
331 </or>
332 </condition>
333 <condition property="tomcat.islocal">
334 <or>
335 <not>
336 <isset property="tomcat.installed.path"/>
337 </not>
338 <equals arg1="" arg2="${tomcat.installed.path}"/>
339 </or>
340 </condition>
341
342 <echo>tomcat.port:${tomcat.port}, gli.present:${gli.present} gsdlislocal=${gsdl2.islocal} gs2build.present=${gs2build.present} gsdl2.installed.path = ${gsdl2.installed.path}</echo>
343 <condition property="proxy.present">
344 <and>
345 <isset property="proxy.host"/>
346 <not>
347 <equals arg1="" arg2="${proxy.host}"/>
348 </not>
349 </and>
350 </condition>
351
352 <condition property="need.macos.extra">
353 <and>
354 <isset property="current.os.ismac"/>
355 <isset property="gsdl2.islocal"/>
356 </and>
357 </condition>
358 </target>
359
360 <target name="setup-proxy" depends="init" if="proxy.present">
361 <condition property="ask.user">
362 <or>
363 <equals arg1="" arg2="${proxy.user}"/>
364 <equals arg1="" arg2="${proxy.password}"/>
365 </or>
366 </condition>
367 <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}" userproperty="proxy.username" pwordproperty="proxy.password"/>
368 <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
369 </target>
370
371 <!-- ========== Web app Targets ================================ -->
372
373 <target name="prepare-web" depends="init">
374 <mkdir dir="${web.home}/applet"/>
375 <condition property="need.xml.jars">
376 <equals arg1="1.5" arg2="${ant.java.version}"/>
377 </condition>
378 <antcall target="rename-xml-jars"/>
379 </target>
380
381 <target name="rename-xml-jars" if="need.xml.jars">
382 <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/>
383 <copy file="${web.lib}/xercesImpl.jar.tmp" tofile="${web.lib}/xercesImpl.jar"/>
384 </target>
385
386 <target name="prepare-collections" depends="init">
387 <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
388 <!-- gs2mgdemo -->
389 <unzip src="${collect.dir}/gs2mgdemo/import.zip"
390 dest="${collect.dir}/gs2mgdemo"/>
391 <unzip src="${collect.dir}/gs2mgdemo/metadata.zip"
392 dest="${collect.dir}/gs2mgdemo"/>
393 <unzip src="${collect.dir}/gs2mgdemo/index/index.zip"
394 dest="${collect.dir}/gs2mgdemo/index"/>
395 <delete file="${collect.dir}/gs2mgdemo/import.zip"/>
396 <delete file="${collect.dir}/gs2mgdemo/metadata.zip"/>
397 <delete file="${collect.dir}/gs2mgdemo/index/index.zip"/>
398 <!-- gs2mgppdemo -->
399 <unzip src="${collect.dir}/gs2mgppdemo/import.zip"
400 dest="${collect.dir}/gs2mgppdemo"/>
401 <unzip src="${collect.dir}/gs2mgppdemo/metadata.zip"
402 dest="${collect.dir}/gs2mgppdemo"/>
403 <unzip src="${collect.dir}/gs2mgppdemo/index/index.zip"
404 dest="${collect.dir}/gs2mgppdemo/index"/>
405 <delete file="${collect.dir}/gs2mgppdemo/import.zip"/>
406 <delete file="${collect.dir}/gs2mgppdemo/metadata.zip"/>
407 <delete file="${collect.dir}/gs2mgppdemo/index/index.zip"/>
408 <!-- gberg -->
409 <unzip src="${collect.dir}/gberg/index/index.zip"
410 dest="${collect.dir}/gberg/index"/>
411 <delete file="${collect.dir}/gberg/index/index.zip"/>
412 </target>
413
414
415 <target name="configure-web" depends="init"
416 description="Configure only the web app config files">
417 <!-- we want a unix path in the global.properties file -->
418 <pathconvert targetos="unix" property="gsdl3.home.unix">
419 <path path="${web.home}"/>
420 </pathconvert>
421 <filter token="gsdl3home" value="${gsdl3.home.unix}"/>
422 <filter token="tomcat.server" value="${tomcat.server}"/>
423 <filter token="tomcat.port" value="${tomcat.port}"/>
424 <copy file="${basedir}/resources/java/global.properties.in" tofile="${web.classes}/global.properties" filtering="true" overwrite="true"/>
425 <chmod file="${web.classes}/global.properties" perm="600"/>
426 </target>
427
428 <target name="compile-web" depends="init">
429 <javac srcdir="${web.classes}"
430 destdir="${web.classes}"
431 debug="${compile.debug}"
432 deprecation="${compile.deprecation}"
433 optimize="${compile.optimize}">
434 <classpath>
435 <path refid="compile.classpath"/>
436 </classpath>
437 </javac>
438 </target>
439
440 <target name="cvsupdate-web" unless="nocvs.mode">
441 <cvs command="update -dP" dest="${web.home}"/>
442 </target>
443
444 <target name="update-web" depends="init,cvsupdate-web,configure-web"
445 description="update only the web stuff (config files)"/>
446
447
448<!-- ======================= Tomcat Targets ========================== -->
449
450 <!-- this target sets up tomcat for the first time, or resets it any subsequent times -->
451 <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal">
452 <!-- check that packages dir is there -->
453 <mkdir dir="${packages.home}"/>
454 <get src="http://www.greenstone.org/gs3files/apache-tomcat-5.5.12.zip"
455 dest="${packages.home}/apache-tomcat-5.5.12.zip"
456 usetimestamp="true"/>
457 <delete dir="${packages.home}/tomcat.bak"/>
458 <move todir="${packages.home}/tomcat.bak" failonerror="false">
459 <fileset dir="${packages.home}/tomcat"/>
460 </move>
461 <unzip src="${packages.home}/apache-tomcat-5.5.12.zip"
462 dest="${packages.home}"/>
463 <condition property="need.tomcat.compat">
464 <equals arg1="1.4" arg2="${ant.java.version}"/>
465 </condition>
466 <antcall target="prepare-tomcat-compat"/>
467 <move todir="${packages.home}/tomcat">
468 <fileset dir="${packages.home}/apache-tomcat-5.5.12"/>
469 </move>
470 <copy file="${basedir}/resources/tomcat/setclasspath.bat"
471 tofile="${packages.home}/tomcat/bin/setclasspath.bat"
472 overwrite="true"/>
473 <copy file="${basedir}/resources/tomcat/setclasspath.sh"
474 tofile="${packages.home}/tomcat/bin/setclasspath.sh"
475 overwrite="true"/>
476 <!-- make sure we have execute permission for the .sh files -->
477 <chmod dir="${packages.home}/tomcat/bin" perm="ugo+rx"
478 includes="*.sh"/>
479 </target>
480
481
482 <target name="prepare-tomcat-compat" if="need.tomcat.compat">
483 <get src="http://www.greenstone.org/gs3files/apache-tomcat-5.5.12-compat.zip"
484 dest="${packages.home}/apache-tomcat-5.5.12-compat.zip"
485 usetimestamp="true"/>
486 <unzip src="${packages.home}/apache-tomcat-5.5.12-compat.zip"
487 dest="${packages.home}"/>
488 <copy file="${packages.home}/apache-tomcat-5.5.12/common/endorsed/xml-apis.jar"
489 tofile="${web.applet}/xml-apis.jar"/>
490 <copy file="${packages.home}/apache-tomcat-5.5.12/common/endorsed/xercesImpl.jar"
491 tofile="${web.applet}/xercesImpl.jar"/>
492 </target>
493
494 <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/>
495
496 <target name="configure-tomcat-local" depends="init" if="tomcat.islocal">
497 <!-- re-setup the server.xml file -->
498 <copy file="${basedir}/resources/tomcat/server.xml" tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true">
499 <filterset>
500 <filter token="port" value="${tomcat.port}"/>
501 </filterset>
502 </copy>
503 <!-- set up the greenstone3 context -->
504 <copy file="${basedir}/resources/tomcat/greenstone3.xml" tofile="${packages.home}/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true">
505 <filterset>
506 <filter token="gsdl3webhome" value="${basedir}/web"/>
507 </filterset>
508 </copy>
509 </target>
510
511 <target name="configure-tomcat-external" depends="init" unless="tomcat.islocal">
512 <!-- re-setup the server.xml file -->
513 <!-- need to edit the config file, or do we get the user to do this???-->
514 </target>
515
516 <target name="reload" description="Reload web application"
517 depends="init,setup-catalina-ant-tasks">
518 <reload url="http://${tomcat.server}:${tomcat.port}/manager" username="admin" password="admin"
519 path="${app.path}"/>
520 </target>
521
522 <target name="start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
523 <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
524 <property name="tomcat.path" refid="local.tomcat.path"/>
525 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
526 <exec executable="${catalina.home}/bin/startup.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
527 <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
528 <env key="GSDL3HOME" value="${basedir}"/>
529 <env key="PATH" path="${tomcat.path}"/>
530 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
531 <env key="CATALINA_HOME" value="${catalina.home}"/>
532 <env key="CLASSPATH" path="${tomcat.classpath}"/>
533 <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
534 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.installed.path}/lib"/> <!-- for mac os -->
535 </exec>
536 <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
537 <env key="GSDLOS" value="windows"/>
538 <env key="GSDL3HOME" value="${basedir}"/>
539 <env key="Path" path="${tomcat.path}"/>
540 <env key="PATH" path="${tomcat.path}"/>
541 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
542 <env key="CLASSPATH" path="${tomcat.classpath}"/>
543 </exec>
544 <!-- wait for the server to startup in case other targets need it running -->
545 <waitfor maxwait="5" maxwaitunit="second">
546 <and>
547 <socket server="${tomcat.server}" port="${tomcat.port}"/>
548 <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
549 </and>
550 </waitfor>
551 </target>
552 <!-- windows: do we want to launch a webrowser?? -->
553 <target name="stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
554 <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
555 <env key="CATALINA_HOME" value="${catalina.home}"/>
556 </exec>
557 <exec executable="${catalina.home}/bin/shutdown.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false"/>
558 </target>
559
560 <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/>
561
562 <target name="setup-catalina-ant-tasks">
563 <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
564 <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
565 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
566 <taskdef name="list" classname="org.apache.catalina.ant.ListTask"
567 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
568 <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"
569 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
570 <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
571 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
572 <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"
573 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
574 <taskdef name="start" classname="org.apache.catalina.ant.StartTask"
575 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
576 <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"
577 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
578 <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
579 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
580 </target>
581
582
583
584
585<!-- ======================= Axis Targets ============================ -->
586
587 <target name="prepare-axis" depends="init">
588 <get src="http://www.greenstone.org/gs3files/axis-bin-1_2_1.zip"
589 dest="${packages.home}/axis-bin-1_2_1.zip"
590 usetimestamp="true"/>
591 <unzip src="${packages.home}/axis-bin-1_2_1.zip"
592 dest="${packages.home}"/>
593 <move todir="${packages.home}/axis">
594 <fileset dir="${packages.home}/axis-1_2_1"/>
595 </move>
596 <!-- install axis into greenstone web app -->
597 <copy todir="${web.lib}">
598 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/lib">
599 <include name="*.jar"/>
600 </fileset>
601 </copy>
602 <copy todir="${web.home}">
603 <fileset dir="${packages.home}/axis/webapps/axis/">
604 <include name="*.jsp"/>
605 <include name="*.jws"/>
606 </fileset>
607 </copy>
608 <copy tofile="${web.home}/axis.html" file="${packages.home}/axis/webapps/axis/index.html"/>
609 <copy todir="${web.classes}">
610 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/classes">
611 <include name="*.properties"/>
612 </fileset>
613 </copy>
614 </target>
615
616 <target name="soap-deploy-site" depends="get-sitename,get-siteuri,create-deployment-files"
617 description="Deploy a SOAP web service for a local Greenstone site">
618 <java classname="org.apache.axis.client.AdminClient">
619 <classpath refid="compile.classpath"/>
620 <arg value="-l"/>
621 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
622 <arg file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
623 </java>
624 </target>
625
626 <target name="soap-undeploy-site" depends="get-sitename"
627 description="Undeploy a SOAP web service for a local Greenstone site">
628 <java classname="org.apache.axis.client.AdminClient">
629 <classpath refid="compile.classpath"/>
630 <arg value="-l"/>
631 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
632 <arg file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
633 </java>
634 </target>
635
636 <!-- this target used to deploy the localsite server for the default installation -->
637 <target name="deploy-localsite" depends="init">
638 <antcall target="start-tomcat"/>
639 <antcall target="soap-deploy-site">
640 <param name="axis.sitename" value="localsite"/>
641 <param name="axis.siteuri" value="localsite"/>
642 </antcall>
643 <antcall target="stop-tomcat"/>
644 </target>
645
646 <target name="get-sitename" unless="axis.sitename">
647 <input addproperty="axis.sitename" message="What site? (press enter for default:localsite)" defaultvalue="localsite"/>
648 </target>
649
650 <target name="get-siteuri" depends="get-sitename" unless="axis.siteuri">
651 <input addproperty="axis.siteuri" message="What name do you want the service to have? (press enter for default:${axis.sitename})" defaultvalue="${axis.sitename}"/>
652 <echo>${axis.sitename}, ${axis.siteuri}</echo>
653 </target>
654 <target name="check-deployment-files" depends="get-sitename">
655 <condition property="deploy.exists">
656 <and>
657 <available file="${basedir}/resources/soap/${axis.sitename}.wsdd"/>
658 <available file="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"/>
659 <available file="${web.classes}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class"/>
660 </and>
661 </condition>
662 </target>
663
664 <target name="create-deployment-files" depends="get-sitename,get-siteuri,check-deployment-files"
665 if="axis.sitename" unless="deploy.exists">
666 <filter token="sitename" value="${axis.sitename}"/>
667 <filter token="siteuri" value="${axis.siteuri}"/>
668 <copy file="${basedir}/resources/soap/site.wsdd.template"
669 tofile="${basedir}/resources/soap/${axis.sitename}.wsdd"
670 filtering="true"/>
671 <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
672 tofile="${basedir}/resources/soap/undeploy-${axis.sitename}.wsdd"
673 filtering="true"/>
674 <!-- create the java files and compile them -->
675 <copy file="${gsdl3.home}/SOAPServer.java.in"
676 tofile="${gsdl3.home}/SOAPServer${axis.sitename}.java"
677 filtering="true"/>
678 <mkdir dir="${build.home}"/>
679 <javac srcdir="${src.home}"
680 destdir="${build.home}"
681 debug="${compile.debug}"
682 deprecation="${compile.deprecation}"
683 optimize="${compile.optimize}">
684 <classpath refid="compile.classpath"/>
685 <include name="org/greenstone/gsdl3/SOAPServer${axis.sitename}.java" />
686 </javac>
687 <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
688 <copy file="${build.home}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class" tofile="${web.classes}/org/greenstone/gsdl3/SOAPServer${axis.sitename}.class" />
689 </target>
690
691
692<!-- ====================== Core targets ============================== -->
693<!-- core targets refer to the core gsdl3 java src -->
694
695 <target name="prepare-core" unless="nocvs.mode">
696 <!-- just get rid of empty directories-->
697 <cvs command="update -P"/>
698 </target>
699
700 <target name="configure-core"/>
701
702 <target name="update-core" depends="init,cvsupdate-core,clean-core,compile-core"
703 description="Update only the Greenstone core" />
704
705 <target name="cvsupdate-core" unless="nocvs.mode">
706 <cvs command="update -l"/>
707 <cvs command="update -dP bin comms dist-resources docs lib resources src winutil"/>
708 </target>
709
710 <target name="clean-core"
711 description="Clean only the Greenstone core">
712 <delete dir="${build.home}"/>
713 </target>
714
715 <target name="compile-core"
716 description="Compile only the Greenstone core">
717 <mkdir dir="${build.home}"/>
718 <javac srcdir="${src.home}"
719 destdir="${build.home}"
720 debug="${compile.debug}"
721 deprecation="${compile.deprecation}"
722 optimize="${compile.optimize}">
723 <classpath>
724 <path refid="compile.classpath"/>
725 </classpath>
726 </javac>
727 <jar destfile="${build.home}/gsdl3.jar">
728 <fileset dir="${build.home}">
729 <include name="org/greenstone/gsdl3/**"/>
730 <exclude name="**/Test.class"/>
731 </fileset>
732 <manifest>
733 <attribute name="Built-By" value="${user.name}" />
734 </manifest>
735 </jar>
736 <jar destfile="${build.home}/GAI.jar">
737 <fileset dir="${build.home}">
738 <include name="org/greenstone/admin/**"/>
739 </fileset>
740 <manifest>
741 <attribute name="Built-By" value="${user.name}" />
742 </manifest>
743 </jar>
744
745 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
746 <jar destfile="${build.home}/phind.jar">
747 <fileset dir="${build.home}">
748 <include name="org/greenstone/applet/phind/**"/>
749 </fileset>
750 <manifest>
751 <attribute name="Built-By" value="${user.name}" />
752 </manifest>
753 </jar>
754 <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
755 <jar destfile="${build.home}/anttasks.jar">
756 <fileset dir="${build.home}">
757 <include name="org/greenstone/anttasks/**"/>
758 </fileset>
759 <manifest>
760 <attribute name="Built-By" value="${user.name}" />
761 </manifest>
762 </jar>
763 <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>
764 <jar destfile="${build.home}/gsdl3test.jar">
765 <fileset dir="${build.home}">
766 <include name="org/greenstone/gsdl3/**/*Test.class"/>
767 <include name="org/greenstone/testing/**"/>
768 </fileset>
769 <manifest>
770 <attribute name="Built-By" value="${user.name}" />
771 </manifest>
772 </jar>
773 </target>
774
775<!-- ================== Packages targets ================================ -->
776 <!-- these targets refer to the greenstone source packages - these need
777 updating less often, so are in separate targets to the core -->
778 <target name="prepare-packages" depends="init,prepare-mgpp,prepare-windows"/>
779
780 <target name="prepare-windows" depends="init" if="current.os.iswindows">
781 <!-- need to download precompiled binaries for mg and mgpp -->
782 </target>
783
784 <target name="checkout-mgpp" depends="check-cvsroot,init" unless="nocvs.mode">
785 <cvs command="checkout -P" package="mgpp" dest="${src.packages.home}"/>
786 </target>
787
788 <target name="prepare-mgpp" depends="init" unless="mgpp.present">
789 <antcall target="checkout-mgpp"/>
790 </target>
791
792 <target name="update-packages" depends="init,cvsupdate-packages,configure-packages,clean-packages,compile-packages"
793 description="Update only the source packages"/>
794
795 <target name="cvsupdate-packages" unless="nocvs.mode">
796 <cvs command="update -dP" dest="${src.packages.home}"/>
797 </target>
798
799 <target name="configure-packages" description="Configure only the packages.">
800 <echo>
801 Configuring MG
802 </echo>
803 <exec executable="${mg.home}/configure" os="${os.unix}"
804 dir="${mg.home}">
805 <arg value="--prefix=${basedir}"/>
806 <arg value="--libdir=${lib.jni}"/>
807 </exec>
808 <echo>
809 Configuring MGPP
810 </echo>
811 <exec executable="${mgpp.home}/configure" os="${os.unix}"
812 dir="${mgpp.home}">
813 <arg value="--prefix=${basedir}"/>
814 <arg value="--libdir=${lib.jni}"/>
815 </exec>
816 <echo>
817 Configuring JavaGDBM
818 </echo>
819 <exec executable="${javagdbm.home}/configure" os="${os.linux},${os.solaris}"
820 dir="${javagdbm.home}">
821 <arg value="--prefix=${basedir}"/>
822 <arg value="--libdir=${lib.jni}"/>
823 </exec>
824 <exec executable="${javagdbm.home}/configure" os="${os.mac}"
825 dir="${javagdbm.home}">
826 <arg value="--prefix=${basedir}"/>
827 <arg value="--libdir=${lib.jni}"/>
828 <arg value="--with-gdbm=${gdbm.installed.path}"/>
829 </exec>
830
831 </target>
832
833 <target name="clean-packages" depends="init,clean-packages-c++" description="Clean only the packages"/>
834
835 <target name="clean-packages-c++" depends="init">
836 <!-- mg : just call the make target -->
837 <exec executable="make" os="${os.unix}"
838 dir="${mg.home}">
839 <arg value="clean"/>
840 </exec>
841 <!-- mgpp -->
842 <exec executable="make" os="${os.unix}"
843 dir="${mgpp.home}">
844 <arg value="clean"/>
845 </exec>
846 <!-- javagdbm -->
847 <exec executable="make" os="${os.unix}"
848 dir="${javagdbm.home}">
849 <arg value="clean"/>
850 </exec>
851 </target>
852
853 <target name="distclean-packages-c++" depends="init">
854 <!-- mg : just call the make target -->
855 <exec executable="make" os="${os.unix}"
856 dir="${mg.home}">
857 <arg value="distclean"/>
858 </exec>
859 <!-- mgpp -->
860 <exec executable="make" os="${os.unix}"
861 dir="${mgpp.home}">
862 <arg value="distclean"/>
863 </exec>
864 <!-- javagdbm -->
865 <exec executable="make" os="${os.unix}"
866 dir="${javagdbm.home}">
867 <arg value="distclean"/>
868 </exec>
869 </target>
870
871 <target name="clean-windows-c++-packages" depends="init" if="current.os.iswindows"
872 description="Clean only the C/C++ packages">
873 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
874 <arg value="clean"/>
875 </exec>
876 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
877 <arg value="clean"/>
878 </exec>
879 </target>
880
881 <target name="compile-packages"
882 description="Compile only the packages">
883 <echo>Compiling MG</echo>
884 <exec executable="make" os="${os.unix}"
885 dir="${mg.home}">
886 </exec>
887 <exec executable="make" os="${os.unix}"
888 dir="${mg.home}">
889 <arg value="install"/>
890 </exec>
891 <!-- windows: just the java stuff. -->
892 <exec executable="${mg.home}/winMake.bat" os="${os.windows}"
893 dir="${mg.home}">
894 <arg value="compile"/>
895 <arg value="javaonly"/>
896 </exec>
897 <!-- install the jar file -->
898 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
899
900 <!-- mgpp -->
901 <echo>Compiling MGPP</echo>
902 <exec executable="make" os="${os.unix}"
903 dir="${mgpp.home}">
904 </exec>
905 <exec executable="make" os="${os.unix}"
906 dir="${mgpp.home}">
907 <arg value="install"/>
908 </exec>
909 <!-- windows: just the java stuff. -->
910 <exec executable="${mgpp.home}/winMake.bat" os="${os.windows}"
911 dir="${mgpp.home}">
912 <arg value="compile"/>
913 <arg value="javaonly"/>
914 </exec>
915 <!-- install the jar file -->
916 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
917
918 <!-- javagdbm -->
919 <exec executable="make" os="${os.unix}"
920 dir="${javagdbm.home}">
921 </exec>
922 <exec executable="make" os="${os.unix}"
923 dir="${javagdbm.home}">
924 <arg value="install"/>
925 </exec>
926 <!-- windows: just the java stuff. -->
927 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}"
928 dir="${javagdbm.home}">
929 <arg value="compile"/>
930 <arg value="javaonly"/>
931 </exec>
932 <!-- install the jar file -->
933 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
934
935 </target>
936
937 <target name="compile-windows-c++-packages" depends="init" if="current.os.iswindows"
938 description="Compile only the C/C++ packages">
939 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
940 <env key="GSDL3HOME" value="${basedir}"/>
941 </exec>
942 <exec executable="${mg.home}/winMake.bat" dir="${mg.home}">
943 <arg value="install"/>
944 <env key="GSDL3HOME" value="${basedir}"/>
945 </exec>
946 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
947 <env key="GSDL3HOME" value="${basedir}"/>
948 </exec>
949 <exec executable="${mgpp.home}/winMake.bat" dir="${mgpp.home}">
950 <arg value="install"/>
951 <env key="GSDL3HOME" value="${basedir}"/>
952 </exec>
953 <exec executable="${javagdbm.home}/winMake.bat" dir="${javagdbm.home}">
954 <env key="GSDL3HOME" value="${basedir}"/>
955 </exec>
956 <exec executable="${javagdbm.home}/winMake.bat" dir="${javagdbm.home}">
957 <arg value="install"/>
958 <env key="GSDL3HOME" value="${basedir}"/>
959 </exec>
960 </target>
961
962 <!-- =============== Extensions targets ==================== -->
963
964 <target name="prepare-extensions" depends="init"/>
965
966 <target name="cvsupdate-extensions" depends="init">
967 <cvs command="update -dP" dest="${extensions.home}"/>
968 </target>
969
970 <target name="configure-extensions"/>
971
972 <target name="clean-extensions" depends="init">
973 <!-- vishnu : just call the ant target -->
974 <ant antfile="${vishnu.home}/build.xml" dir="${vishnu.home}"
975 inheritall="false" target="clean">
976 <property name="catalina.home" value="${catalina.home}"/>
977 </ant>
978 <!-- gsdl-as : just call the ant target-->
979 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
980 inheritall="false" target="clean">
981 <property name="catalina.home" value="${catalina.home}"/>
982 </ant>
983 </target>
984
985 <target name="compile-extensions">
986 <!-- vishnu -->
987 <echo>Compiling Vishnu</echo>
988 <ant antfile="${vishnu.home}/build.xml" dir="${vishnu.home}"
989 inheritall="false" target="compile">
990 <property name="catalina.home" value="${catalina.home}"/>
991 </ant>
992
993 <!-- gsdl-as -->
994 <echo>Compiling GSDL-AS</echo>
995 <ant antfile="${gsdl-as.home}/build.xml" dir="${gsdl-as.home}"
996 inheritall="false" target="compile">
997 <property name="catalina.home" value="${catalina.home}"/>
998 </ant>
999 </target>
1000
1001 <!-- ================== gs2building targets ===============-->
1002
1003
1004 <target name="update-gs2building" if="gsdl2.islocal"
1005 depends="init,cvsupdate-gs2building,rename-gs2build-files,configure-gs2building,clean-gs2building,compile-gs2building"
1006 description="Update only the Greenstone 2 building components"/>
1007
1008 <target name="cvsupdate-gs2building" if="gsdl2.islocal" depends="init" unless="nocvs.mode">
1009 <cvs command="update -dP" dest="${gli.home}"/>
1010 <!-- Note: can't do a -d update here cos it will get all of gsdl
1011 also, an update doesn't get new files, so we do a checkout instead. -->
1012 <cvs command="co gs2build" dest="${basedir}"/>
1013 </target>
1014
1015 <target name="prepare-gs2building" depends="init,prepare-gs2build,prepare-gli" if="gsdl2.islocal">
1016 </target>
1017
1018 <target name="checkout-gs2build" depends="check-cvsroot,init" unless="nocvs.mode">
1019 <echo>checking out gs2build</echo>
1020 <cvs command="checkout -P" package="gs2build"/>
1021 </target>
1022
1023 <target name="prepare-gs2build" depends="init" if="gsdl2.islocal" unless="gs2build.present">
1024 <antcall target="checkout-gs2build"/>
1025 <!-- rename the .gs2build files -->
1026 <antcall target="rename-gs2build-files"/>
1027 <antcall target="unzip-windows-packages"/>
1028 <antcall target="checkout-winbin"/>
1029 <antcall target="get-windows-binaries"/>
1030 <antcall target="get-macos-extra"/>
1031 </target>
1032
1033 <target name="checkout-winbin" depends="init" if="current.os.iswindows"
1034 unless="nocvs.mode">
1035 <cvs command="checkout -P" package="winbin"/>
1036 </target>
1037
1038 <target name="get-windows-binaries" depends="init" if="current.os.iswindows">
1039 <copy todir="${basedir}/bin">
1040 <fileset dir="${basedir}/winbin/bin" includes="mg*.exe"/>
1041 </copy>
1042 <move todir="${gs2build.home}/bin/windows" failonerror="false">
1043 <fileset dir="${basedir}/winbin/bin"/>
1044 </move>
1045 <delete dir="${basedir}/winbin"/>
1046 </target>
1047
1048 <target name="unzip-windows-packages" depends="init" if="current.os.iswindows">
1049 <unzip src="${gs2build.home}/packages/windows/gdbm/gdbm.zip"
1050 dest="${gs2build.home}/packages/windows/gdbm"/>
1051 <unzip src="${gs2build.home}/packages/windows/crypt/crypt.zip"
1052 dest="${gs2build.home}/packages/windows/crypt"/>
1053 <unzip src="${gs2build.home}/packages/windows/expat/expat.zip"
1054 dest="${gs2build.home}/packages/windows/expat"/>
1055 </target>
1056
1057 <!-- downloads a good XML-Parser -->
1058 <target name="get-macos-extra" depends="init" if="need.macos.extra">
1059 <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz"
1060 dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1061 usetimestamp="true"/>
1062 </target>
1063
1064 <!-- untars the XML-Parser. need to do this after compiling in gs2build-->
1065 <target name="install-macos-extra" depends="init" if="need.macos.extra">
1066 <!-- make sure these directories are present, otherwise chmod craps out
1067 this chmod is needed in case we are unpacking for a second time -->
1068 <mkdir dir="${gs2build.home}/perllib/cpan/perl-5.8"/>
1069 <mkdir dir="${gs2build.home}/perllib/cpan/perl-5.6"/>
1070 <chmod dir="${gs2build.home}/perllib/cpan/perl-5.8" perm="ug+w" includes="**"/>
1071 <chmod dir="${gs2build.home}/perllib/cpan/perl-5.6" perm="ug+w" includes="**"/>
1072 <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1073 dest="${gs2build.home}/perllib/cpan/"
1074 compression="gzip"/>
1075 </target>
1076
1077 <target name="rename-gs2build-files" depends="rename-gs2build-files-unix,rename-gs2build-files-windows"/>
1078
1079 <target name="rename-gs2build-files-windows" if="current.os.iswindows">
1080 <!-- we want a windows path in the setup.bat file -->
1081 <pathconvert targetos="windows" property="gs2build.home.windows">
1082 <path path="${gs2build.home}"/>
1083 </pathconvert>
1084
1085 <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
1086 <copy file="${gs2build-extra.home}/lib.win32.mak" tofile="${gs2build.home}/lib/win32.mak"/>
1087 <copy file="${gs2build-extra.home}/win32.mak" tofile="${gs2build.home}/win32.mak"/>
1088 <copy file="${gs2build-extra.home}/setup.bat" tofile="${gs2build.home}/setup.bat">
1089 <filterset>
1090 <filter token="gsdlhome" value="${gs2build.home.windows}"/>
1091 </filterset>
1092 </copy>
1093 </target>
1094 <target name="rename-gs2build-files-unix" if="current.os.isunix">
1095 <property name="gs2build-extra.home" value="${gs2build.home}/gs2build-extra"/>
1096 <copy file="${gs2build-extra.home}/configure" tofile="${gs2build.home}/configure"/>
1097 <chmod file="${gs2build.home}/configure" perm="a+x"/>
1098 <copy file="${gs2build-extra.home}/configure.in" tofile="${gs2build.home}/configure.in"/>
1099 <copy file="${gs2build-extra.home}/Makefile.in" tofile="${gs2build.home}/Makefile.in"/>
1100 <copy file="${gs2build-extra.home}/packages.configure" tofile="${gs2build.home}/packages/configure"/>
1101 <chmod file="${gs2build.home}/packages/configure" perm="a+x"/>
1102 <copy file="${gs2build-extra.home}/packages.Makefile" tofile="${gs2build.home}/packages/Makefile"/>
1103 <copy file="${gs2build-extra.home}/lib.Makefile.in" tofile="${gs2build.home}/lib/Makefile.in"/>
1104
1105 </target>
1106 <target name="prepare-gli" depends="init" if="gsdl2.islocal" unless="gli.present">
1107 <antcall target="checkout-gli"/>
1108 </target>
1109
1110 <target name="checkout-gli" depends="check-cvsroot,init" if="gsdl2.islocal" unless="nocvs.mode">
1111 <echo>checking out gli</echo>
1112 <cvs command="checkout -P" package="gli"/>
1113 </target>
1114
1115 <target name="configure-gs2building" depends="init" if="gsdl2.islocal"
1116 description="Configure only the Greenstone 2 building components">
1117 <exec executable="${gs2build.home}/configure" os="${os.linux},${os.solaris}"
1118 dir="${gs2build.home}">
1119 <arg value="--prefix=${gs2build.home}"/>
1120 </exec>
1121 <exec executable="${gs2build.home}/configure" os="${os.mac}"
1122 dir="${gs2build.home}">
1123 <arg value="--prefix=${gs2build.home}"/>
1124 <arg value="--with-gdbm=${gdbm.installed.path}"/>
1125 </exec>
1126 </target>
1127
1128 <target name="clean-gs2building" depends="init,clean-gli,clean-gs2build"
1129 description="Clean only the Greenstone 2 building components"/>
1130 <target name="clean-gli" depends="init" if="gsdl2.islocal">
1131 <!-- gli -->
1132 <property name="gli.home" value="${basedir}/gli"/>
1133 <!-- linux -->
1134 <exec executable="clean.sh" os="${os.unix}" dir="${gli.home}"
1135 resolveExecutable="true"/>
1136 <!-- windows -->
1137 <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
1138 resolveExecutable="true"/>
1139 </target>
1140 <target name="clean-gs2build" depends="init" if="gsdl2.islocal">
1141 <!-- gs2build -->
1142 <!--linux: -->
1143 <exec executable="make" os="${os.unix}" dir="${gs2build.home}">
1144 <arg value="clean"/>
1145 </exec>
1146 <!-- windows: -->
1147 </target>
1148 <target name="distclean-gs2build" depends="init" if="gsdl2.islocal">
1149 <!-- gs2build -->
1150 <!--linux: -->
1151 <exec executable="make" os="${os.unix}" dir="${gs2build.home}">
1152 <arg value="distclean"/>
1153 </exec>
1154 <!-- windows: -->
1155 </target>
1156
1157 <target name="clean-windows-c++-gs2building" depends="init" if="current.os.iswindows"
1158 description="remove all object files and executables">
1159 <!-- run the setup script -->
1160 <exec executable="${compile.windows.c++.setup}"/>
1161 <exec executable="nmake" dir="${gs2build.home}">
1162 <arg value="/f"/>
1163 <arg value="win32.mak"/>
1164 <arg value="clean"/>
1165 </exec>
1166 </target>
1167
1168 <target name="compile-gs2building" depends="init" if="gsdl2.islocal"
1169 description="Compile only the Greenstone 2 building components">
1170 <!-- gli -->
1171 <property name="gli.home" value="${basedir}/gli"/>
1172 <!-- linux -->
1173 <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}"
1174 resolveExecutable="true"/>
1175 <!-- windows -->
1176 <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}"
1177 resolveExecutable="true"/>
1178 <!-- gs2build -->
1179 <!--linux: make, make install -->
1180 <exec executable="make" os="${os.unix}" dir="${gs2build.home}">
1181 </exec>
1182 <exec executable="make" os="${os.unix}" dir="${gs2build.home}">
1183 <arg value="install"/>
1184 </exec>
1185 <antcall target="install-macos-extra"/>
1186 </target>
1187 <!-- windows: -->
1188 <target name="compile-windows-c++-gs2building" depends="init" if="current.os.iswindows"
1189 description="Use this if you want to compile the C++ code for the gs2build package">
1190 <!-- run the setup script -->
1191 <exec executable="${compile.windows.c++.setup}"/>
1192 <exec executable="nmake" dir="${gs2build.home}">
1193 <arg value="/f"/>
1194 <arg value="win32.mak"/>
1195 </exec>
1196 </target>
1197 <target name="gli" description="Run the Greenstone Librarian Interface" depends="gli-local,gli-external">
1198 </target>
1199
1200 <target name="gli-local" depends="init" if="gsdl2.islocal">
1201 <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.linux},${os.solaris}" dir="${basedir}/gli" spawn="true">
1202 <env key="gsdl3path" path="${basedir}"/>
1203 <env key="gsdlpath" path="${basedir}/gs2build"/>
1204 </exec>
1205 <exec executable="${basedir}/gli/gli4gs3.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
1206 <env key="gsdl3path" path="${basedir}"/>
1207 <env key="gsdlpath" path="${basedir}/gs2build"/>
1208 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.installed.path}/lib"/>
1209 </exec>
1210 <exec executable="${basedir}/gli/gli4gs3.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
1211 <env key="GSDL3PATH" path="${basedir}"/>
1212 <env key="GSDLPATH" path="${basedir}/gs2build"/>
1213 </exec>
1214 <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.
1215 </echo>
1216 </target>
1217
1218 <target name="gli-external" depends="init" unless="gsdl2.islocal">
1219 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.sh" os="${os.linux},${os.solaris}" dir="${gsdl2.installed.path}/gli" spawn="true">
1220 <env key="gsdl3path" path="${basedir}"/>
1221 <env key="gsdlpath" path="${gsdl2.installed.path}"/>
1222 </exec>
1223 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.sh" os="${os.mac}" dir="${gsdl2.installed.path}/gli" spawn="true">
1224 <env key="gsdl3path" path="${basedir}"/>
1225 <env key="gsdlpath" path="${gsdl2.installed.path}"/>
1226 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.installed.path}/lib"/>
1227 </exec>
1228 <exec executable="${gsdl2.installed.path}/gli/gli4gs3.bat" os="${os.windows}" dir="${gsdl2.installed.path}/gli" spawn="true">
1229 <env key="GSDL3PATH" path="${basedir}"/>
1230 <env key="GSDLPATH" path="${gsdl2.installed.path}"/>
1231 </exec>
1232 <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:
1233 (Linux/Mac OS X / Windows)
1234in greenstone3 directory: source gs3-setup.sh / gs3-setup
1235in gsdl directory: source setup.bash / setup
1236in gli directory: gli4gs3.sh / gli4gs3
1237 </echo>
1238 </target>
1239
1240
1241<!-- ======================== TESTING Targets ========================= -->
1242
1243 <target name="test" description="Run the (incomplete) JUnit test suite "
1244 depends="init">
1245 <mkdir dir="${basedir}/test"/>
1246 <junit printsummary="withOutAndErr"
1247 errorproperty="test.failed"
1248 failureproperty="test.failed"
1249 fork="${junit.fork}">
1250 <formatter type="plain"/>
1251 <classpath>
1252 <pathelement location="${build.home}/gsdl3test.jar"/>
1253 <path refid="compile.classpath"/>
1254 </classpath>
1255 <test name="${testcase}" if="testcase"/>
1256 <batchtest todir="${basedir}/test" unless="testcase">
1257 <fileset dir="${build.home}"
1258 includes="**/*Test.class"
1259 />
1260 </batchtest>
1261 </junit>
1262 <echo>
1263 *********************************************
1264 Test output can be found in directory 'test'
1265 *********************************************
1266 </echo>
1267 </target>
1268
1269
1270<!-- ====================== DISTRIBUTION Targets ========================= -->
1271
1272 <target name="prepare-for-dist-1" depends="init">
1273 <cvs command="export -D '1 second ago'" package="mgpp"
1274 dest="${src.packages.home}"
1275 cvsRoot="${cvs.root}" />
1276 <cvs command="export -D '1 second ago'" package="gs2build"
1277 cvsRoot="${cvs.root}" />
1278 <cvs command="export -D '1 second ago'" package="gli"
1279 cvsRoot="${cvs.root}" />
1280 <delete file="${gli.home}/gli.bat"/>
1281 <delete file="${gli.home}/gli.sh"/>
1282 <antcall target="rename-gs2build-files-unix"/>
1283 <antcall target="unzip-windows-packages"/>
1284 <antcall target="checkout-winbin"/>
1285 <antcall target="get-windows-binaries"/>
1286 <antcall target="get-perl-for-windows"/>
1287 <antcall target="get-macos-extra"/>
1288 <antcall target="delete-windows-files"/>
1289 <antcall target="prepare-tomcat"/>
1290 <delete file="${packages.home}/apache-tomcat-5.5.12.zip"/>
1291 <delete file="${packages.home}/apache-tomcat-5.5.12-compat.zip"/>
1292 <antcall target="configure-tomcat"/>
1293 <antcall target="prepare-axis"/>
1294 <delete file="${packages.home}/axis-bin-1_2_1.zip"/>
1295 <!-- delete old axis dir -->
1296 <delete dir="${packages.home}/axis"/>
1297 <antcall target="prepare-web"/>
1298 <antcall target="prepare-collections"/>
1299 </target>
1300
1301
1302 <target name="prepare-for-dist-3" depends="init">
1303 <antcall target="configure-c++"/>
1304 </target>
1305
1306 <target name="prepare-for-dist-4" depends="init">
1307 <antcall target="compile"/>
1308 <antcall target="clean-packages-c++"/>
1309 <antcall target="distclean-packages-c++"/>
1310 <antcall target="clean-gs2build"/>
1311 <antcall target="distclean-gs2build"/>
1312 <antcall target="install-macos-extra"/>
1313 <xslt in="build.xml" out="dist-build.xml" style="dist-resources/convert-build-xml.xsl"/>
1314 <delete dir="${basedir}/build"/>
1315 <delete dir="${basedir}/dist-resources"/>
1316 </target>
1317
1318 <target name="get-perl-for-windows" if="current.os.iswindows">
1319 <get src="http://www.greenstone.org/gs3files/perl-for-windows.zip"
1320 dest="${gs2build.home}/bin/windows/perl-for-windows.zip"
1321 usetimestamp="true"/>
1322 <unzip src="${gs2build.home}/bin/windows/perl-for-windows.zip"
1323 dest="${gs2build.home}/bin/windows"/>
1324 <delete file="${gs2build.home}/bin/windows/perl-for-windows.zip"/>
1325 </target>
1326
1327 <target name="delete-windows-files" depends="init" unless="current.os.iswindows">
1328 <delete dir="${basedir}/winutil"/>
1329 <delete>
1330 <fileset dir="${lib.jni}" includes="*.dll"/>
1331 </delete>
1332 </target>
1333
1334 <target name="install-for-dist" depends="accept-properties,init,configure,configure-tomcat">
1335 <condition property="need.xml.jars">
1336 <equals arg1="1.5" arg2="${ant.java.version}"/>
1337 </condition>
1338 <antcall target="rename-xml-jars"/>
1339 <antcall target="rename-gs2build-files-windows"/>
1340 <antcall target="deploy-localsite"/>
1341 </target>
1342
1343 <target name="prepare-for-source-dist" depends="init">
1344 <cvs command="export -D '1 second ago'" package="mgpp"
1345 dest="${src.packages.home}"
1346 cvsRoot="${cvs.root}" />
1347 <cvs command="export -D '1 second ago'" package="gs2build"
1348 cvsRoot="${cvs.root}" />
1349 <cvs command="export -D '1 second ago'" package="gli"
1350 cvsRoot="${cvs.root}" />
1351 <delete file="${gli.home}/gli.bat"/>
1352 <delete file="${gli.home}/gli.sh"/>
1353 <antcall target="rename-gs2build-files-unix"/>
1354 <antcall target="prepare-collections"/>
1355 <antcall target="prepare-axis"/>
1356 <delete file="${packages.home}/axis-bin-1_2_1.zip"/>
1357 <!-- delete old axis dir -->
1358 <delete dir="${packages.home}/axis"/>
1359 <!-- download the mac XML parser just in case: it will only be unpacked if on a mac -->
1360 <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz"
1361 dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
1362 usetimestamp="true"/>
1363 <xslt in="build.xml" out="dist-build.xml" style="dist-resources/convert-build-xml-source.xsl"/>
1364 <delete dir="${basedir}/dist-resources"/>
1365
1366 </target>
1367
1368 <target name="prepare-for-source" depends="init,unzip-windows-packages,rename-gs2build-files-windows,prepare-tomcat,prepare-web"/>
1369</project>
1370
1371
Note: See TracBrowser for help on using the repository browser.