source: main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml@ 22461

Last change on this file since 22461 was 22461, checked in by sjm84, 14 years ago

Modified the script that adds the different versions of XML-Parser so that it only adds the versions that the release-kit system does not already have

File size: 18.5 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="rk2-compile">
3
4 <target name="compile" depends="init,gs2-init">
5 <!-- checkout greenstone2 (or gsdl if a pre-2.84 release is being created) and gli -->
6 <if>
7 <bool>
8 <or>
9 <equals arg1="${branch.path}" arg2="trunk"/>
10 <isgreaterthan arg1="${branch.tag.version}" arg2="2.83"/>
11 </or>
12 </bool>
13
14 <exec executable="svn">
15 <arg value="checkout"/>
16 <arg value="${svn.root}/main/${branch.path}/greenstone2"/>
17 <arg value="${basedir}/compiled"/>
18 </exec>
19
20 <else>
21 <exec executable="svn">
22 <arg value="checkout"/>
23 <arg value="${svn.root}/main/${branch.path}/gsdl"/>
24 <arg value="${basedir}/compiled"/>
25 </exec>
26 </else>
27 </if>
28
29 <exec executable="svn">
30 <arg value="checkout"/>
31 <arg value="${svn.root}/main/${branch.path}/gli"/>
32 <arg value="${basedir}/compiled/gli"/>
33 </exec>
34
35 <!-- drop in documentation -->
36 <copy todir="compiled" overwrite="true">
37 <fileset dir="${rk.home}/shared/greenstone2/docs" excludes="READMEar.txt,READMEes.txt,READMEfr.txt,READMEru.txt"/>
38 </copy>
39
40 <!-- set version numbers -->
41 <antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="${basedir}/compiled"/></antcall>
42 <antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/compiled/gli"/></antcall>
43
44 <!-- we do not want the *.app folders if we are not mac-->
45 <if><bool><not><equals arg1="${rk.os}" arg2="mac"/></not></bool>
46 <delete dir="${basedir}/compiled/client-gli.app"/>
47 <delete dir="${basedir}/compiled/gems.app"/>
48 <delete dir="${basedir}/compiled/gs2-server.app"/>
49 <delete dir="${basedir}/compiled/gli.app"/>
50 </if>
51
52 <!-- windows only -->
53 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
54
55 <!-- unzip packages -->
56 <unzip src="${basedir}/compiled/common-src/packages/windows/crypt/crypt.zip" dest="${basedir}/compiled/common-src/packages/windows/crypt"/>
57 <unzip src="${basedir}/compiled/common-src/packages/windows/expat/expat.zip" dest="${basedir}/compiled/common-src/packages/windows/expat"/>
58 <unzip src="${basedir}/compiled/common-src/packages/windows/stlport/stlport.zip" dest="${basedir}/compiled/common-src/packages/windows/stlport"/>
59 <unzip src="${basedir}/compiled/common-src/indexers/packages/windows/iconv/iconv.zip" dest="${basedir}/compiled/common-src/indexers/packages/windows/iconv"/>
60 <untar src="${basedir}/compiled/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz" dest="${basedir}/compiled/common-src/packages/sqlite" compression="gzip"/>
61
62 <!-- get winbin from tags if the version is greater than 2.83 otherwise get it from trunk -->
63 <if><bool><not><available file="${basedir}/compiled/bin/windows"/></not></bool>
64 <if>
65 <bool>
66 <and>
67 <not><equals arg1="${branch.path}" arg2="trunk"/></not>
68 <isgreaterthan arg1="${branch.tag.version}" arg2="2.83"/>
69 </and>
70 </bool>
71
72 <exec executable="svn">
73 <arg value="export"/>
74 <arg value="${svn.root}/main/${branch.path}/binaries/windows/bin"/>
75 <arg value="${basedir}/compiled/bin/windows"/>
76 <arg value="-r"/>
77 <arg value="${branch.revision}"/>
78 </exec>
79
80 <else>
81 <exec executable="svn">
82 <arg value="export"/>
83 <arg value="${svn.root}/main/trunk/binaries/windows/bin"/>
84 <arg value="${basedir}/compiled/bin/windows"/>
85 <arg value="-r"/>
86 <arg value="${branch.revision}"/>
87 </exec>
88 </else>
89 </if>
90 </if>
91
92 <!-- insert windows perl -->
93 <unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/bin/windows"/>
94
95 <if>
96 <bool>
97 <and>
98 <not><equals arg1="${branch.path}" arg2="trunk"/></not>
99 <islessthan arg1="${branch.tag.version}" arg2="2.84"/>
100 </and>
101 </bool>
102
103 <exec executable="${basedir}/compiled/bin/windows/gunzip.exe" dir="${basedir}/compiled/runtime-src/packages/apache-httpd">
104 <arg value="-d"/>
105 <arg value="httpd-2.2.11-gs.tar.gz"/>
106 </exec>
107
108 <exec executable="${basedir}/compiled/bin/windows/tar.exe" dir="${basedir}/compiled/runtime-src/packages/apache-httpd">
109 <arg value="-xvf"/>
110 <arg value="httpd-2.2.11-gs.tar"/>
111 </exec>
112 </if>
113
114 <rsr>
115 <fileset dir="${basedir}/compiled/runtime-src/packages/apache-httpd/httpd-2.2.11" includes="*.mak,srclib/**/*.mak,support/**/*.mak"/>
116 <job pattern="/MD" replacement="/MT"/>
117 </rsr>
118
119 <!-- compile c code -->
120 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="clean"/></exec>
121 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="APACHE_HTTPD=1"/></exec>
122 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="LOCAL_LIBRARY=1"/></exec>
123 <mkdir dir="products"/>
124 <copy file="${basedir}/compiled/server.exe" tofile="${basedir}/products/server-${version}.exe"/>
125 <move file="${basedir}/compiled/server.exe" todir="${basedir}/compiled/bin/windows"/>
126
127
128 <!-- linux only -->
129 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
130
131 <!-- add static to configure.in -->
132 <rsr file="${basedir}/compiled/configure.in" pattern="^LDFLAGS=.*$" replacement="LDFLAGS=-static"/>
133 <exec dir="${basedir}/compiled" executable="autoconf" output="${basedir}/compiled/configure">
134 <arg value="configure.in"/>
135 </exec>
136
137 <!-- set environment in packages/configure -->
138 <rsr file="${basedir}/compiled/common-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;"/>
139 <rsr file="${basedir}/compiled/build-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;"/>
140
141 <!-- run configure -->
142 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
143 <arg line="--enable-apache-httpd"/>
144 <env key="LDFLAGS" value="-static"/>
145 </exec>
146
147 <!-- add -static to makefiles -->
148 <rsr file="${basedir}/compiled/build-src/packages/wv/wv-gs/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static" />
149 <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/>
150 <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/>
151 <rsr file="${basedir}/compiled/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="(-o rtftohtml.{2}EXEEXT.{1})" replacement="$1 -static"/>
152
153 <!-- mac only -->
154 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
155 <!-- run configure -->
156 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
157 <arg line="--enable-apache-httpd"/>
158 </exec>
159
160 <!-- tweak makefiles -->
161 <rsr file="${basedir}/compiled/runtime-src/src/recpt/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3"/>
162 <rsr file="${basedir}/compiled/runtime-src/src/oaiservr/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3"/>
163
164 </if></else></if></else></if>
165
166 <!-- mac and linux: compile -->
167 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
168
169 <!-- make -->
170 <exec dir="${basedir}/compiled" executable="make" failonerror="true"/>
171
172 <!-- make install -->
173 <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="install"/></exec>
174
175 <!-- make apache-for-dist -->
176 <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="apache-for-dist"/></exec>
177
178 <!-- strip executables -->
179 <exec dir="${basedir}/compiled/bin/${os.shell}" executable="find" failonerror="true">
180 <arg line=". ! -name . -type f -maxdepth 1 -exec strip {} &#59;"/>
181 </exec>
182 </if>
183
184 <!-- insert the necessary additional xml parser versions-->
185 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
186 <!-- Add the 5.6 version if necessary -->
187 <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.6"/></not></bool>
188 <copy todir="${basedir}/compiled/perllib/cpan">
189 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.6,perl-5.6/**/*"/>
190 </copy>
191 </if>
192
193 <!-- Add the 5.8 version if necessary -->
194 <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.8"/></not></bool>
195 <copy todir="${basedir}/compiled/perllib/cpan">
196 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.8,perl-5.8/**/*"/>
197 </copy>
198 </if>
199
200 <!-- Add the 5.10 version if necessary -->
201 <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.10"/></not></bool>
202 <copy todir="${basedir}/compiled/perllib/cpan">
203 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.10,perl-5.10/**/*"/>
204 </copy>
205 </if>
206 </if>
207
208 <!-- compile gli -->
209 <!-- (linux and mac) -->
210 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
211 <exec dir="compiled/gli" executable="/bin/bash"><arg value="-c"/><arg value="./makegli.sh"/></exec>
212 <exec dir="compiled/gli" executable="/bin/bash"><arg value="-c"/><arg value="./makejar.sh"/></exec>
213 <!-- windows -->
214 <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
215 <exec dir="compiled/gli" executable="cmd.exe"><arg value="/c"/><arg value="makegli.bat"/></exec>
216 <exec dir="compiled/gli" executable="cmd.exe"><arg value="/c"/><arg value="makejar.bat"/></exec>
217 </if></else></if>
218
219 <delete dir="compiled/gli/jar"/>
220 <delete dir="compiled/gli/classes/org"/>
221 <move file="compiled/gli/GLIServer.jar" todir="compiled/bin/java"/>
222
223 <!-- compile uninstaller -->
224 <antcall target="insert-and-compile-uninstaller" />
225
226 <!-- build demo collection -->
227 <!-- the envs on these execs simulate the environment when you run setup.bat -->
228 <if>
229 <bool>
230 <equals arg1="${rk.os}" arg2="windows"/>
231 </bool>
232
233 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/bin/windows/perl/bin/perl">
234 <arg line="-S"/>
235 <arg line="bin/script/import.pl demo"/>
236 <env key="GSDLHOME" path="${basedir}/compiled"/>
237 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
238 <env key="GSDLOS" value="windows"/>
239 <env key="PATH" path="${basedir}/compiled/bin/windows/perl/bin:${basedir}/compiled/bin/windows:${basedir}/compiled/bin/script:${env.PATH}"/>
240 </exec>
241 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/bin/windows/perl/bin/perl">
242 <arg line="-S"/>
243 <arg line="bin/script/buildcol.pl demo"/>
244 <env key="GSDLHOME" path="${basedir}/compiled"/>
245 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
246 <env key="GSDLOS" value="windows"/>
247 <env key="PATH" path="${basedir}/compiled/bin/windows/perl/bin:${basedir}/compiled/bin/windows:${basedir}/compiled/bin/script:${env.PATH}"/>
248 </exec>
249
250 <else>
251 <exec dir="${basedir}/compiled" executable="perl">
252 <arg line="-S"/>
253 <arg line="bin/script/import.pl demo"/>
254 <env key="GSDLHOME" path="${basedir}/compiled"/>
255 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
256 <env key="GSDLOS" value="linux"/>
257 <env key="PATH" path="${basedir}/compiled/bin/linux:${basedir}/compiled/bin/script:${env.PATH}"/>
258 </exec>
259 <exec dir="${basedir}/compiled" executable="perl">
260 <arg line="-S"/>
261 <arg line="bin/script/buildcol.pl demo"/>
262 <env key="GSDLHOME" path="${basedir}/compiled"/>
263 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
264 <env key="GSDLOS" value="linux"/>
265 <env key="PATH" path="${basedir}/compiled/bin/linux:${basedir}/compiled/bin/script:${env.PATH}"/>
266 </exec>
267 </else>
268 </if>
269 <delete dir="${basedir}/compiled/collect/demo/index"/>
270 <move file="${basedir}/compiled/collect/demo/building" tofile="${basedir}/compiled/collect/demo/index"/>
271
272 <!-- delete the source code -->
273 <delete><fileset dir="compiled" includes="Makefile,config.cache,config.h,config.log,stamp-h,config.status"/></delete>
274 <delete dir="compiled/common-src"/>
275 <delete dir="compiled/build-src"/>
276 <delete dir="compiled/runtime-src"/>
277 <delete><fileset dir="compiled" includes="Install.txt,acconfig.h,aclocal.m4,config.guess,config.sub,configtest.pl,configure,configure.in,install-sh,Makefile.in,micotest.cpp,config.h.in,win32.mak,win32cfg.h"/></delete>
278
279 <!-- strip .svn working-copy dirs -->
280 <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
281
282 <!-- create needed empty files -->
283 <mkdir dir="compiled/tmp"/>
284 <chmod dir="compiled/tmp" perm="a+rwx"/>
285 <echo file="compiled/etc/usage.txt"></echo>
286
287 <!-- windows -->
288 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
289
290 <!-- make a copy of server.exe in the root -->
291 <copy file="compiled/bin/windows/server.exe" tofile="compiled/server.exe"/>
292
293 <!-- delete sourcecode -->
294 <delete dir="${binzip.dir}/common-src"/>
295 <delete dir="${binzip.dir}/build-src"/>
296 <delete dir="${binzip.dir}/runtime-src"/>
297
298 <!-- create simple zipped binary distribution
299 <mkdir dir="distributions"/>
300 <property name="binzip.dir" value="distributions/Greenstone-${version}-${os.suffix}-binary"/>
301 <copy todir="${binzip.dir}"><fileset dir="compiled"/></copy>
302 <delete><fileset dir="${binzip.dir}" includes="README*.txt,Uninstall.bat,Uninst.bat,uninst.jar,win32.mak,win32cfg.h,makegs2.bat" excludes="READMEen.txt"/></delete>
303 -->
304
305 <!-- delete unneeded files -->
306 <delete dir="compiled/bin/linux" />
307 <delete><fileset dir="compiled" includes="*.bash,*.sh,*.csh,.gstermrc"/></delete>
308 <delete><fileset dir="compiled/gli" includes="*.sh,*4gs3.bat"/></delete>
309 <delete dir="compiled/autom4te.cache" />
310
311 <!-- linux -->
312 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
313
314 <!-- grab imagemagick and wv binaries -->
315 <delete dir="compiled/bin/linux/imagemagick"/>
316 <delete dir="compiled/bin/linux/wv"/>
317
318 <if>
319 <bool>
320 <and>
321 <not><equals arg1="${branch.path}" arg2="trunk"/></not>
322 <isgreaterthan arg1="${branch.tag.version}" arg2="2.83"/>
323 </and>
324 </bool>
325
326 <exec executable="svn">
327 <arg value="export"/>
328 <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
329 <arg value="compiled/bin/linux/imagemagick"/>
330 </exec>
331
332 <exec executable="svn">
333 <arg value="export"/>
334 <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
335 <arg value="compiled/bin/linux/wv"/>
336 </exec>
337
338 <else>
339 <exec executable="svn">
340 <arg value="export"/>
341 <arg value="${svn.root}/main/trunk/binaries/linux/imagemagick"/>
342 <arg value="compiled/bin/linux/imagemagick"/>
343 </exec>
344
345 <exec executable="svn">
346 <arg value="export"/>
347 <arg value="${svn.root}/main/trunk/binaries/linux/wv"/>
348 <arg value="compiled/bin/linux/wv"/>
349 </exec>
350 </else>
351 </if>
352
353 <!-- delete unneeded files -->
354 <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,micotest.cpp"/></delete>
355 <delete><fileset dir="compiled/gli" includes="*.bat"/></delete>
356 <delete><fileset dir="compiled" includes="*.bat"/></delete>
357 <delete dir="compiled/common-src/packages/windows"/>
358 <delete dir="compiled/common-src/indexers/packages/windows"/>
359
360 <!-- mac -->
361 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
362 <!-- grab imagemagick and ghostscript binaries -->
363 <delete dir="compiled/bin/darwin/imagemagick"/>
364 <delete dir="compiled/bin/darwin/ghostscript"/>
365
366 <if>
367 <bool>
368 <and>
369 <not><equals arg1="${branch.path}" arg2="trunk"/></not>
370 <isgreaterthan arg1="${branch.tag.version}" arg2="2.83"/>
371 </and>
372 </bool>
373
374 <exec executable="svn">
375 <arg value="export"/>
376 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
377 <arg value="compiled/bin/darwin/imagemagick"/>
378 </exec>
379
380 <exec executable="svn">
381 <arg value="export"/>
382 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
383 <arg value="compiled/bin/darwin/ghostscript"/>
384 </exec>
385
386 <else>
387 <exec executable="svn">
388 <arg value="export"/>
389 <arg value="${svn.root}/main/trunk/binaries/mac/intel/imagemagick"/>
390 <arg value="compiled/bin/darwin/imagemagick"/>
391 </exec>
392
393 <exec executable="svn">
394 <arg value="export"/>
395 <arg value="${svn.root}/main/trunk/binaries/mac/intel/ghostscript"/>
396 <arg value="compiled/bin/darwin/ghostscript"/>
397 </exec>
398 </else>
399 </if>
400
401 <!-- delete unneeded files -->
402 <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,*.bat"/></delete>
403 <delete><fileset dir="compiled/gli" includes="*.bat"/></delete>
404 <delete dir="compiled/common-src/packages/windows"/>
405
406 </if></else></if></else></if>
407
408 <!-- delete unneeded files -->
409 <delete dir="compiled/uninstaller" />
410 <delete file="compiled/bin/java/SignedGatherer.jar" />
411
412 <!-- tidy up gli -->
413 <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
414
415 <!-- mac and linux: insert export to cdrom package -->
416 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
417 <mkdir dir="compiled/bin/windows"/>
418 <get src="${server.exe.location}" dest="compiled/bin/windows/server.exe"/>
419
420 <if>
421 <bool>
422 <and>
423 <not><equals arg1="${branch.path}" arg2="trunk"/></not>
424 <isgreaterthan arg1="${branch.tag.version}" arg2="2.83"/>
425 </and>
426 </bool>
427
428 <get src="${svn.root}/main/${branch.path}/binaries/windows/bin/Setup.exe" dest="compiled/bin/windows/Setup.exe"/>
429 <get src="${svn.root}/main/${branch.path}/binaries/windows/bin/gssetup.exe" dest="compiled/bin/windows/gssetup.exe"/>
430
431 <else>
432 <get src="${svn.root}/main/trunk/binaries/windows/bin/Setup.exe" dest="compiled/bin/windows/Setup.exe"/>
433 <get src="${svn.root}/main/trunk/binaries/windows/bin/gssetup.exe" dest="compiled/bin/windows/gssetup.exe"/>
434 </else>
435 </if>
436 </if>
437
438 </target>
439
440</project>
Note: See TracBrowser for help on using the repository browser.