source: main/trunk/greenstone3/build.xml@ 23849

Last change on this file since 23849 was 23849, checked in by davidb, 13 years ago

Addition of perl.path to help control where Perl is found.

File size: 88.3 KB
Line 
1<?xml version="1.0"?>
2<!-- ======================================================================
3 March 2005
4
5 Greenstone3 build and install script
6
7 kjdon
8 ====================================================================== -->
9<project name="greenstone3" default="usage" basedir=".">
10 <echo>os.name: ${os.name}</echo>
11
12 <!-- ============ classpath =================== -->
13 <path id="project.classpath">
14 <fileset dir="lib/java">
15 <include name="**/*.jar"/>
16 </fileset>
17 </path>
18
19 <!-- ============ self defined tasks =================== -->
20 <taskdef name="mysetproxy" classname="org.greenstone.anttasks.MySetProxy" classpathref="project.classpath"/>
21 <taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" classpathref="project.classpath"/>
22 <taskdef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
23 <!--<taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>-->
24 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
25 <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
26
27 <!-- ===================== Property Definitions =========================== -->
28
29 <!--
30
31 Each of the following properties are used in the build script.
32 Values for these properties are set by the first place they are
33 defined, from the following list:
34
35 * Definitions on the "ant" command line (ant -Dfoo=bar compile).
36
37 * Definitions from a "build.properties" file in the top level
38 source directory of this application.
39
40 * Definitions from a "build.properties" file in the user's
41 home directory.
42
43 * Default definitions in this build.xml file.
44
45 You will note below that property values can be composed based on the
46 contents of previously defined properties. This is a powerful technique
47 that helps you minimize the number of changes required when your development
48 environment is modified. Note that property composition is allowed within
49 "build.properties" files as well as in the "build.xml" script.
50
51 -->
52
53 <!-- create build.properties if it has not been created yet -->
54 <if>
55 <bool><not><available file="build.properties"/></not></bool>
56 <copy file="build.properties.in" tofile="build.properties"/>
57 </if>
58
59 <!-- create the packages dir if it has not been created yet -->
60 <mkdir dir="packages"/>
61
62 <!--the first three properties have to be put on the top to be used by build.properties-->
63 <property name="gs2build.home" value="${basedir}${file.separator}gs2build"/>
64 <property name="src.packages.home" value="${basedir}/src/packages"/>
65 <property name="flax.svn.root" value="http://svn.greenstone.org/flax"/>
66
67 <property file="build.properties"/>
68 <if><bool><available file="${user.home}/build.properties"/></bool>
69 <property file="${user.home}/build.properties"/>
70 </if>
71
72 <!-- now we've read in properties, apply defaults -->
73 <property name="disable.collection.building" value="false"/>
74
75 <!-- get properties from the environment -->
76 <property environment="env"/>
77
78 <!-- uses perl.path if set in build.properties, otherwise try for
79 environment variable PERLPATH, and failing that assumes 'perl'
80 is on environment PATH -->
81 <if><bool><isset property="env.PERLPATH"/></bool>
82 <property name="perl.path" value="${env.PERLPATH}"/>
83 </if>
84
85 <!-- full.perl.path is for pretty-printing only, e.g. used in target "start" -->
86 <if><bool><isset property="perl.path"/></bool>
87 <property name="full.perl.path" value="${perl.path}${file.separator}perl"/>
88 <else>
89 <property name="full.perl.path" value="perl (will use the enviroment variable PATH to find this executable)"/>
90 </else>
91 </if>
92
93 <!-- get the filesets defining components and executables -->
94 <import file="resources/xml/components.xml"/>
95 <import file="resources/xml/executables.xml"/>
96
97 <!-- version properties for external packages -->
98 <!-- for Java versions < 1.4, we print out the message that Java is too old.
99 For Java 1.4, we use Tomcat 5.5, for Java5 and higher, we use Tomcat 6.0-->
100 <condition property="tomcat.version" value="apache-tomcat-5.5.25" else="apache-tomcat-6.0.20">
101 <equals arg1="1.4" arg2="${ant.java.version}"/>
102 </condition>
103 <condition property="tomcat.version.major" value="5" else="6">
104 <equals arg1="1.4" arg2="${ant.java.version}"/>
105 </condition>
106 <condition property="privileged.attribute" value="privileged='true'" else="">
107 <equals arg1="6" arg2="${tomcat.version.major}"/>
108 </condition>
109
110 <property name="axis.zip.version" value="axis-bin-1_4.zip"/>
111 <property name="axis.dir.version" value="axis-1_4"/>
112 <property name="sqlite.targz.version" value="sqlite-amalgamation-3.5.9.tar.gz"/>
113
114 <property name="build.home" value="${basedir}/build"/>
115 <property name="src.home" value="${basedir}/src/java"/>
116 <property name="packages.home" value="${basedir}/packages"/>
117 <!-- this may be set in build.properties, eg if you move the web dir to
118 tomcats webapps directory -->
119 <property name="web.home" value="${basedir}/web"/>
120 <!-- jar files needed by applets go here -->
121 <property name="web.applet" value="${web.home}/applet"/>
122
123 <!-- jar files needed by the servlet (and extra ones) go here -->
124 <property name="web.lib" value="${web.home}/WEB-INF/lib"/>
125 <!-- other files needed by the servlet go here -->
126 <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
127 <!--- flax: the WordNet home -->
128 <property name="wn.home" value="${web.home}/WEB-INF/classes/flax/WordNet"/>
129
130 <!-- jni libraries and java wrappers go here -->
131 <property name="lib.jni" value="${basedir}/lib/jni"/>
132
133 <!-- other jar files needed for installation (but not runtime) go here -->
134 <property name="lib.java" value="${basedir}/lib/java"/>
135
136 <property name="javadocs" value="${basedir}/docs/javadoc"/>
137
138 <property name="app.name" value="greenstone3"/>
139 <property name="app.path" value="/${app.name}"/>
140
141 <property name="admin.dir" value="${basedir}/admin"/>
142
143 <!-- defaults - set these on the command line or in build.properties or they will take these default values-->
144 <property name="app.version" value="trunk"/>
145 <property name="branch.path" value="trunk"/>
146 <property name="branch.revision" value="HEAD"/>
147
148 <!--constants -->
149 <property name="svn.root" value="http://svn.greenstone.org"/>
150
151 <!-- catalina home is set to tomcat basedir if already installed, otherwise
152 use greenstone's tomcat -->
153 <condition property="catalina.home" value="${tomcat.installed.path}" else="${packages.home}/tomcat">
154 <and>
155 <isset property="tomcat.installed.path"/>
156 <not>
157 <equals arg1="" arg2="${tomcat.installed.path}"/>
158 </not>
159 </and>
160 </condition>
161
162 <property name="os.linux" value="Linux"/>
163 <property name="os.mac" value="Mac OS X"/>
164 <property name="os.solaris" value="SunOS"/>
165 <property name="os.unix" value="${os.linux},${os.mac},${os.solaris}"/>
166 <property name="os.windows" value="Windows 95,Windows 98,Windows 2000,Windows 2003,Windows XP,Windows NT,Windows ME,Windows Vista,Windows 7"/> <!-- check this!!!-->
167
168 <!-- this is true for linux and macs -->
169 <condition property="current.os.isunix">
170 <os family="unix"/>
171 </condition>
172
173 <condition property="current.os.isunixnotmac">
174 <and>
175 <os family="unix"/>
176 <not>
177 <os family="mac"/>
178 </not>
179 </and>
180 </condition>
181
182 <condition property="current.os.ismac">
183 <os family="mac"/>
184 </condition>
185
186 <condition property="current.os.iswindows">
187 <os family="windows"/>
188 </condition>
189
190 <!-- is there a better way to do this?? what about solaris?? -->
191 <condition property="os.bin.dir" value="windows">
192 <os family="windows"/>
193 </condition>
194 <condition property="os.bin.dir" value="darwin">
195 <os family="mac"/>
196 </condition>
197 <condition property="os.bin.dir" value="linux">
198 <and>
199 <os family="unix"/>
200 <not>
201 <os family="mac"/>
202 </not>
203 </and>
204 </condition>
205
206
207 <condition property="collection.building.disabled">
208 <and>
209 <isset property="disable.collection.building"/>
210 <istrue value="${disable.collection.building}"/>
211 </and>
212 </condition>
213
214 <condition property="collection.building.enabled">
215 <not>
216 <istrue value="${disable.collection.building}"/>
217 </not>
218 </condition>
219
220 <condition property="collection.building.enabled.windows">
221 <and>
222 <istrue value="${collection.building.enabled}"/>
223 <isset property="current.os.iswindows"/>
224 </and>
225 </condition>
226
227 <condition property="collection.building.enabled.unix">
228 <and>
229 <istrue value="${collection.building.enabled}"/>
230 <isset property="current.os.isunix"/>
231 </and>
232 </condition>
233
234 <condition property="static.arg" value="LDFLAGS=-static" else=" ">
235 <isset property="compile.static"/>
236 </condition>
237
238 <!-- If building a release then we want to adjust environment variables so that the support library can be see during compilation -->
239 <if><bool><isset property="use.support.lib"/></bool>
240 <property name="gnome-lib-dir" value="${basedir}/ext/gnome-lib-minimal/${os.bin.dir}"/>
241
242 <if><bool><isset property="env.CFLAGS"/></bool>
243 <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CFLAGS}&quot;"/>
244 <else>
245 <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome-lib-dir}/include&quot;"/>
246 </else>
247 </if>
248
249 <if><bool><isset property="env.CPPFLAGS"/></bool>
250 <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CPPFLAGS}&quot;"/>
251 <else>
252 <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome-lib-dir}/include&quot;"/>
253 </else>
254 </if>
255
256 <if><bool><isset property="env.CXXFLAGS"/></bool>
257 <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome-lib-dir}/include ${env.CXXFLAGS}&quot;"/>
258 <else>
259 <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome-lib-dir}/include&quot;"/>
260 </else>
261 </if>
262
263 <if><bool><isset property="env.LDFLAGS"/></bool>
264 <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome-lib-dir}/lib ${env.LDFLAGS}&quot;"/>
265 <else>
266 <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome-lib-dir}/lib&quot;"/>
267 </else>
268 </if>
269
270 <if><bool><isset property="env.PATH"/></bool>
271 <property name="path.arg" value="PATH=&quot;${gnome-lib-dir}/bin:${env.PATH}&quot;"/>
272 <else>
273 <property name="path.arg" value="PATH=&quot;${gnome-lib-dir}/bin&quot;"/>
274 </else>
275 </if>
276
277 <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
278 <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome-lib-dir}/lib/pkgconfig:${env.PKG_CONFIG_PATH}&quot;"/>
279 <else>
280 <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome-lib-dir}/lib/pkgconfig&quot;"/>
281 </else>
282 </if>
283
284 <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
285 <if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
286 <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib:${env.DYLD_LIBRARY_PATH}&quot;"/>
287 <else>
288 <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib&quot;"/>
289 </else>
290 </if>
291 <else>
292 <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
293 <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib:${env.LD_LIBRARY_PATH}&quot;"/>
294 <else>
295 <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib&quot;"/>
296 </else>
297 </if>
298 </else>
299 </if>
300
301 <else>
302 <if><bool><isset property="env.CFLAGS"/></bool>
303 <property name="cflags.arg" value="CFLAGS=&quot;${env.CFLAGS}&quot;"/>
304 <else>
305 <property name="cflags.arg" value=" "/>
306 </else>
307 </if>
308
309 <if><bool><isset property="env.CPPFLAGS"/></bool>
310 <property name="cppflags.arg" value="CPPFLAGS=&quot;${env.CPPFLAGS}&quot;"/>
311 <else>
312 <property name="cppflags.arg" value=" "/>
313 </else>
314 </if>
315
316 <if><bool><isset property="env.CXXFLAGS"/></bool>
317 <property name="cxxflags.arg" value="CXXFLAGS=&quot;${env.CXXFLAGS}&quot;"/>
318 <else>
319 <property name="cxxflags.arg" value=" "/>
320 </else>
321 </if>
322
323 <if><bool><isset property="env.LDFLAGS"/></bool>
324 <property name="ldflags.arg" value="LDFLAGS=&quot;${env.LDFLAGS}&quot;"/>
325 <else>
326 <property name="ldflags.arg" value=" "/>
327 </else>
328 </if>
329
330 <if><bool><isset property="env.PATH"/></bool>
331 <property name="path.arg" value="PATH=&quot;${env.PATH}&quot;"/>
332 <else>
333 <property name="path.arg" value=" "/>
334 </else>
335 </if>
336
337 <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
338 <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${env.PKG_CONFIG_PATH}&quot;"/>
339 <else>
340 <property name="pcpath.arg" value=" "/>
341 </else>
342 </if>
343
344 <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
345 <if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
346 <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${env.DYLD_LIBRARY_PATH}&quot;"/>
347 <else>
348 <property name="ldlpath.arg" value=" "/>
349 </else>
350 </if>
351 <else>
352 <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
353 <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${env.LD_LIBRARY_PATH}&quot;"/>
354 <else>
355 <property name="ldlpath.arg" value=" "/>
356 </else>
357 </if>
358 </else>
359 </if>
360 </else>
361 </if>
362 <property name="allargs" value="${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${path.arg} ${ldlpath.arg} ${pcpath.arg}"/>
363
364 <condition property="gs2.opt.args" value= " " else="--disable-mg --disable-mgpp --disable-accentfold --disable-gdbm --disable-sqlite">
365 <istrue value="${with.jni}"/>
366 </condition>
367 <condition property="gs2.compile.target" value="with-jni" else="without-jni">
368 <istrue value="${with.jni}"/>
369 </condition>
370 <condition property="gs2.install.target" value="install-with-jni" else="install-without-jni">
371 <istrue value="${with.jni}"/>
372 </condition>
373 <condition property="gs2.windows.enablejni" value="1" else="0">
374 <istrue value="${with.jni}"/>
375 </condition>
376 <condition property="gs2.windows.enablemg" value="1" else="0">
377 <istrue value="${with.jni}"/>
378 </condition>
379 <condition property="gs2.windows.enablemgpp" value="1" else="0">
380 <istrue value="${with.jni}"/>
381 </condition>
382 <!-- Should accent folding not also be set here ?? -->
383 <condition property="gs2.windows.usegdbm" value="1" else="0">
384 <istrue value="${with.jni}"/>
385 </condition>
386 <condition property="gs2.windows.usesqlite" value="1" else="0">
387 <istrue value="${with.jni}"/>
388 </condition>
389
390 <!-- where is search4j tool -->
391 <condition property="search4j.exec" value="bin/search4j.exe" else="bin/search4j">
392 <isset property="current.os.iswindows"/>
393 </condition>
394
395
396 <!-- ============= Base dirs for each package and component ============ -->
397 <property name="src.gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
398 <property name="anttasks.home" value="${src.home}/org/greenstone/anttasks"/>
399 <property name="gli.home" value="${basedir}/gli"/>
400 <property name="javagdbm.home" value="${src.packages.home}/javagdbm"/>
401
402 <condition property="common.src.home" value="${basedir}/common-src" else="${gs2build.home}${file.separator}common-src">
403 <istrue value="${disable.collection.building}"/>
404 </condition>
405
406 <property name="build.src.home" value="${gs2build.home}/build-src"/>
407 <property name="gdbm.home" value="${common.src.home}/packages/gdbm"/>
408 <property name="mg.home" value="${common.src.home}/indexers/mg"/>
409 <property name="mgpp.home" value="${common.src.home}/indexers/mgpp"/>
410 <property name="lucene.home" value="${common.src.home}/indexers/lucene-gs"/>
411
412 <!-- ==================== Compilation Control Options ==================== -->
413
414 <!--
415
416 These properties control option settings on the Javac compiler when it
417 is invoked using the <javac> task.
418
419 compile.debug Should compilation include the debug option?
420
421 compile.deprecation Should compilation include the deprecation option?
422
423 compile.optimize Should compilation include the optimize option?
424
425 -->
426
427 <property name="compile.debug" value="true"/>
428 <property name="compile.deprecation" value="true"/>
429 <property name="compile.optimize" value="true"/>
430
431 <!--
432
433 Rather than relying on the CLASSPATH environment variable, Ant includes
434 features that makes it easy to dynamically construct the classpath you
435 need for each compilation. The example below constructs the compile
436 classpath to include the servlet.jar file, as well as the other components
437 that Tomcat makes available to web applications automatically, plus anything
438 that you explicitly added.
439
440 -->
441
442 <!-- All elements that Tomcat 5 exposes to applications -->
443 <path id="tomcat5">
444 <pathelement location="${catalina.home}/common/classes"/>
445 <fileset dir="${catalina.home}/common/endorsed">
446 <include name="*.jar"/>
447 </fileset>
448 <fileset dir="${catalina.home}/common/lib">
449 <include name="*.jar"/>
450 </fileset>
451 <!-- seems to be empty, but will leave in just in case some people make use of this to customise their install: -->
452 <pathelement location="${catalina.home}/shared/classes"/>
453 <fileset dir="${catalina.home}/shared/lib">
454 <include name="*.jar"/>
455 </fileset>
456 </path>
457
458 <!-- All elements that Tomcat 6 exposes to applications -->
459 <path id="tomcat6">
460 <fileset dir="${catalina.home}/lib">
461 <include name="*.jar"/>
462 </fileset>
463 </path>
464
465 <path id="compile.classpath">
466 <!-- Include all jar files and libraries in our jni lib directory -->
467 <pathelement location="${lib.jni}"/>
468 <fileset dir="${lib.jni}">
469 <include name="*.jar"/>
470 </fileset>
471 <!-- Include all jar files in our web lib directory -->
472 <pathelement location="${web.lib}"/>
473 <fileset dir="${web.lib}">
474 <include name="*.jar"/>
475 </fileset>
476
477 <pathelement location="${lib.java}"/>
478 <fileset dir="${lib.java}">
479 <include name="*.jar"/>
480 </fileset>
481
482 <!-- include the jar files from the source packages -->
483 <!-- mg and mgpp get installed into lib/jni but they may not be there yet
484 so we add them in by name -->
485 <!-- *** is there any way to make this optional, based on ${with.jni}? -->
486 <pathelement location="${lib.jni}/mg.jar"/>
487 <pathelement location="${lib.jni}/mgpp.jar"/>
488
489 <!-- Include all elements that Tomcat exposes to applications -->
490 <path refid="tomcat${tomcat.version.major}"/>
491
492 </path>
493
494 <path id="local.tomcat.classpath">
495 <!-- explicitly include the jni java wrappers in the classpath -->
496 <pathelement location="${lib.jni}"/>
497 <fileset dir="${lib.jni}">
498 <include name="*.jar"/>
499 </fileset>
500 </path>
501
502 <path id="local.tomcat.path">
503 <pathelement location="${basedir}/bin/script"/>
504 <pathelement location="${basedir}/bin"/>
505 <pathelement location="${lib.jni}"/>
506 <pathelement path="${env.PATH}"/>
507 <pathelement path="${env.Path}"/>
508 <pathelement path="${wn.home}/bin"/>
509 </path>
510
511 <target name="test-setup">
512 <echo>ant java version=${ant.java.version}</echo>
513 <echo>is unix : ${current.os.isunix}</echo>
514 <echo>is mac : ${current.os.ismac}</echo>
515 <echo>is unixnotmac : ${current.os.isunixnotmac}</echo>
516 <echo>is windows : ${current.os.iswindows}</echo>
517 <echo>os.unix: ${os.unix}</echo>
518 </target>
519
520 <!-- ==================== Primary and Global Targets ============================= -->
521
522 <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-common-src,prepare-collection-building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections, prepare-flax"
523 description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional subversion checkouts and downloads, so you need to be online to run this.">
524
525 <!-- make sure .sh files are executable -->
526 <chmod dir="${basedir}" perm="ugo+rx"
527 includes="*.sh"/>
528 <chmod dir="${basedir}/bin/script" perm="ugo+rx"
529 includes="*.sh,*.pl"/>
530 </target>
531
532 <!-- install-common-src and install-collection-building are mutually exclusive and either one or the other will be done depending on whether collection building is enabled or not -->
533 <target name="install" depends="init,install-common-src,install-collection-building,install-runtime"
534 description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare new-install'."/>
535
536 <target name="install-common-src" depends="init"
537 description="Install (configure, compile, install) only the common-src package (shared code from Greenstone 2). " >
538 <antcall target="configure-common-src"/>
539 <antcall target="compile-common-src"/>
540 <antcall target="install-auxiliary-jar-files"/>
541 <antcall target="install-jni-files"/>
542 </target>
543
544 <target name="install-collection-building" depends="init" if="collection.building.enabled"
545 description="Install (configure, compile, install) the Greenstone 2 collection building package." >
546 <antcall target="configure-collection-building"/>
547 <antcall target="tweak-makefiles" />
548 <antcall target="compile-collection-building"/>
549 </target>
550
551
552 <target name="install-runtime" depends="init,configure,configure-packages,configure-core,compile-web,compile-packages,compile-core,compile-classpath-jars"
553 description="Install (configure, compile, install) the runtime system. Needs either common-src or collection-building to have been installed first." />
554
555 <target name="svnupdate" depends="init,svnupdate-packages,svnupdate-core,svnupdate-common-src,svnupdate-collection-building,svnupdate-web"
556 description="Do a `svn update` for all sources. Doesn't recompile the code. You need to be online to run this."/>
557
558 <target name="configure" depends="init,configure-tomcat,configure-web"
559 description="Configure the installation (not the C++ code). Includes setting up config files. Should be re-run if you change the build.properties file."/>
560
561 <target name="clean" depends="init,clean-packages,clean-core,clean-common-src,clean-collection-building,clean-classpath-jars"
562 description="Remove all old compiled code. Includes runtime and collection-building if necessary"/>
563
564 <target name="distclean" depends="init,distclean-packages,clean-core,distclean-common-src,distclean-collection-building,clean-classpath-jars"
565 description="Remove all compiled code and also any Makefiles etc generated during configure-c++. Includes runtime and collection-building as necessary"/>
566
567 <target name="update" depends="init,svnupdate,clean,install"
568 description="Update (thru Subversion) all the source (including common-src or collection-building, and runtime), then clean, and re-install. To do this without any SVN updates, run it like 'ant -Dnosvn.mode=yes update'"/>
569
570 <target name="start" depends="init,start-tomcat"
571 description="Startup the Tomcat server." >
572 <echo>${app.name} (${app.version}) server running using Apache Tomcat and Java</echo>
573 <echo>Tomcat: ${catalina.home}</echo>
574 <echo>Java : ${java.home}</echo>
575 <if><bool><available file="${build.src.home}"/></bool>
576 <echo>Perl : ${full.perl.path}</echo>
577 </if>
578 <echo>URL : http://${tomcat.server}:${tomcat.port}${app.path}/</echo>
579 <!-- assuming that index.html is not needed here -->
580 </target>
581
582 <target name="stop" depends="init,stop-tomcat"
583 description="Shutdown the Tomcat server."/>
584
585 <target name="restart" description="Shutdown and restart Tomcat" depends="init,stop,start"/>
586
587
588 <!-- =========== Help targets =================================== -->
589
590 <property name="install-command" value="ant [options] prepare install"/>
591
592 <target name="usage" description="Print a help message">
593 <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
594 <echo message=" Execute 'ant -help' for Ant help."/>
595 <echo>
596 To install Greenstone3, run '${install-command}'.
597 There are properties defined in build.properties. The install
598 process will ask you if these properties are set correctly.
599 To avoid this prompt, use the '-Dproperties.accepted=yes'
600 option.
601 To log the output, use the '-logfile build.log' option.
602 The README.txt file has more information about the ant targets
603 and install process.
604 </echo>
605 </target>
606
607 <target name="help" depends="usage" description="Print a help message"/>
608
609 <target name="debug" depends="init" description="Display all the currently used properties">
610 <echoproperties/>
611 </target>
612
613 <!-- ====== initialization and setup targets ================== -->
614
615 <target name="accept-properties" unless="properties.accepted">
616 <input addproperty="properties.ok" validargs="y,n">The following properties (among others) are being used from a build.properties file found in this directory:
617 tomcat.server=${tomcat.server}
618 tomcat.port=${tomcat.port}
619 tomcat.installed.path=${tomcat.installed.path} (this is the location of Tomcat's base dir if it is already installed)
620 proxy.host=${proxy.host}
621 proxy.port=${proxy.port}
622 disable.collection.building=${disable.collection.building}
623 If these are not acceptable, please change them and rerun this target. Continue [y/n]?
624 </input>
625 <condition property="do.abort">
626 <equals arg1="n" arg2="${properties.ok}"/>
627 </condition>
628 <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
629 </target>
630
631 <!-- this sets up some initial properties -->
632 <target name="init">
633
634 <!-- has the gs3-setup script been run?? -->
635 <condition property="gs3-setup-not-done">
636 <not>
637 <isset property="env.GSDL3HOME"/>
638 </not>
639 </condition>
640
641 <!--<fail if="gs3-setup-not-done" message="please run 'gs3-setup' (Windows) or 'source gs3-setup.sh' (Linux/Mac) before running this target."/>-->
642
643 <condition property="java.too.old">
644 <or>
645 <equals arg1="1.1" arg2="${ant.java.version}"/>
646 <equals arg1="1.2" arg2="${ant.java.version}"/>
647 <equals arg1="1.3" arg2="${ant.java.version}"/>
648 </or>
649 </condition>
650 <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
651
652 <available file="${basedir}/gli" property="gli.present"/>
653 <available file="${basedir}/common-src" property="common.src.present"/>
654 <available file="${basedir}/gs2build" property="gs2build.present"/>
655
656 <condition property="tomcat.islocal">
657 <or>
658 <not><isset property="tomcat.installed.path"/></not>
659 <equals arg1="" arg2="${tomcat.installed.path}"/>
660 </or>
661 </condition>
662
663 <echo>tomcat.port = ${tomcat.port}</echo>
664
665 <condition property="proxy.present">
666 <and>
667 <isset property="proxy.host"/>
668 <not><equals arg1="" arg2="${proxy.host}"/></not>
669 </and>
670 </condition>
671
672 <!--
673 the next block checks if the bundled tomcat is present in the 'packages' directory,
674 and checks for the lethal combination of tomcat 6 and java 1.4. Test for
675 tomcat6 is based on the presence of a file inserted by greenstone into the tomcat6
676 download, as there is no other surefire way to check tomcat version under java 1.4
677 -->
678 <condition property="packages.tomcat.ispresent" value="true" else="false">
679 <available file="packages/tomcat"/>
680 </condition>
681 <condition property="packages.tomcat.istomcat6" value="true" else="false">
682 <available file="packages/tomcat/tomcat6.txt"/>
683 </condition>
684 <if>
685 <bool>
686 <and>
687 <istrue value="${packages.tomcat.ispresent}"/>
688 <istrue value="${packages.tomcat.istomcat6}"/>
689 <equals arg1="1.4" arg2="${ant.java.version}"/>
690 </and>
691 </bool>
692 <fail>Your Java (version 1.4) is too old to work with the bundled Apache Tomcat (version 6). Please upgrade to Java version 1.5 or greater. Alternatively, you may remove the bundled Apache Tomcat from the 'packages' folder and then run 'ant prepare-tomcat'.</fail>
693 </if>
694
695 </target>
696
697 <target name="setup-proxy" depends="init" if="proxy.present">
698 <condition property="ask.user">
699 <or>
700 <equals arg1="" arg2="${proxy.user}"/>
701 <equals arg1="" arg2="${proxy.password}"/>
702 </or>
703 </condition>
704
705 <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}" userproperty="proxy.username" pwordproperty="proxy.password"/>
706 <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
707 </target>
708
709 <!-- ========== Web app Targets ================================ -->
710
711 <target name="prepare-web" depends="init">
712 <mkdir dir="${web.home}/applet"/>
713 <mkdir dir="${web.home}/logs"/>
714 </target>
715
716 <!-- if we are using java 1.5+, we need the xalan.jar file in web/WEB-INF/lib, but if we are using java 1.4, we can't have it there -->
717 <target name="configure-java-version" depends="init"
718 description="Activates or deactivates some jar libraries as needed depending on your java version">
719
720 <available property="have.xalan.jar" file="${web.lib}/xalan.jar"/>
721 <condition property="need.xalan.jar">
722 <or>
723 <equals arg1="1.5" arg2="${ant.java.version}"/>
724 <equals arg1="1.6" arg2="${ant.java.version}"/>
725 </or>
726 </condition>
727
728 <!-- if they have xalan.jar but dont need it -->
729 <if>
730 <bool>
731 <and>
732 <isset property="have.xalan.jar"/>
733 <not><isset property="need.xalan.jar"/></not>
734 </and>
735 </bool>
736 <antcall target="deactivate-xalan-jar"/>
737 </if>
738
739 <!-- if they need xalan.jar but dont have it -->
740 <if>
741 <bool>
742 <and>
743 <not><isset property="have.xalan.jar"/></not>
744 <isset property="need.xalan.jar"/>
745 </and>
746 </bool>
747 <antcall target="activate-xalan-jar"/>
748 </if>
749
750 </target>
751
752 <target name="activate-xalan-jar">
753 <echo>activating xalan.jar</echo>
754 <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/>
755 <if>
756 <bool>
757 <and>
758 <isset property="current.os.ismac"/>
759 <available file="${catalina.home}/common/endorsed" type="dir"/>
760 </and>
761 </bool>
762 <copy file="${web.lib}/xalan.jar.tmp" tofile="${catalina.home}/common/endorsed/xalan.jar"/>
763 </if>
764 </target>
765
766 <target name="deactivate-xalan-jar">
767 <echo>deactivating xalan.jar</echo>
768 <delete file="${web.lib}/xalan.jar"/>
769 <!-- should we be deleting common/endorsed/xalan.jar on mac?? -->
770 </target>
771
772
773 <target name="prepare-collections" depends="init">
774 <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
775 <property name="index.zip" value="index.zip"/>
776
777 <echo message="installing collections..."/>
778 <antcall target="gs2mgdemo-install"/>
779 <antcall target="gs2mgppdemo-install"/>
780 <antcall target="gberg-install"/>
781 </target>
782
783 <target name="gs2mgdemo-prepare" if="collect.dir">
784 <property name="gs2mgdemo.dir" value="${collect.dir}/gs2mgdemo"/>
785
786 <condition property="gs2mgdemo.present">
787 <and>
788 <available file="${gs2mgdemo.dir}/${index.zip}"/>
789 </and>
790 </condition>
791 </target>
792
793 <target name="gs2mgdemo-install" if="gs2mgdemo.present" depends="gs2mgdemo-prepare">
794 <echo> installing gs2mgdemo</echo>
795 <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${index.zip}" />
796 <echo>collection gs2mgdemo installed</echo>
797 </target>
798
799 <target name="gs2mgppdemo-prepare" if="collect.dir">
800 <property name="gs2mgppdemo.dir" value="${collect.dir}/gs2mgppdemo"/>
801
802 <condition property="gs2mgppdemo.present">
803 <and>
804 <available file="${gs2mgppdemo.dir}/${index.zip}"/>
805 </and>
806 </condition>
807 </target>
808
809 <target name="gs2mgppdemo-install" if="gs2mgppdemo.present" depends="gs2mgppdemo-prepare">
810 <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${index.zip}" />
811 <echo>collection gs2mgppdemo installed</echo>
812 </target>
813
814 <target name="gberg-prepare" if="collect.dir">
815 <property name="gberg.dir" value="${collect.dir}/gberg"/>
816 <available file="${gberg.dir}/index/${index.zip}" property="gberg.present"/>
817 </target>
818
819 <target name="gberg-install" if="gberg.present" depends="gberg-prepare">
820 <unzip dest="${gberg.dir}/index" src="${gberg.dir}/index/${index.zip}"/>
821 <echo>collection gberg installed</echo>
822 </target>
823
824 <target name="configure-web" depends="init"
825 description="Configure only the web app config files">
826 <!-- we want a unix path in the global.properties file -->
827 <pathconvert targetos="unix" property="src.gsdl3.home.unix">
828 <path path="${web.home}"/>
829 </pathconvert>
830 <filter token="gsdl3home" value="${src.gsdl3.home.unix}"/>
831 <filter token="gsdl3version" value="${app.version}"/>
832 <filter token="tomcat.server" value="${tomcat.server}"/>
833 <filter token="tomcat.port" value="${tomcat.port}"/>
834 <copy file="${basedir}/resources/java/global.properties.in" tofile="${web.classes}/global.properties" filtering="true" overwrite="true"/>
835 <copy file="${basedir}/resources/java/log4j.properties.in" tofile="${web.classes}/log4j.properties" filtering="true" overwrite="true"/>
836 <chmod file="${web.classes}/global.properties" perm="600"/>
837 <chmod file="${web.classes}/log4j.properties" perm="600"/>
838 </target>
839
840 <target name="compile-web" depends="init">
841 <javac srcdir="${web.classes}"
842 destdir="${web.classes}"
843 debug="${compile.debug}"
844 deprecation="${compile.deprecation}"
845 optimize="${compile.optimize}">
846 <classpath><path refid="compile.classpath"/></classpath>
847 </javac>
848 </target>
849
850 <target name="compile-classpath-jars" depends="init">
851 <if><bool><available file="admin/cp.mf"/></bool>
852 <jar destfile="admin/cp.jar" manifest="admin/cp.mf"/>
853 </if>
854 <if><bool><available file="${lib.java}/cp.mf"/></bool>
855 <jar destfile="${lib.java}/cp.jar" manifest="${lib.java}/cp.mf"/>
856 </if>
857 <if><bool><available file="${lib.jni}/cp.mf"/></bool>
858 <jar destfile="${lib.jni}/cp.jar" manifest="${lib.jni}/cp.mf"/>
859 </if>
860 <if><bool><available file="${web.lib}/cp.mf"/></bool>
861 <jar destfile="${web.lib}/cp.jar" manifest="${web.lib}/cp.mf"/>
862 </if>
863 <jar destfile="cp.jar">
864 <manifest>
865 <attribute name="Class-Path" value="server.jar admin/cp.jar lib/java/cp.jar lib/jni/cp.jar web/WEB-INF/lib/cp.jar"/>
866 </manifest>
867 </jar>
868 </target>
869
870 <target name="clean-classpath-jars" depends="init">
871 <delete file="admin/cp.jar"/>
872 <delete file="${lib.java}/cp.jar"/>
873 <delete file="${lib.jni}/cp.jar"/>
874 <delete file="${web.lib}/cp.jar"/>
875 <delete file="cp.jar"/>
876 </target>
877
878
879 <target name="svnupdate-web" unless="nosvn.mode">
880 <exec executable="svn">
881 <arg value="update"/>
882 <arg value="${web.home}"/>
883 <arg value="-r"/><arg value="${branch.revision}"/>
884 </exec>
885 </target>
886
887 <target name="update-web" depends="init,svnupdate-web,configure-web"
888 description="update only the web stuff (config files)"/>
889
890 <!-- ======================= Tomcat Targets ========================== -->
891
892 <!-- this target downloads and installs Tomcat -->
893 <!-- we download tomcat (version 6 for Java 1.5 and later, version 5 for Java 1.4 plus the 1.4 compatibility package). -->
894 <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal"
895 description="downloads the appropriate version of Tomcat (Tomcat 5 if using Java 1.4, Tomcat 6 if using Java 1.5 or higher). If you want to change which version of Java you are using between 1.4 and 1.5/6 then you need to run prepare-tomcat">
896 <if>
897 <bool>
898 <not><available file="${packages.home}/tomcat/.flagfile"/></not>
899 </bool>
900
901 <!-- check that packages dir is there -->
902 <mkdir dir="${packages.home}"/>
903 <get src="http://www.greenstone.org/gs3files/${tomcat.version}.zip"
904 dest="${packages.home}/${tomcat.version}.zip"
905 usetimestamp="true"/>
906 <unzip src="${packages.home}/${tomcat.version}.zip"
907 dest="${packages.home}"/>
908
909 <!-- If we are using Java 1.4, we'd be using tomcat 5.5 in which case
910 we would need to have the tomcat compat package to work with Java 1.4-->
911 <if>
912 <bool><equals arg1="1.4" arg2="${ant.java.version}"/></bool>
913 <get src="http://www.greenstone.org/gs3files/${tomcat.version}-compat.zip"
914 dest="${packages.home}/${tomcat.version}-compat.zip"
915 usetimestamp="true"/>
916 <unzip src="${packages.home}/${tomcat.version}-compat.zip"
917 dest="${packages.home}"/>
918 </if>
919
920 <!-- delete any existing tomcat -->
921 <delete dir="${packages.home}/tomcat"/>
922 <move todir="${packages.home}/tomcat">
923 <fileset dir="${packages.home}/${tomcat.version}"/>
924 </move>
925 <copy file="${basedir}/resources/tomcat/setclasspath.bat"
926 tofile="${packages.home}/tomcat/bin/setclasspath.bat"
927 overwrite="true"/>
928 <copy file="${basedir}/resources/tomcat/setclasspath.sh"
929 tofile="${packages.home}/tomcat/bin/setclasspath.sh"
930 overwrite="true"/>
931 <!-- make sure we have execute permission for the .sh files -->
932 <chmod dir="${packages.home}/tomcat/bin" perm="ugo+rx"
933 includes="*.sh"/>
934
935 <echo file="${packages.home}/tomcat/.flagfile">
936 the timestamp of this file is the time that tomcat was extracted from the zip files.
937 it is used to figure out whether the files need to be refreshed or not in `ant prepare-tomcat`
938 </echo>
939
940 <!-- this is not strictly a prepare tomcat thing, but if one changes
941 Java, then they need to change tomcat as well, so might as well call
942 it here -->
943 <antcall target="configure-java-version"/>
944 <else>
945 <echo>Tomcat has been prepared, will not prepare</echo>
946 <echo>Delete ${packages.home}/tomcat/.flagfile to force refresh</echo>
947 </else>
948
949 </if>
950
951 </target>
952
953 <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/>
954
955 <target name="configure-tomcat-local" depends="init" if="tomcat.islocal">
956 <!-- re-setup the server.xml file -->
957 <copy file="${basedir}/resources/tomcat/server_tomcat${tomcat.version.major}.xml"
958 tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true">
959 <filterset>
960 <filter token="port" value="${tomcat.port}"/>
961 <filter token="shutdown-port" value="${tomcat.shutdown.port}"/>
962 </filterset>
963 </copy>
964 <!-- set up the greenstone3 context -->
965 <copy file="${basedir}/resources/tomcat/greenstone3.xml" tofile="${packages.home}/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true">
966 <filterset>
967 <filter token="gsdl3webhome" value="${web.home}"/>
968 <filter token="privilegedattribute" value ="${privileged.attribute}"/>
969 </filterset>
970 </copy>
971 </target>
972
973 <target name="configure-tomcat-external" depends="init" unless="tomcat.islocal">
974 <!-- re-setup the server.xml file -->
975 <!-- need to edit the config file, or do we get the user to do this???-->
976 </target>
977
978<!-- Another way: http://ptrthomas.wordpress.com/2006/03/25/how-to-start-and-stop-tomcat-from-ant/ -->
979 <target name="start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
980 <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
981 <property name="tomcat.path" refid="local.tomcat.path"/>
982 <property name="catalina.opts" value="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=$GSDL3HOME -DGSDLOS=$GSDLOS -DPATH=$PATH -Xmx400M"/>
983 <exec executable="${catalina.home}/bin/startup.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
984 <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
985 <env key="GSDL3HOME" value="${basedir}"/>
986 <env key="PERLPATH" value="${perl.path}"/>
987 <env key="PATH" path="${tomcat.path}"/>
988 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
989 <env key="CATALINA_HOME" value="${catalina.home}"/>
990 <env key="CLASSPATH" path="${tomcat.classpath}"/>
991 <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
992 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here these days ??-->
993 <env key="WNHOME" path="${wn.home}"/>
994 </exec>
995 <exec executable="${catalina.home}/bin/startup.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="true">
996 <env key="GSDLOS" value="windows"/>
997 <env key="GSDL3HOME" value="${basedir}"/>
998 <env key="PERLPATH" value="${perl.path}"/>
999 <env key="Path" path="${tomcat.path}"/>
1000 <env key="PATH" path="${tomcat.path}"/>
1001 <env key="CATALINA_OPTS" value="${catalina.opts}"/>
1002 <env key="CATALINA_HOME" value="${catalina.home}"/>
1003 <env key="CLASSPATH" path="${tomcat.classpath}"/>
1004 </exec>
1005 <!-- wait for the server to startup in case other targets need it running -->
1006 <waitfor maxwait="5" maxwaitunit="second">
1007 <and>
1008 <socket server="${tomcat.server}" port="${tomcat.port}"/>
1009 <http url="http://${tomcat.server}:${tomcat.port}${app.path}/index.html"/>
1010 </and>
1011 </waitfor>
1012 </target>
1013
1014 <!--ant task http: http://www.jajakarta.org/ant/ant-1.6.1/docs/ja/manual/api/org/apache/tools/ant/taskdefs/condition/Http.html-->
1015 <target name="reconfigure" description="Reconfigure the message router">
1016 <waitfor maxwait="5" maxwaitunit="second">
1017 <http url="http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}?a=s&amp;sa=c"/>
1018 </waitfor>
1019 </target>
1020
1021 <!--Command-line args to Ant: http://www.jguru.com/faq/view.jsp?EID=471794-->
1022 <target name="reconfigure-collection" description="Reconfigure the collection">
1023 <waitfor maxwait="5" maxwaitunit="second">
1024 <http url="http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}?a=s&amp;sa=c&amp;sc=${collection}"/>
1025 </waitfor>
1026 </target>
1027
1028 <!-- windows: do we want to launch a webrowser?? -->
1029 <!-- shouldn't this test whether anything is running first? -->
1030 <target name="stop-tomcat" description="Shutdown only Tomcat" depends="init" if="tomcat.islocal">
1031 <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
1032 <env key="CATALINA_HOME" value="${catalina.home}"/>
1033 </exec>
1034 <exec executable="${catalina.home}/bin/shutdown.bat" os="${os.windows}" dir="${catalina.home}/bin" spawn="false">
1035 <env key="CATALINA_HOME" value="${catalina.home}"/>
1036 </exec>
1037 </target>
1038
1039 <target name="restart-tomcat" description="Shutdown and restart only Tomcat" depends="init,stop-tomcat,start-tomcat"/>
1040
1041 <target name="setup-catalina-ant-tasks">
1042 <!-- Configure the custom Ant tasks for the Tomcat Manager application -->
1043 <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
1044 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1045 <taskdef name="list" classname="org.apache.catalina.ant.ListTask"
1046 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1047 <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"
1048 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1049 <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
1050 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1051 <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"
1052 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1053 <taskdef name="start" classname="org.apache.catalina.ant.StartTask"
1054 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1055 <taskdef name="stop" classname="org.apache.catalina.ant.StopTask"
1056 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1057 <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
1058 classpath="${catalina.home}/server/lib/catalina-ant.jar"/>
1059 </target>
1060
1061
1062 <!-- ======================= ant Targets ============================ -->
1063 <target name="prepare-ant" depends="init">
1064 <if>
1065 <bool>
1066 <not><available file="${packages.home}/ant/.flagfile"/></not>
1067 </bool>
1068
1069 <get src="http://www.greenstone.org/gs3files/apache-ant-1.7.0-bin.zip"
1070 dest="${packages.home}/apache-ant-1.7.0-bin.zip"
1071 usetimestamp="true"/>
1072 <unzip src="${packages.home}/apache-ant-1.7.0-bin.zip"
1073 dest="${packages.home}"/>
1074 <move todir="${packages.home}/ant">
1075 <fileset dir="${packages.home}/apache-ant-1.7.0"/>
1076 </move>
1077 <echo file="${packages.home}/ant/.flagfile">
1078 the timestamp of this file is the time that ant was extracted from the zip files.
1079 it is used to figure out whether the files need to be refreshed or not in `ant prepare-ant`
1080 </echo>
1081
1082 <else>
1083 <echo>Ant has been prepared, will not prepare</echo>
1084 <echo>Delete ${packages.home}/ant/.flagfile to force refresh</echo>
1085 </else>
1086
1087 </if>
1088 </target>
1089
1090 <!-- ======================= Axis Targets ============================ -->
1091
1092 <target name="prepare-axis" depends="init">
1093
1094 <if>
1095 <bool>
1096 <not><available file="${packages.home}/axis/.flagfile"/></not>
1097 </bool>
1098
1099 <get src="http://www.greenstone.org/gs3files/${axis.zip.version}"
1100 dest="${packages.home}/${axis.zip.version}"
1101 usetimestamp="true"/>
1102 <unzip src="${packages.home}/${axis.zip.version}"
1103 dest="${packages.home}"/>
1104 <move todir="${packages.home}/axis">
1105 <fileset dir="${packages.home}/${axis.dir.version}"/>
1106 </move>
1107 <!-- install axis into greenstone web app -->
1108 <copy todir="${web.lib}">
1109 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/lib">
1110 <include name="*.jar"/>
1111 </fileset>
1112 </copy>
1113 <copy todir="${web.home}">
1114 <fileset dir="${packages.home}/axis/webapps/axis/">
1115 <include name="*.jsp"/>
1116 <include name="*.jws"/>
1117 </fileset>
1118 </copy>
1119 <copy tofile="${web.home}/axis.html" file="${packages.home}/axis/webapps/axis/index.html"/>
1120 <copy todir="${web.classes}">
1121 <fileset dir="${packages.home}/axis/webapps/axis/WEB-INF/classes">
1122 <include name="*.properties"/>
1123 </fileset>
1124 </copy>
1125 <echo file="${packages.home}/axis/.flagfile">
1126 the timestamp of this file is the time that axis was extracted from the zip files.
1127 it is used to figure out whether the files need to be refreshed or not in `ant prepare-axis`
1128 </echo>
1129
1130 <else>
1131 <echo>Axis has been prepared, will not prepare</echo>
1132 <echo>Delete ${packages.home}/axis/.flagfile to force refresh</echo>
1133 </else>
1134
1135 </if>
1136 </target>
1137
1138 <target name="soap-deploy-site" depends="init,get-sitename,get-siteuri,get-webservices,create-deployment-files,deploy-site"
1139 description="Deploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."/>
1140
1141 <target name="deploy-site">
1142 <java classname="org.apache.axis.client.AdminClient">
1143 <classpath refid="compile.classpath"/>
1144 <arg value="-l"/>
1145 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
1146 <arg file="${basedir}/resources/soap/deploy.wsdd"/>
1147 </java>
1148 <delete file="${basedir}/resources/soap/deploy.wsdd"/> <!--clean up, no longer used-->
1149 </target>
1150
1151 <target name="soap-undeploy-site" depends="get-undeploy-service-name"
1152 description="Undeploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work.">
1153 <filter token="servicesname" value="${axis.undeploy.servicename}"/>
1154 <copy file="${basedir}/resources/soap/undeploy-site.wsdd.template"
1155 tofile="${basedir}/resources/soap/undeploy.wsdd"
1156 filtering="true"
1157 overwrite="true"/>
1158 <java classname="org.apache.axis.client.AdminClient">
1159 <classpath refid="compile.classpath"/>
1160 <arg value="-l"/>
1161 <arg value="http://${tomcat.server}:${tomcat.port}${app.path}/servlet/AxisServlet"/>
1162 <arg file="${basedir}/resources/soap/undeploy.wsdd"/>
1163 </java>
1164 <delete file="${basedir}/resources/soap/undeploy.wsdd"/> <!--clean up, no longer used-->
1165 </target>
1166
1167 <!-- this target used to deploy the default web service SOAPServer (base.webservice.name) on the localsite server
1168 with the default servicename of localsite-->
1169 <target name="deploy-localsite" depends="init"
1170 description="Deploy the SOAP server for localsite. Will start and stop Tomcat.">
1171 <antcall target="start-tomcat"/>
1172 <echo>Deploying ${base.webservice.name} web services for localsite under service name: localsite</echo>
1173 <antcall target="create-deployment-files">
1174 <param name="axis.sitename" value="localsite"/>
1175 <param name="axis.servicesname" value="${base.webservice.name}"/>
1176 <param name="axis.siteuri" value="localsite"/>
1177 </antcall>
1178 <antcall target="deploy-site">
1179 <param name="axis.sitename" value="localsite"/>
1180 <param name="axis.servicesname" value="${base.webservice.name}"/>
1181 <param name="axis.siteuri" value="localsite"/>
1182 </antcall>
1183 <echo>The Greenstone server has been started up. If you do not want it running, please type: ant stop.</echo>
1184 </target>
1185
1186 <target name="get-sitename" unless="axis.sitename">
1187 <input addproperty="axis.sitename" defaultvalue="localsite">What site do you want to deploy services for?
1188Press Enter for default:localsite</input>
1189 </target>
1190
1191 <target name="get-undeploy-service-name" unless="axis.undeploy.servicename">
1192 <input addproperty="axis.undeploy.servicename" defaultvalue="localsite">Please enter the full name of the service you wish to undeploy.
1193To find out which web services you've got deployed, point your browser to http://HOST:PORT/greenstone3/services
1194Or press Enter for undeploying the default:localsite /&gt;</input>
1195 <echo>Name of service to undeploy: ${axis.undeploy.servicename}</echo>
1196 </target>
1197
1198 <target name="get-webservices" unless="axis.servicesname">
1199 <input addproperty="axis.servicesname" defaultvalue="${base.webservice.name}">Which set of web services do you want to deploy?
1200Choose from: ${web.services.list}
1201Or press Enter for default:${base.webservice.name} /&gt;</input>
1202 <echo>${axis.servicesname}</echo>
1203 </target>
1204
1205 <target name="get-siteuri" depends="get-sitename,get-webservices" unless="axis.siteuri">
1206 <input addproperty="axis.siteuri" defaultvalue="${axis.servicesname}${axis.sitename}">What name do you want the service to have? (Press Enter for default:${axis.servicesname}${axis.sitename})</input>
1207 <echo>Site: ${axis.sitename}, services: ${axis.servicesname}, servicesname: ${axis.siteuri}</echo>
1208 </target>
1209
1210 <target name="set-soapmethod" description="Determines whether the service in the wsdd should have the style attribute set to message or the provider attribute set to java:RPC" if="axis.servicesname">
1211 <condition property="soap.method" value="provider='java:MSG' style='message' use='literal'">
1212 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
1213 </condition>
1214
1215 <!--everything else defaults to java:RPC at present-->
1216 <condition property="soap.method" value="provider='java:RPC'">
1217 <not>
1218 <equals arg1="${axis.servicesname}" arg2="${base.webservice.name}"/>
1219 </not>
1220 </condition>
1221 </target>
1222
1223 <target name="create-deployment-files" depends="set-soapmethod" if="axis.sitename">
1224 <filter token="sitename" value="${axis.sitename}"/>
1225 <filter token="siteuri" value="${axis.siteuri}"/>
1226 <filter token="servicesname" value="${axis.servicesname}"/>
1227 <filter token="soapmethod" value="${soap.method}"/>
1228 <copy file="${basedir}/resources/soap/site.wsdd.template"
1229 tofile="${basedir}/resources/soap/deploy.wsdd"
1230 filtering="true"
1231 overwrite="true"/>
1232 <!-- create the java files and compile them -->
1233 <copy file="${basedir}/resources/java/${axis.servicesname}.java.in"
1234 tofile="${src.gsdl3.home}/${axis.servicesname}${axis.sitename}.java"
1235 filtering="true"
1236 overwrite="true"/>
1237 <mkdir dir="${build.home}"/>
1238 <javac srcdir="${src.home}"
1239 destdir="${build.home}"
1240 debug="${compile.debug}"
1241 deprecation="${compile.deprecation}"
1242 optimize="${compile.optimize}">
1243 <classpath refid="compile.classpath"/>
1244 <include name="org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.java" />
1245 </javac>
1246 <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
1247 <copy file="${build.home}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
1248 tofile="${web.classes}/org/greenstone/gsdl3/${axis.servicesname}${axis.sitename}.class"
1249 overwrite="true" />
1250 </target>
1251
1252
1253 <!-- ====================== Core targets ============================== -->
1254 <!-- core targets refer to the core gsdl3 java src -->
1255
1256 <target name="prepare-core"/>
1257
1258 <target name="configure-core"/>
1259
1260 <target name="update-core" depends="init,svnupdate-core,clean-core,compile-core"
1261 description="Update only the Greenstone core" />
1262
1263 <target name="svnupdate-core" unless="nosvn.mode">
1264 <exec executable="svn">
1265 <arg value="update"/>
1266 <arg value="${basedir}"/>
1267 <arg value="-r"/><arg value="${branch.revision}"/>
1268 </exec>
1269 </target>
1270
1271 <target name="clean-core"
1272 description="Clean only the Greenstone core">
1273 <!-- should this delete the gsdl3.jar from web/WEB-INF?? -->
1274 <delete dir="${build.home}"/>
1275 </target>
1276
1277 <target name="compile-core" depends="init"
1278 description="Compile only the Greenstone core">
1279 <mkdir dir="${build.home}"/>
1280 <if><bool><isset property="with.jni"/></bool>
1281 <javac srcdir="${src.home}"
1282 destdir="${build.home}"
1283 debug="${compile.debug}"
1284 deprecation="${compile.deprecation}"
1285 optimize="${compile.optimize}">
1286 <classpath>
1287 <path refid="compile.classpath"/>
1288 </classpath>
1289 </javac>
1290 <else>
1291 <property name="gsprefix" value=""/>
1292 <javac srcdir="${src.home}"
1293 destdir="${build.home}"
1294 debug="${compile.debug}"
1295 deprecation="${compile.deprecation}"
1296 optimize="${compile.optimize}">
1297 <classpath>
1298 <path refid="compile.classpath"/>
1299 </classpath>
1300 <exclude name="org/greenstone/gsdl3/service/GS2MGPPRetrieve.java"/>
1301 <exclude name="org/greenstone/gsdl3/service/GS2MGPPSearch.java"/>
1302 <exclude name="org/greenstone/gsdl3/service/GS2MGSearch.java"/>
1303 <exclude name="org/greenstone/gsdl3/service/GS2MGRetrieve.java"/>
1304 <exclude name="org/greenstone/gsdl3/service/GoogleNgramMGPPSearch.java"/>
1305 <exclude name="org/greenstone/gsdl3/service/PhindPhraseBrowse.java"/>
1306 <exclude name="org/greenstone/gsdl3/util/GDBMWrapper.java"/>
1307 </javac>
1308 </else>
1309 </if>
1310 <jar destfile="${build.home}/gsdl3.jar">
1311 <fileset dir="${build.home}">
1312 <include name="org/greenstone/gsdl3/**"/>
1313 <include name="org/flax/**"/>
1314 <exclude name="**/Test.class"/>
1315 </fileset>
1316 <manifest>
1317 <attribute name="Built-By" value="${user.name}" />
1318 </manifest>
1319 </jar>
1320 <copy file="${build.home}/gsdl3.jar" todir="${web.lib}"/>
1321
1322 <jar destfile="${build.home}/gutil.jar">
1323 <fileset dir="${build.home}">
1324 <include name="org/greenstone/util/**"/>
1325 </fileset>
1326 <manifest>
1327 <attribute name="Built-By" value="${user.name}" />
1328 </manifest>
1329 </jar>
1330 <copy file="${build.home}/gutil.jar" todir="${web.lib}"/>
1331
1332 <!-- copy the localsite server in case we need it -->
1333 <copy file="${build.home}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" tofile="${web.classes}/org/greenstone/gsdl3/${base.webservice.name}localsite.class" />
1334
1335 <!-- Greenstone Administrator Interface -->
1336 <jar destfile="${build.home}/GAI.jar">
1337 <fileset dir="${build.home}">
1338 <include name="org/greenstone/admin/**"/>
1339 </fileset>
1340 <manifest>
1341 <attribute name="Built-By" value="${user.name}" />
1342 </manifest>
1343 </jar>
1344 <copy file="${build.home}/GAI.jar" todir="${web.lib}"/>
1345 <copy file="${build.home}/GAI.jar" todir="${admin.dir}"/>
1346 <jar destfile="${build.home}/phind.jar">
1347 <fileset dir="${build.home}">
1348 <include name="org/greenstone/applet/phind/**"/>
1349 </fileset>
1350 <manifest>
1351 <attribute name="Built-By" value="${user.name}" />
1352 </manifest>
1353 </jar>
1354 <mkdir dir="${web.applet}"/>
1355 <copy file="${build.home}/phind.jar" todir="${web.applet}"/>
1356 <!-- phind also needs xercesImpl.jar and xml-apis.jar to be in web/applet -->
1357 <if>
1358 <bool><istrue value="${tomcat.islocal}"/></bool>
1359 <copy file="${web.lib}/xercesImpl.jar" todir="${web.applet}"/>
1360 <copy file="${web.lib}/xml-apis.jar" todir="${web.applet}"/>
1361 </if>
1362
1363
1364 <!-- skip anttasks for now
1365 <jar destfile="${build.home}/anttasks.jar">
1366 <fileset dir="${build.home}">
1367 <include name="org/greenstone/anttasks/**"/>
1368 </fileset>
1369 <manifest>
1370 <attribute name="Built-By" value="${user.name}" />
1371 </manifest>
1372 </jar>
1373 <copy file="${build.home}/anttasks.jar" todir="${basedir}/lib/java"/>-->
1374 <jar destfile="${build.home}/gsdl3test.jar">
1375 <fileset dir="${build.home}">
1376 <include name="org/greenstone/gsdl3/**/*Test.class"/>
1377 <include name="org/greenstone/testing/**"/>
1378 </fileset>
1379 <manifest>
1380 <attribute name="Built-By" value="${user.name}" />
1381 </manifest>
1382 </jar>
1383 <jar destfile="${build.home}/server.jar">
1384 <fileset dir="${build.home}">
1385 <include name="org/greenstone/server/**"/>
1386 <include name="org/greenstone/util/**"/>
1387 </fileset>
1388 <fileset file="${basedir}/resources/java/server.properties"/>
1389 <manifest>
1390 <attribute name="Built-By" value="${user.name}"/>
1391 </manifest>
1392 </jar>
1393 <copy file="${build.home}/server.jar" todir="${basedir}"/>
1394 </target>
1395
1396 <!-- ================== Packages targets ================================ -->
1397 <!-- these targets refer to the greenstone source packages - these need
1398 updating less often, so are in separate targets to the core -->
1399 <target name="prepare-packages" depends="init"/>
1400
1401 <target name="update-packages" depends="init,svnupdate-packages,configure-packages,clean-packages,compile-packages"
1402 description="Update only the source packages"/>
1403
1404 <target name="svnupdate-packages" unless="nosvn.mode">
1405 <exec executable="svn">
1406 <arg value="update"/>
1407 <arg value="${src.packages.home}"/>
1408 <arg value="-r"/><arg value="${branch.revision}"/>
1409 </exec>
1410 </target>
1411
1412
1413 <target name="configure-packages" depends="init,configure-javagdbm"
1414 description="Configure only the packages."/>
1415
1416 <target name="configure-javagdbm" if="with.jni">
1417 <echo>
1418 Configuring JavaGDBM
1419 </echo>
1420
1421 <exec executable="${javagdbm.home}/configure" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
1422 <arg value="--prefix=${basedir}"/>
1423 <arg value="--libdir=${lib.jni}"/>
1424 <arg value="--with-gdbm=${gdbm.home}"/>
1425 </exec>
1426 </target>
1427
1428 <target name="clean-packages" depends="init,clean-javagdbm" description="Clean only the packages"/>
1429
1430 <target name="clean-javagdbm" depends="init">
1431 <exec executable="make" os="${os.unix}"
1432 dir="${javagdbm.home}" failonerror="true">
1433 <arg value="clean"/>
1434 </exec>
1435 </target>
1436
1437 <target name="distclean-packages" depends="init,distclean-javagdbm" description="Distclean only the packages"/>
1438
1439 <target name="distclean-javagdbm" depends="init">
1440 <exec executable="make" os="${os.unix}"
1441 dir="${javagdbm.home}" failonerror="true">
1442 <arg value="distclean"/>
1443 </exec>
1444 </target>
1445
1446 <target name="compile-packages" description="Compile only the source packages">
1447 <!-- javagdbm -->
1448 <antcall target="compile-javagdbm"/>
1449 <!-- Search4j -->
1450 <antcall target="compile-search4j"/>
1451 </target>
1452
1453 <target name="compile-javagdbm" description="Compile JavaGDBM" if="with.jni">
1454
1455 <!-- unix: -->
1456 <echo>compile javagdbm</echo>
1457 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true"/>
1458 <exec executable="make" os="${os.unix}" dir="${javagdbm.home}" failonerror="true">
1459 <arg value="install"/>
1460 </exec>
1461
1462 <!-- windows: just the java stuff. Calling without the "compile" argument first will run winMake.bat with "all" which will then perform both the compile AND link targets in jni/win32.mak (thereby also generating gdbmjava.dll). Then we run the same command with the "install" argument to copy the gdbmjava.dll into the correct location. -->
1463 <echo>Windows: compile javagdbm</echo>
1464 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}" failonerror="true" />
1465 <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}" failonerror="true">
1466<!-- <env key="GSDLHOME" path="${gs2build.home}"/> -->
1467 <arg value="install"/>
1468 </exec>
1469
1470 <!-- install the jar file -->
1471 <echo>Install the javagdbm jar file ${javagdbm.home}/javagdbm.jar ${lib.jni}</echo>
1472 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
1473 </target>
1474
1475 <target name="compile-search4j">
1476
1477 <!-- windows -->
1478 <if><bool><istrue value="${current.os.iswindows}"/></bool>
1479 <exec executable="nmake" dir="${src.packages.home}/search4j" failonerror="true">
1480 <arg value="/f"/>
1481 <arg value="win32.mak"/>
1482 <arg value='BINDIR="${basedir}\bin"'/>
1483 </exec>
1484 <exec executable="nmake" dir="${src.packages.home}/search4j" failonerror="true">
1485 <arg value="/f"/>
1486 <arg value="win32.mak"/>
1487 <arg value="install"/>
1488 <arg value='BINDIR="${basedir}\bin"'/>
1489 </exec>
1490
1491 <!-- unix -->
1492 <else><if><bool><istrue value="${current.os.isunix}"/></bool>
1493 <exec executable="${src.packages.home}/search4j/configure" dir="${src.packages.home}/search4j" failonerror="true">
1494 <arg value="--bindir=${basedir}/bin"/>
1495 <arg value="${static.arg}"/>
1496 </exec>
1497 <exec executable="make" dir="${src.packages.home}/search4j" failonerror="true"/>
1498 <exec executable="make" dir="${src.packages.home}/search4j" failonerror="true">
1499 <arg value="install"/>
1500 </exec>
1501
1502 <!-- else warn -->
1503 <else>
1504 <fail>this target does not support the current os</fail>
1505
1506 </else></if></else></if>
1507
1508 </target>
1509
1510 <target name="install-auxiliary-jar-files" depends="init">
1511
1512 <if>
1513 <bool><available file="${mg.home}/mg.jar"/></bool>
1514 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
1515 </if>
1516
1517 <if>
1518 <bool><available file="${mgpp.home}/mgpp.jar"/></bool>
1519 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
1520 </if>
1521
1522 <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/>
1523 </target>
1524
1525 <target name="install-jni-files" depends="init" if="with.jni">
1526 <antcall target="install-jni-files-linux"/>
1527 <antcall target="install-jni-files-windows"/>
1528 <antcall target="install-jni-files-macos"/>
1529 </target>
1530
1531 <target name="install-jni-files-linux" depends="init" if="current.os.isunixnotmac">
1532 <copy file="${mg.home}/jni/libmgretrievejni.so" todir="${lib.jni}"/>
1533 <copy file="${mg.home}/jni/libmgsearchjni.so" todir="${lib.jni}"/>
1534 <copy file="${mg.home}/jni/libmgpassjni.so" todir="${lib.jni}"/>
1535 <copy file="${mgpp.home}/jni/libmgppretrievejni.so" todir="${lib.jni}"/>
1536 <copy file="${mgpp.home}/jni/libmgppsearchjni.so" todir="${lib.jni}"/>
1537 <copy file="${mgpp.home}/jni/libmgpppassjni.so" todir="${lib.jni}"/>
1538 </target>
1539 <target name="install-jni-files-windows" depends="init" if="current.os.iswindows">
1540 <copy file="${mg.home}/jni/mgretrievejni.dll" todir="${lib.jni}"/>
1541 <copy file="${mg.home}/jni/mgsearchjni.dll" todir="${lib.jni}"/>
1542 <copy file="${mg.home}/jni/mgpassjni.dll" todir="${lib.jni}"/>
1543 <copy file="${mgpp.home}/jni/mgppretrievejni.dll" todir="${lib.jni}"/>
1544 <copy file="${mgpp.home}/jni/mgppsearchjni.dll" todir="${lib.jni}"/>
1545 <copy file="${mgpp.home}/jni/mgpppassjni.dll" todir="${lib.jni}"/>
1546 </target>
1547 <target name="install-jni-files-macos" depends="init" if="current.os.ismac">
1548 <copy file="${mg.home}/jni/libmgretrievejni.jnilib" todir="${lib.jni}"/>
1549 <copy file="${mg.home}/jni/libmgsearchjni.jnilib" todir="${lib.jni}"/>
1550 <copy file="${mg.home}/jni/libmgpassjni.jnilib" todir="${lib.jni}"/>
1551 <copy file="${mgpp.home}/jni/libmgppretrievejni.jnilib" todir="${lib.jni}"/>
1552 <copy file="${mgpp.home}/jni/libmgppsearchjni.jnilib" todir="${lib.jni}"/>
1553 <copy file="${mgpp.home}/jni/libmgpppassjni.jnilib" todir="${lib.jni}"/>
1554 </target>
1555
1556 <!-- ========common-src targets =================================-->
1557 <!-- these are used to get common-src (for indexers, gdbm, sqlite etc) when
1558 collection building is not enabled -->
1559
1560 <target name="update-common-src" depends="init" if="collection.building.disabled">
1561 </target>
1562
1563 <target name="svnupdate-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
1564 <exec executable="svn">
1565 <arg value="update"/>
1566 <arg value="${common.src.home}"/>
1567 <arg value="-r"/><arg value="${branch.revision}"/>
1568 </exec>
1569 </target>
1570
1571 <target name="prepare-common-src" depends="init" if="collection.building.disabled" unless="common.src.present">
1572 <antcall target="checkout-common-src"/>
1573 <antcall target="unzip-windows-packages"/>
1574 </target>
1575
1576 <target name="checkout-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
1577 <echo>checking out common-src</echo>
1578 <exec executable="svn">
1579 <arg value="checkout"/>
1580 <arg value="${svn.root}/main/${branch.path}/greenstone2/common-src"/>
1581 <arg value="common-src"/>
1582 <arg value="-r"/><arg value="${branch.revision}"/>
1583 </exec>
1584 </target>
1585
1586 <target name="configure-common-src" depends="init">
1587 <exec executable="${common.src.home}/configure" os="${os.unix}"
1588 dir="${common.src.home}" failonerror="true">
1589 <arg value="--prefix=${gs2build.home}"/> <!-- what value to use?? -->
1590 <arg value="--bindir=${gs2build.home}/bin/${os.bin.dir}"/> <!-- what value to use?? -->
1591 <arg line="${gs2.opt.args}"/>
1592 <arg line="${static.arg}"/>
1593 <arg line="${allargs}"/>
1594 </exec>
1595 </target>
1596
1597 <target name="clean-common-src" depends="init">
1598 <!-- unix: -->
1599 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1600 <arg value="clean"/>
1601 </exec>
1602 <!-- windows: -->
1603 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1604 <arg value="/f"/>
1605 <arg value="win32.mak"/>
1606 <arg value="clean"/>
1607 <arg value="GSDLHOME=${gs2build.home}"/>
1608 </exec>
1609 </target>
1610 <target name="distclean-common-src" depends="init">
1611 <!-- unix: -->
1612 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1613 <arg value="distclean"/>
1614 </exec>
1615 <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
1616 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1617 <arg value="/f"/>
1618 <arg value="win32.mak"/>
1619 <arg value="clean"/>
1620 <arg value="GSDLHOME=${gs2build.home}"/>
1621 </exec>
1622 </target>
1623 <target name="compile-common-src" depends="init">
1624 <!-- unix: -->
1625 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1626 <arg value="${gs2.compile.target}"/>
1627 </exec>
1628 <!-- windows: -->
1629 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1630 <arg value="/f"/>
1631 <arg value="win32.mak"/>
1632 <arg value="GSDLHOME=${gs2build.home}"/>
1633 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
1634 <arg value="ENABLE_MG=${gs2.windows.enablemg}"/>
1635 <arg value="ENABLE_MGPP=${gs2.windows.enablemgpp}"/>
1636 <arg value="USE_GDBM=${gs2.windows.usegdbm}"/>
1637 <arg value="USE_SQLITE=${gs2.windows.usesqlite}"/>
1638 </exec>
1639 </target>
1640
1641 <!-- ======= collection-building targets ===========================-->
1642
1643 <target name="update-collection-building" if="collection.building.enabled"
1644 depends="init,svnupdate-collection-building,gs2build-edit-setup-bat,configure-common-src,clean-common-src,compile-common-src,configure-collection-building,clean-collection-building,compile-collection-building"
1645 description="Update (SVN update, configure, compile etc) only the collection building components"/>
1646
1647 <target name="svnupdate-collection-building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nosvn.mode"
1648 description="SVN update the collection building components">
1649 </target>
1650
1651 <target name="prepare-collection-building" depends="init,prepare-gs2build,prepare-gli" if="collection.building.enabled">
1652 </target>
1653
1654 <target name="configure-collection-building" depends="init,configure-build-src" if="collection.building.enabled"
1655 description="Configure the collection building components">
1656 </target>
1657
1658 <target name="clean-collection-building" depends="init,clean-gli,clean-build-src"
1659 description="Clean only the collection building components"
1660 if="collection.building.enabled"/>
1661
1662 <target name="distclean-collection-building" depends="init,clean-build-src,distclean-build-src"
1663 description="Distclean only the collection building components"
1664 if="collection.building.enabled"/>
1665
1666 <target name="compile-collection-building" depends="init,compile-build-src,compile-gli" if="collection.building.enabled"
1667 description="Compile only the collection building components">
1668 <!-- make install for common-src -->
1669 <!-- unix: -->
1670 <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
1671 <arg value="${gs2.install.target}"/>
1672 </exec>
1673
1674 <!-- windows: -->
1675 <exec executable="nmake" dir="${common.src.home}" os="${os.windows}" failonerror="true">
1676 <arg value="/f"/>
1677 <arg value="win32.mak"/>
1678 <arg value="install"/>
1679 <arg value="GSDLHOME=${gs2build.home}"/>
1680 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
1681 <arg value="ENABLE_MG=${gs2.windows.enablemg}"/>
1682 <arg value="ENABLE_MGPP=${gs2.windows.enablemgpp}"/>
1683 <arg value="USE_GDBM=${gs2.windows.usegdbm}"/>
1684 <arg value="USE_SQLITE=${gs2.windows.usesqlite}"/>
1685 <!--
1686 <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
1687 <arg value="USE_SQLITE=0"/>--> <!-- why is this not on by default? -->
1688 </exec>
1689
1690 <!-- install gs2build indexers for windows -->
1691 <if>
1692 <bool><istrue value="${current.os.iswindows}"/></bool>
1693 <copy todir="${gs2build.home}/bin/windows">
1694 <fileset dir="${gs2build.home}/common-src/indexers/bin">
1695 <include name="*.*"/>
1696 </fileset>
1697 </copy>
1698 </if>
1699
1700 <!-- LuceneWrapper jar file not installed by default -->
1701 <mkdir dir="${gs2build.home}/bin/java"/>
1702 <copy file="${lucene.home}/LuceneWrapper.jar" todir="${gs2build.home}/bin/java"/>
1703
1704 </target>
1705
1706 <!-- ============== gli targets ================================= -->
1707 <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nosvn.mode">
1708
1709 <exec executable="svn">
1710 <arg value="update"/>
1711 <arg value="${gli.home}"/>
1712 <arg value="-r"/><arg value="${branch.revision}"/>
1713 </exec>
1714
1715 <exec executable="svn" dir="web/WEB-INF/cgi">
1716 <arg value="export"/>
1717 <arg value="-r"/><arg value="${branch.revision}"/>
1718 <arg value="${svn.root}/main/${branch.path}/greenstone2/cgi-bin/gliserver.pl"/>
1719 </exec>
1720 <exec executable="svn" dir="web/WEB-INF/cgi">
1721 <arg value="export"/>
1722 <arg value="-r"/><arg value="${branch.revision}"/>
1723 <arg value="${svn.root}/main/${branch.path}/greenstone2/cgi-bin/gsdlCGI.pm"/>
1724 </exec>
1725
1726 </target>
1727
1728 <target name="prepare-gli" depends="init" if="collection.building.enabled" unless="gli.present">
1729 <!-- checkout -->
1730 <if><bool><and><not><istrue value="${nosvn.mode}"/></not><isset property="with.gli.and.gems"/></and></bool>
1731
1732 <exec executable="svn">
1733 <arg value="checkout"/>
1734 <arg value="${svn.root}/main/${branch.path}/gli"/>
1735 <arg value="-r"/><arg value="${branch.revision}"/>
1736 </exec>
1737
1738 <exec executable="svn" dir="web/WEB-INF/cgi">
1739 <arg value="export"/>
1740 <arg value="-r"/><arg value="${branch.revision}"/>
1741 <arg value="${svn.root}/main/${branch.path}/greenstone2/cgi-bin/gliserver.pl"/>
1742 </exec>
1743 <exec executable="svn" dir="web/WEB-INF/cgi">
1744 <arg value="export"/>
1745 <arg value="-r"/><arg value="${branch.revision}"/>
1746 <arg value="${svn.root}/main/${branch.path}/greenstone2/cgi-bin/gsdlCGI.pm"/>
1747 </exec>
1748
1749 </if>
1750 </target>
1751
1752 <target name="clean-gli" depends="init" if="collection.building.enabled">
1753 <!-- gli -->
1754 <property name="gli.home" value="${basedir}/gli"/>
1755 <!-- linux -->
1756 <exec executable="clean.sh" os="${os.unix}" dir="${gli.home}"
1757 resolveExecutable="true" failonerror="true"/>
1758 <!-- windows -->
1759 <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
1760 resolveExecutable="true" failonerror="true"/>
1761 </target>
1762
1763 <target name="compile-gli" depends="init" if="collection.building.enabled">
1764 <if><bool><isset property="with.gli.and.gems"/></bool>
1765 <!-- gli -->
1766 <property name="gli.home" value="${basedir}/gli"/>
1767
1768 <!-- linux -->
1769 <exec executable="makegli.sh" os="${os.unix}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
1770 <!--remote gli-->
1771 <exec executable="makejar.sh" os="${os.unix}" dir="${gli.home}"
1772 resolveExecutable="true" failonerror="true"/>
1773 <!-- windows -->
1774 <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}" resolveExecutable="true" failonerror="true"/>
1775 <!--remote gli-->
1776 <exec executable="makejar.bat" os="${os.windows}" dir="${gli.home}"
1777 resolveExecutable="true" failonerror="true"/>
1778 <copy file="${gli.home}/GLIServer.jar" todir="${gs2build.home}/bin/java" />
1779 </if>
1780 </target>
1781
1782 <target name="gli" description="Run the Greenstone Librarian Interface" depends="init" if="collection.building.enabled">
1783 <exec executable="${basedir}/gli/gli.sh" os="${os.linux},${os.solaris}" dir="${basedir}/gli" spawn="true">
1784 <env key="gsdl3path" path="${basedir}"/>
1785 <env key="gsdlpath" path="${gs2build.home}"/>
1786 </exec>
1787 <exec executable="${basedir}/gli/gli.sh" os="${os.mac}" dir="${basedir}/gli" spawn="true">
1788 <env key="gsdl3path" path="${basedir}"/>
1789 <env key="gsdlpath" path="${gs2build.home}"/>
1790 <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${gdbm.home}/lib"/>
1791 </exec>
1792 <exec executable="${basedir}/gli/gli.bat" os="${os.windows}" dir="${basedir}/gli" spawn="true">
1793 <env key="GSDL3PATH" path="${basedir}"/>
1794 <env key="GSDLPATH" path="${gs2build.home}"/>
1795 </exec>
1796 <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 gli.sh/bat from the greenstone3/gli directory.
1797 </echo>
1798 </target>
1799
1800 <!-- ================ gs2build targets =========================== -->
1801
1802 <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nosvn.mode">
1803 <echo>svn updating gs2build</echo>
1804 <exec executable="svn">
1805 <arg value="update"/>
1806 <arg value="${gs2build.home}"/>
1807 <arg value="-r"/><arg value="${branch.revision}"/>
1808 </exec>
1809 </target>
1810
1811 <target name="prepare-gs2build" depends="init" if="collection.building.enabled" unless="gs2build.present">
1812 <antcall target="checkout-gs2build"/>
1813 <antcall target="unzip-windows-packages"/>
1814 <antcall target="checkout-winbin"/>
1815 <antcall target="get-windows-binaries"/>
1816 <antcall target="delete-winbin"/>
1817 </target>
1818
1819 <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nosvn.mode">
1820 <echo>checking out gs2build</echo>
1821 <exec executable="svn">
1822 <arg value="checkout"/>
1823 <arg value="${svn.root}/main/${branch.path}/gs2build"/>
1824 <arg value="-r"/><arg value="${branch.revision}"/>
1825 </exec>
1826
1827
1828 </target>
1829
1830 <target name="checkout-winbin" depends="init" if="current.os.iswindows"
1831 unless="nosvn.mode">
1832
1833 <exec executable="svn">
1834 <arg value="checkout"/>
1835 <arg value="${svn.root}/main/${branch.path}/binaries/windows"/>
1836 <arg value="-r"/><arg value="${branch.revision}"/>
1837 <arg value="winbin"/>
1838 </exec>
1839
1840 </target>
1841
1842 <target name="update-winbin" depends="init" if="current.os.iswindows" unless="nosvn.mode">
1843 <exec executable="svn">
1844 <arg value="update"/>
1845 <arg value="winbin"/>
1846 <arg value="-r"/><arg value="${branch.revision}"/>
1847 </exec>
1848
1849 </target>
1850
1851 <target name="get-windows-binaries" depends="init" if="collection.building.enabled.windows">
1852 <move todir="${gs2build.home}/bin/windows" failonerror="false">
1853 <fileset dir="${basedir}/winbin/bin"/>
1854 </move>
1855 </target>
1856
1857 <target name="delete-winbin" depends="init" if="collection.building.enabled.windows">
1858 <delete dir="${basedir}/winbin"/>
1859 </target>
1860
1861 <target name="unzip-windows-packages" depends="init" if="current.os.iswindows">
1862 <unzip src="${common.src.home}/packages/windows/crypt/crypt.zip"
1863 dest="${common.src.home}/packages/windows/crypt"/>
1864 <untar compression="gzip"
1865 src="${common.src.home}/packages/sqlite/${sqlite.targz.version}"
1866 dest="${common.src.home}/packages/sqlite"/>
1867 <unzip src="${common.src.home}/indexers/packages/windows/iconv/iconv.zip"
1868 dest="${common.src.home}/indexers/packages/windows/iconv"/>
1869 </target>
1870
1871 <target name="gs2build-edit-setup-bat" if="collection.building.enabled.windows">
1872 <!-- we want a windows path in the setup.bat file -->
1873 <pathconvert targetos="windows" property="gs2build.home.windows">
1874 <path path="${gs2build.home}"/>
1875 </pathconvert>
1876 <move file="${gs2build.home}/setup.bat" tofile="${gs2build.home}/setup-tmp.bat">
1877 <filterset>
1878 <filter token="gsdlhome" value="${gs2build.home.windows}"/>
1879 </filterset>
1880 </move>
1881 <move file="${gs2build.home}/setup-tmp.bat" tofile="${gs2build.home}/setup.bat" />
1882 </target>
1883
1884
1885 <target name="clean-build-src" depends="init" if="collection.building.enabled">
1886 <!-- unix: -->
1887 <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
1888 <arg value="clean"/>
1889 </exec>
1890 <!-- windows: -->
1891 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
1892 <arg value="/f"/>
1893 <arg value="win32.mak"/>
1894 <arg value="clean"/>
1895 <arg value="GSDLHOME=${gs2build.home}"/>
1896 </exec>
1897 </target>
1898
1899
1900 <target name="distclean-build-src" depends="init,clean-build-src" if="collection.building.enabled">
1901 <!-- unix: -->
1902 <exec executable="make" os="${os.unix}" dir="${build.src.home}" failonerror="true">
1903 <arg value="distclean"/>
1904 </exec>
1905 <!-- windows: distclean = clean + remove configure products (remove makefiles). But on Windows there is no removing makefiles, so we just call clean -->
1906 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
1907 <arg value="/f"/>
1908 <arg value="win32.mak"/>
1909 <arg value="clean"/>
1910 <arg value="GSDLHOME=${gs2build.home}"/>
1911 </exec>
1912 </target>
1913
1914 <target name="configure-build-src" depends="init" if="collection.building.enabled"
1915 description="Configure the build-src component">
1916 <exec executable="${build.src.home}/configure" os="${os.unix}"
1917 dir="${build.src.home}" failonerror="true">
1918 <arg value="--prefix=${gs2build.home}"/>
1919 <arg line="${gs2.opt.args} ${static.arg} ${allargs}"/>
1920 </exec>
1921 </target>
1922
1923 <!-- common-src is done separately and needs to be compiled first -->
1924 <target name="compile-build-src" depends="init" if="collection.building.enabled">
1925
1926 <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
1927 <arg line="${ldlpath.arg}"/>
1928 </exec>
1929
1930 <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
1931 <arg value="install"/>
1932 </exec>
1933
1934 <!-- run the setup script -->
1935 <!-- <exec executable="${compile.windows.c++.setup}" os="${os.windows}" failonerror="true"/>-->
1936 <!--Above does not work: even though vcvars.bat executes, the env changes it makes don't get saved. Need user to run vcvars.bat first before calling ant-->
1937 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
1938 <arg value="/f"/>
1939 <arg value="win32.mak"/>
1940 <arg value="GSDLHOME=${gs2build.home}"/>
1941 </exec>
1942 <exec executable="nmake" dir="${build.src.home}" os="${os.windows}" failonerror="true">
1943 <arg value="/f"/>
1944 <arg value="win32.mak"/>
1945 <arg value="install"/>
1946 <arg value="GSDLHOME=${gs2build.home}"/>
1947 </exec>
1948 </target>
1949
1950
1951 <!-- ======================== TESTING Targets ========================= -->
1952
1953 <target name="test" description="Run the (incomplete) JUnit test suite "
1954 depends="init">
1955 <mkdir dir="${basedir}/test"/>
1956 <junit printsummary="withOutAndErr"
1957 errorproperty="test.failed"
1958 failureproperty="test.failed"
1959 fork="${junit.fork}">
1960 <formatter type="plain"/>
1961 <classpath>
1962 <pathelement location="${build.home}/gsdl3test.jar"/>
1963 <path refid="compile.classpath"/>
1964 </classpath>
1965 <test name="${testcase}" if="testcase"/>
1966 <batchtest todir="${basedir}/test" unless="testcase">
1967 <fileset dir="${build.home}" includes="**/*Test.class" />
1968 </batchtest>
1969 </junit>
1970 <echo>
1971 *********************************************
1972 Test output can be found in directory 'test'
1973 *********************************************
1974 </echo>
1975 </target>
1976
1977 <!-- ======================== FLAX Targets ========================= -->
1978 <target name="prepare-flax" description="check out flax source code from another repository" if="install.flax">
1979 <echo>checking out flax ...</echo>
1980 <mkdir dir="${basedir}/src/java/org/flax"/>
1981 <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
1982 <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/action/flax"/>
1983 <mkdir dir="${web.home}/WEB-INF/classes/flax"/>
1984 <mkdir dir="${web.home}/interfaces/flax"/>
1985 <mkdir dir="${web.home}/sites/flax"/>
1986 <mkdir dir="${basedir}/flax-resources"/>
1987 <mkdir dir="${basedir}/flax-lib"/>
1988 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/flax"/>
1989 <arg value="src/java/org/flax"/></exec>
1990 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/greenstone/gsdl3/flax"/>
1991 <arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
1992 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/greenstone/gsdl3/action/flax"/>
1993 <arg value="src/java/org/greenstone/gsdl3/action/flax"/></exec>
1994 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/WEB-INF/classes/flax"/>
1995 <arg value="${web.home}/WEB-INF/classes/flax"/></exec>
1996 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/interfaces/flax"/>
1997 <arg value="${web.home}/interfaces/flax"/></exec>
1998 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/sites/flax"/>
1999 <arg value="${web.home}/sites/flax"/></exec>
2000 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/flax-resources"/>
2001 <arg value="flax-resources"/></exec>
2002 <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/lib"/>
2003 <arg value="flax-lib"/></exec>
2004 <antcall target="flax-copy-files" />
2005 </target>
2006
2007 <target name="flax-copy-files" description="copy some flax files into the appropriate greenstone3 directories">
2008 <echo>copying flax files ...</echo>
2009 <copy file="${web.home}/WEB-INF/classes/flax/web.xml" todir="${web.home}/WEB-INF" overwrite="true" />
2010 <!-- A configuration file containing web service binding information for the axis engine -->
2011 <copy file="${web.home}/WEB-INF/classes/flax/server-config.wsdd" todir="${web.home}/WEB-INF" overwrite="true" />
2012 <!-- A static web service wsdl file which is queried by soap client. The reason this file is used (instead of the dynamically generated version) is in case any redirects are used in the Apache configuration (e.g., flax.nzdl.org:80 redirects to harakeke:8080) -->
2013 <copy file="${basedir}/flax-resources/FlaxWebService.wsdl" tofile="${web.home}/FlaxWebService.wsdl" overwrite="true"/>
2014 <copy todir="${web.home}/WEB-INF/lib">
2015 <fileset dir="${basedir}/flax-lib">
2016 <include name="*.jar"/>
2017 </fileset>
2018 </copy>
2019 </target>
2020 <target name="configure-flax-wsdl" description="Configure flax webservice with tomcat server/port">
2021 <rsr file="${web.home}/FlaxWebService.wsdl" pattern="@flaxpublicserver@:@flaxpublicport@" replacement="${tomcat.server}:${tomcat.port}"/>
2022 </target>
2023
2024 <target name="update-flax" description="update flax from repository">
2025 <echo>updating flax ...</echo>
2026 <exec executable="svn"><arg value="update"/>
2027 <arg value="src/java/org/flax"/></exec>
2028 <exec executable="svn"><arg value="update"/>
2029 <arg value="src/java/org/greenstone/gsdl3/action/flax"/></exec>
2030 <exec executable="svn"><arg value="update"/>
2031 <arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
2032 <exec executable="svn"><arg value="update"/>
2033 <arg value="${web.home}/WEB-INF/classes/flax"/></exec>
2034 <exec executable="svn"><arg value="update"/>
2035 <arg value="${web.home}/interfaces/flax"/></exec>
2036 <exec executable="svn"><arg value="update"/>
2037 <arg value="flax-resources"/></exec>
2038 <exec executable="svn"><arg value="update"/>
2039 <arg value="flax-lib"/></exec>
2040 <antcall target="flax-copy-files" />
2041 </target>
2042
2043
2044 <target name="compile-javadocs">
2045 <javadoc packagenames="org.greenstone.*"
2046 sourcepath="src/java"
2047 defaultexcludes="yes"
2048 destdir="docs/javadoc"
2049 author="true"
2050 version="true"
2051 use="true"
2052 windowtitle="Greenstone3 API">
2053 <doctitle><![CDATA[<h1>Greenstone3 API</h1>]]></doctitle>
2054 </javadoc>
2055 </target>
2056
2057<!-- ========== Some distribution targets ======================== -->
2058 <target name="remove-source">
2059 <if><bool><isset property="with.gli.and.gems"/></bool>
2060 <delete includeEmptyDirs="true">
2061 <fileset dir="." defaultexcludes="false">
2062 <patternset refid="greenstone3.source.component"/>
2063 </fileset>
2064 </delete>
2065
2066 <else>
2067 <delete includeEmptyDirs="true">
2068 <fileset dir="." defaultexcludes="false">
2069 <patternset refid="greenstone3.source.no.gli.component"/>
2070 </fileset>
2071 </delete>
2072 </else>
2073 </if>
2074 </target>
2075
2076 <target name="dist-tidy"
2077 description="'tidies-up' a greenstone3 installation for distribution.">
2078
2079 <!-- delete unneeded things -->
2080 <delete dir="${packages.home}/axis"/>
2081 <delete><fileset dir="${packages.home}" includes="*.zip"/></delete>
2082 <delete file="README-SVN.txt"/>
2083 <delete file="build.properties.in"/>
2084
2085 <!-- delete source files -->
2086 <antcall target="remove-source"/>
2087
2088 <!-- create empty directories -->
2089 <mkdir dir="${web.home}/applet"/>
2090 <mkdir dir="${web.home}/logs"/>
2091
2092 <!-- os specific tidy-ups -->
2093 <!-- linux, mac -->
2094 <if><bool><istrue value="${current.os.isunix}"/></bool>
2095 <delete><fileset dir="." includes="*.bat"/></delete>
2096 <if><bool><isset property="with.gli.and.gems"/></bool>
2097 <delete><fileset dir="gli" includes="*.bat"/></delete>
2098 </if>
2099 <delete><fileset dir="gs2build" includes="*.bat"/></delete>
2100 <delete><fileset dir="bin/script" includes="*.bat"/></delete>
2101 <delete file="${basedir}/gs2build/win32cfg.h"/>
2102 <delete file="${basedir}/gs2build/win32.mak"/>
2103 <delete dir="${basedir}/winutil"/>
2104 <delete failonerror="false"><fileset dir="${lib.jni}" includes="*.dll"/></delete>
2105
2106 <!-- windows -->
2107 <else><if><bool><istrue value="${current.os.iswindows}"/></bool>
2108 <delete><fileset dir="." includes="*.sh,*.bash,*.csh"/></delete>
2109 <if><bool><isset property="with.gli.and.gems"/></bool>
2110 <delete><fileset dir="gli" includes="*.sh,*.bash,*.csh"/></delete>
2111 </if>
2112 <delete><fileset dir="gs2build" includes="*.sh,*.bash,*.csh"/></delete>
2113 <delete><fileset dir="bin/script" includes="*.sh,*.bash,*.csh"/></delete>
2114 </if></else></if>
2115
2116 </target>
2117
2118 <!-- fix up executable permissions for binary release -->
2119 <target name="fix-execute-permissions">
2120 <echo>Setting binaries to executable</echo>
2121 <chmod perm="775">
2122 <fileset dir="."><patternset refid="greenstone3.executables"/></fileset>
2123 </chmod>
2124 </target>
2125
2126 <!-- fix up executable permissions for source code release -->
2127 <target name="fix-execute-permissions-source">
2128 <chmod perm="775">
2129 <fileset dir="."><patternset refid="greenstone3.source.executables"/></fileset>
2130 </chmod>
2131 </target>
2132
2133
2134 <!-- ============= tweaks for making compilation static ========== -->
2135 <target name="tweak-makefiles" depends="init" if="compile.static">
2136 <antcall target="rtftohtml-add-static" />
2137 </target>
2138
2139 <target name="rtftohtml-add-static" depends="init" if="collection.building.enabled">
2140 <rsr file="${gs2build.home}/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="-o rtftohtml(.{2})EXEEXT(.{1})" replacement="-o rtftohtml$1EXEEXT$2 -static" />
2141 </target>
2142
2143</project>
2144
Note: See TracBrowser for help on using the repository browser.