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

Last change on this file since 22447 was 22447, checked in by sjm84, 13 years ago

Corrected the different versions of the XML Parser going into the wrong directory

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