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

Last change on this file since 22463 was 22463, checked in by sjm84, 12 years ago

Removed some lines that were accidentally added in the previous commit

File size: 18.3 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 <!-- compile c code -->
115 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="clean"/></exec>
116 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="APACHE_HTTPD=1"/></exec>
117 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="LOCAL_LIBRARY=1"/></exec>
118 <mkdir dir="products"/>
119 <copy file="${basedir}/compiled/server.exe" tofile="${basedir}/products/server-${version}.exe"/>
120 <move file="${basedir}/compiled/server.exe" todir="${basedir}/compiled/bin/windows"/>
121
122
123 <!-- linux only -->
124 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
125
126 <!-- add static to configure.in -->
127 <rsr file="${basedir}/compiled/configure.in" pattern="^LDFLAGS=.*$" replacement="LDFLAGS=-static"/>
128 <exec dir="${basedir}/compiled" executable="autoconf" output="${basedir}/compiled/configure">
129 <arg value="configure.in"/>
130 </exec>
131
132 <!-- set environment in packages/configure -->
133 <rsr file="${basedir}/compiled/common-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;"/>
134 <rsr file="${basedir}/compiled/build-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;"/>
135
136 <!-- run configure -->
137 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
138 <arg line="--enable-apache-httpd"/>
139 <env key="LDFLAGS" value="-static"/>
140 </exec>
141
142 <!-- add -static to makefiles -->
143 <rsr file="${basedir}/compiled/build-src/packages/wv/wv-gs/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static" />
144 <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/>
145 <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/>
146 <rsr file="${basedir}/compiled/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="(-o rtftohtml.{2}EXEEXT.{1})" replacement="$1 -static"/>
147
148 <!-- mac only -->
149 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
150 <!-- run configure -->
151 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
152 <arg line="--enable-apache-httpd"/>
153 </exec>
154
155 <!-- tweak makefiles -->
156 <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"/>
157 <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"/>
158
159 </if></else></if></else></if>
160
161 <!-- mac and linux: compile -->
162 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
163
164 <!-- make -->
165 <exec dir="${basedir}/compiled" executable="make" failonerror="true"/>
166
167 <!-- make install -->
168 <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="install"/></exec>
169
170 <!-- make apache-for-dist -->
171 <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="apache-for-dist"/></exec>
172
173 <!-- strip executables -->
174 <exec dir="${basedir}/compiled/bin/${os.shell}" executable="find" failonerror="true">
175 <arg line=". ! -name . -type f -maxdepth 1 -exec strip {} &#59;"/>
176 </exec>
177 </if>
178
179 <!-- insert the necessary additional xml parser versions-->
180 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
181 <!-- Add the 5.6 version if necessary -->
182 <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.6"/></not></bool>
183 <copy todir="${basedir}/compiled/perllib/cpan">
184 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.6,perl-5.6/**/*"/>
185 </copy>
186 </if>
187
188 <!-- Add the 5.8 version if necessary -->
189 <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.8"/></not></bool>
190 <copy todir="${basedir}/compiled/perllib/cpan">
191 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.8,perl-5.8/**/*"/>
192 </copy>
193 </if>
194
195 <!-- Add the 5.10 version if necessary -->
196 <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.10"/></not></bool>
197 <copy todir="${basedir}/compiled/perllib/cpan">
198 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.10,perl-5.10/**/*"/>
199 </copy>
200 </if>
201 </if>
202
203 <!-- compile gli -->
204 <!-- (linux and mac) -->
205 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
206 <exec dir="compiled/gli" executable="/bin/bash"><arg value="-c"/><arg value="./makegli.sh"/></exec>
207 <exec dir="compiled/gli" executable="/bin/bash"><arg value="-c"/><arg value="./makejar.sh"/></exec>
208 <!-- windows -->
209 <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
210 <exec dir="compiled/gli" executable="cmd.exe"><arg value="/c"/><arg value="makegli.bat"/></exec>
211 <exec dir="compiled/gli" executable="cmd.exe"><arg value="/c"/><arg value="makejar.bat"/></exec>
212 </if></else></if>
213
214 <delete dir="compiled/gli/jar"/>
215 <delete dir="compiled/gli/classes/org"/>
216 <move file="compiled/gli/GLIServer.jar" todir="compiled/bin/java"/>
217
218 <!-- compile uninstaller -->
219 <antcall target="insert-and-compile-uninstaller" />
220
221 <!-- build demo collection -->
222 <!-- the envs on these execs simulate the environment when you run setup.bat -->
223 <if>
224 <bool>
225 <equals arg1="${rk.os}" arg2="windows"/>
226 </bool>
227
228 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/bin/windows/perl/bin/perl">
229 <arg line="-S"/>
230 <arg line="bin/script/import.pl demo"/>
231 <env key="GSDLHOME" path="${basedir}/compiled"/>
232 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
233 <env key="GSDLOS" value="windows"/>
234 <env key="PATH" path="${basedir}/compiled/bin/windows/perl/bin:${basedir}/compiled/bin/windows:${basedir}/compiled/bin/script:${env.PATH}"/>
235 </exec>
236 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/bin/windows/perl/bin/perl">
237 <arg line="-S"/>
238 <arg line="bin/script/buildcol.pl demo"/>
239 <env key="GSDLHOME" path="${basedir}/compiled"/>
240 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
241 <env key="GSDLOS" value="windows"/>
242 <env key="PATH" path="${basedir}/compiled/bin/windows/perl/bin:${basedir}/compiled/bin/windows:${basedir}/compiled/bin/script:${env.PATH}"/>
243 </exec>
244
245 <else>
246 <exec dir="${basedir}/compiled" executable="perl">
247 <arg line="-S"/>
248 <arg line="bin/script/import.pl demo"/>
249 <env key="GSDLHOME" path="${basedir}/compiled"/>
250 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
251 <env key="GSDLOS" value="linux"/>
252 <env key="PATH" path="${basedir}/compiled/bin/linux:${basedir}/compiled/bin/script:${env.PATH}"/>
253 </exec>
254 <exec dir="${basedir}/compiled" executable="perl">
255 <arg line="-S"/>
256 <arg line="bin/script/buildcol.pl demo"/>
257 <env key="GSDLHOME" path="${basedir}/compiled"/>
258 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
259 <env key="GSDLOS" value="linux"/>
260 <env key="PATH" path="${basedir}/compiled/bin/linux:${basedir}/compiled/bin/script:${env.PATH}"/>
261 </exec>
262 </else>
263 </if>
264 <delete dir="${basedir}/compiled/collect/demo/index"/>
265 <move file="${basedir}/compiled/collect/demo/building" tofile="${basedir}/compiled/collect/demo/index"/>
266
267 <!-- delete the source code -->
268 <delete><fileset dir="compiled" includes="Makefile,config.cache,config.h,config.log,stamp-h,config.status"/></delete>
269 <delete dir="compiled/common-src"/>
270 <delete dir="compiled/build-src"/>
271 <delete dir="compiled/runtime-src"/>
272 <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>
273
274 <!-- strip .svn working-copy dirs -->
275 <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
276
277 <!-- create needed empty files -->
278 <mkdir dir="compiled/tmp"/>
279 <chmod dir="compiled/tmp" perm="a+rwx"/>
280 <echo file="compiled/etc/usage.txt"></echo>
281
282 <!-- windows -->
283 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
284
285 <!-- make a copy of server.exe in the root -->
286 <copy file="compiled/bin/windows/server.exe" tofile="compiled/server.exe"/>
287
288 <!-- delete sourcecode -->
289 <delete dir="${binzip.dir}/common-src"/>
290 <delete dir="${binzip.dir}/build-src"/>
291 <delete dir="${binzip.dir}/runtime-src"/>
292
293 <!-- create simple zipped binary distribution
294 <mkdir dir="distributions"/>
295 <property name="binzip.dir" value="distributions/Greenstone-${version}-${os.suffix}-binary"/>
296 <copy todir="${binzip.dir}"><fileset dir="compiled"/></copy>
297 <delete><fileset dir="${binzip.dir}" includes="README*.txt,Uninstall.bat,Uninst.bat,uninst.jar,win32.mak,win32cfg.h,makegs2.bat" excludes="READMEen.txt"/></delete>
298 -->
299
300 <!-- delete unneeded files -->
301 <delete dir="compiled/bin/linux" />
302 <delete><fileset dir="compiled" includes="*.bash,*.sh,*.csh,.gstermrc"/></delete>
303 <delete><fileset dir="compiled/gli" includes="*.sh,*4gs3.bat"/></delete>
304 <delete dir="compiled/autom4te.cache" />
305
306 <!-- linux -->
307 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
308
309 <!-- grab imagemagick and wv binaries -->
310 <delete dir="compiled/bin/linux/imagemagick"/>
311 <delete dir="compiled/bin/linux/wv"/>
312
313 <if>
314 <bool>
315 <and>
316 <not><equals arg1="${branch.path}" arg2="trunk"/></not>
317 <isgreaterthan arg1="${branch.tag.version}" arg2="2.83"/>
318 </and>
319 </bool>
320
321 <exec executable="svn">
322 <arg value="export"/>
323 <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
324 <arg value="compiled/bin/linux/imagemagick"/>
325 </exec>
326
327 <exec executable="svn">
328 <arg value="export"/>
329 <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
330 <arg value="compiled/bin/linux/wv"/>
331 </exec>
332
333 <else>
334 <exec executable="svn">
335 <arg value="export"/>
336 <arg value="${svn.root}/main/trunk/binaries/linux/imagemagick"/>
337 <arg value="compiled/bin/linux/imagemagick"/>
338 </exec>
339
340 <exec executable="svn">
341 <arg value="export"/>
342 <arg value="${svn.root}/main/trunk/binaries/linux/wv"/>
343 <arg value="compiled/bin/linux/wv"/>
344 </exec>
345 </else>
346 </if>
347
348 <!-- delete unneeded files -->
349 <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,micotest.cpp"/></delete>
350 <delete><fileset dir="compiled/gli" includes="*.bat"/></delete>
351 <delete><fileset dir="compiled" includes="*.bat"/></delete>
352 <delete dir="compiled/common-src/packages/windows"/>
353 <delete dir="compiled/common-src/indexers/packages/windows"/>
354
355 <!-- mac -->
356 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
357 <!-- grab imagemagick and ghostscript binaries -->
358 <delete dir="compiled/bin/darwin/imagemagick"/>
359 <delete dir="compiled/bin/darwin/ghostscript"/>
360
361 <if>
362 <bool>
363 <and>
364 <not><equals arg1="${branch.path}" arg2="trunk"/></not>
365 <isgreaterthan arg1="${branch.tag.version}" arg2="2.83"/>
366 </and>
367 </bool>
368
369 <exec executable="svn">
370 <arg value="export"/>
371 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
372 <arg value="compiled/bin/darwin/imagemagick"/>
373 </exec>
374
375 <exec executable="svn">
376 <arg value="export"/>
377 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
378 <arg value="compiled/bin/darwin/ghostscript"/>
379 </exec>
380
381 <else>
382 <exec executable="svn">
383 <arg value="export"/>
384 <arg value="${svn.root}/main/trunk/binaries/mac/intel/imagemagick"/>
385 <arg value="compiled/bin/darwin/imagemagick"/>
386 </exec>
387
388 <exec executable="svn">
389 <arg value="export"/>
390 <arg value="${svn.root}/main/trunk/binaries/mac/intel/ghostscript"/>
391 <arg value="compiled/bin/darwin/ghostscript"/>
392 </exec>
393 </else>
394 </if>
395
396 <!-- delete unneeded files -->
397 <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,*.bat"/></delete>
398 <delete><fileset dir="compiled/gli" includes="*.bat"/></delete>
399 <delete dir="compiled/common-src/packages/windows"/>
400
401 </if></else></if></else></if>
402
403 <!-- delete unneeded files -->
404 <delete dir="compiled/uninstaller" />
405 <delete file="compiled/bin/java/SignedGatherer.jar" />
406
407 <!-- tidy up gli -->
408 <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
409
410 <!-- mac and linux: insert export to cdrom package -->
411 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
412 <mkdir dir="compiled/bin/windows"/>
413 <get src="${server.exe.location}" dest="compiled/bin/windows/server.exe"/>
414
415 <if>
416 <bool>
417 <and>
418 <not><equals arg1="${branch.path}" arg2="trunk"/></not>
419 <isgreaterthan arg1="${branch.tag.version}" arg2="2.83"/>
420 </and>
421 </bool>
422
423 <get src="${svn.root}/main/${branch.path}/binaries/windows/bin/Setup.exe" dest="compiled/bin/windows/Setup.exe"/>
424 <get src="${svn.root}/main/${branch.path}/binaries/windows/bin/gssetup.exe" dest="compiled/bin/windows/gssetup.exe"/>
425
426 <else>
427 <get src="${svn.root}/main/trunk/binaries/windows/bin/Setup.exe" dest="compiled/bin/windows/Setup.exe"/>
428 <get src="${svn.root}/main/trunk/binaries/windows/bin/gssetup.exe" dest="compiled/bin/windows/gssetup.exe"/>
429 </else>
430 </if>
431 </if>
432
433 </target>
434
435</project>
Note: See TracBrowser for help on using the repository browser.