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

Last change on this file since 22158 was 22158, checked in by ak19, 14 years ago

Reverting to use xlhtml-0.4.9.0 which has now got all the changes that were made for xlhtml.0.5 (v.0.5 needs depcomp and uses lots of calls automake to compile files on Linux).

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