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

Last change on this file was 37451, checked in by anupama, 14 months ago

Tried to merge the GS2/rk2 compile.xml file with mojave.xml (and the Wno_error flag needed for monterey). Do we need to copy in the precompiled Isis.macMojave binary? For now doing so.

File size: 30.8 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><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
7 <exec executable="svn">
8 <arg line="${global-svn-args}"/>
9 <arg value="checkout"/>
10 <arg value="${svn.root}/main/${branch.path}/greenstone2"/>
11 <arg value="${basedir}/compiled"/>
12 </exec>
13 <else>
14 <exec executable="svn">
15 <arg line="${global-svn-args}"/>
16 <arg value="checkout"/>
17 <arg value="${svn.root}/main/${branch.path}/gsdl"/>
18 <arg value="${basedir}/compiled"/>
19 </exec>
20 </else>
21 </if>
22
23 <exec executable="svn">
24 <arg line="${global-svn-args}"/>
25 <arg value="checkout"/>
26 <arg value="${svn.root}/main/${branch.path}/gli"/>
27 <arg value="${basedir}/compiled/gli"/>
28 </exec>
29
30 <!-- drop in documentation -->
31 <copy todir="compiled" overwrite="true">
32 <fileset dir="${rk.home}/shared/greenstone2/docs" excludes="READMEar.txt,READMEes.txt,READMEfr.txt,READMEru.txt"/>
33 </copy>
34
35 <!-- set version numbers -->
36 <antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="${basedir}/compiled"/></antcall>
37 <antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/compiled/gli"/></antcall>
38
39 <!-- we do not want the *.app folders if we are not mac-->
40 <if><bool><not><equals arg1="${rk.os}" arg2="mac"/></not></bool>
41 <delete dir="${basedir}/compiled/client-gli.app"/>
42 <delete dir="${basedir}/compiled/gems.app"/>
43 <delete dir="${basedir}/compiled/gs2-server.app"/>
44 <delete dir="${basedir}/compiled/gli.app"/>
45 </if>
46
47 <!-- mac or linux: get the support library -->
48 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
49 <!-- svn export the gnome support library extension-->
50
51 <!-- For Lions, need a specific gnome-lib-minimal tar file. The file name contains darwin12 for Lion, it contains the shell.name (darwin/linux) for other cases.
52 Mac OS X v10.7.4 onwards is Lion/Mountain Lion, different from Leopard/Snow Leopard. See http://en.wikipedia.org/wiki/Darwin_(operating_system) -->
53 <condition property="specific.os.type" value="${os.shell}-Lion" else="${os.shell}">
54 <and>
55 <contains string="${os.shell}" substring="darwin" casesensitive="false"/>
56 <matches pattern="^(10\.7\.[4-9]|10\.[8-9]|1[1-9]|[2-9])" string="${os.version}"/>
57 </and>
58 </condition>
59
60 <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
61 <echo>EXPORTING GNOME LIB EXTENSION</echo>
62 <exec executable="svn">
63 <arg line="${global-svn-args}"/>
64 <arg value="export"/>
65 <arg value="${svn.root}/gs2-extensions/gnome-lib/trunk/gnome-lib-minimal-${specific.os.type}${arch}${extension-x64}.tar.gz"/>
66 <arg value="${basedir}/compiled/ext/gnome-lib-minimal-${specific.os.type}.tar.gz"/>
67 </exec>
68
69 <exec executable="tar" dir="${basedir}/compiled/ext">
70 <arg value="xvzf"/>
71 <arg value="gnome-lib-minimal-${specific.os.type}.tar.gz"/>
72 </exec>
73
74 <exec executable="/bin/bash" dir="${basedir}/compiled/ext/gnome-lib-minimal">
75 <arg value="-c"/>
76 <arg value="source setup.bash_old &amp;&amp; source devel.bash"/>
77 </exec>
78
79 <echo>DONE EXTRACTING GNOME LIB EXTENSION</echo>
80 </if>
81 </if>
82
83 <if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
84 <!-- LD_LIBRARY_PATH is DYLD_LIBRARY_PATH on mac-->
85 <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
86 <property name="libpathvar" value="DYLD_LIBRARY_PATH"/>
87 <else>
88 <property name="libpathvar" value="LD_LIBRARY_PATH"/>
89 </else>
90 </if>
91
92 <property name="gnome.lib.dir" value="${basedir}/compiled/ext/gnome-lib-minimal/${os.shell}"/>
93 <property name="path.arg" value="PATH=&quot;${gnome.lib.dir}/bin:${env.PATH}&quot;"/>
94 <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome.lib.dir}/include&quot;"/>
95 <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome.lib.dir}/include&quot;"/>
96 <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome.lib.dir}/include&quot;"/>
97 <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome.lib.dir}/lib&quot;"/>
98 <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome.lib.dir}/lib/pkgconfig&quot;"/>
99 <property name="ldlpath.arg" value="${libpathvar}=&quot;${gnome.lib.dir}/lib&quot;"/>
100
101 <property name="allargs" value="${path.arg} ${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${pcpath.arg} ${ldlpath.arg}"/>
102 </if>
103
104 <!-- mac only: make errors about missing extern declarations back into warnings as in old (Mojave and before) macs -->
105 <if>
106 <bool><equals arg1="${rk.os}" arg2="mac"/></bool>
107 <rsr file="${basedir}/compiled/build.xml" pattern="CFLAGS=&amp;quot;" replacement="CFLAGS=&amp;quot;-Wno-error=implicit-function-declaration "/>
108 </if>
109
110 <!-- windows only -->
111 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
112
113 <!-- unzip packages -->
114 <unzip src="${basedir}/compiled/common-src/packages/windows/crypt/crypt.zip" dest="${basedir}/compiled/common-src/packages/windows/crypt"/>
115
116 <!-- unzip expat if the version is less that 2.84 -->
117 <if><bool><equals arg1="${post.2.83.version}" arg2="false"/></bool>
118 <unzip src="${basedir}/compiled/common-src/packages/windows/expat/expat.zip" dest="${basedir}/compiled/common-src/packages/windows/expat"/>
119 </if>
120
121 <unzip src="${basedir}/compiled/common-src/packages/windows/stlport/stlport.zip" dest="${basedir}/compiled/common-src/packages/windows/stlport"/>
122 <unzip src="${basedir}/compiled/common-src/indexers/packages/windows/iconv/iconv-VS14-PLUS.zip" dest="${basedir}/compiled/common-src/indexers/packages/windows/iconv"/>
123 <untar src="${basedir}/compiled/common-src/packages/sqlite/sqlite-autoconf-3070602.tar.gz" dest="${basedir}/compiled/common-src/packages/sqlite" compression="gzip"/>
124
125 <!-- get winbin from tags if the version is greater than 2.83 otherwise get it from trunk -->
126 <if><bool><not><available file="${basedir}/compiled/bin/windows"/></not></bool>
127 <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
128
129 <exec executable="svn">
130 <arg line="${global-svn-args}"/>
131 <arg value="export"/>
132 <arg value="${svn.root}/main/${branch.path}/binaries/windows/bin"/>
133 <arg value="${basedir}/compiled/bin/windows"/>
134 <arg value="-r"/>
135 <arg value="${branch.revision}"/>
136 </exec>
137
138 <else>
139 <exec executable="svn">
140 <arg line="${global-svn-args}"/>
141 <arg value="export"/>
142 <arg value="${svn.root}/main/trunk/binaries/windows/bin"/>
143 <arg value="${basedir}/compiled/bin/windows"/>
144 <arg value="-r"/>
145 <arg value="${branch.revision}"/>
146 </exec>
147 </else>
148 </if>
149 </if>
150
151 <!-- insert windows perl -->
152 <unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/bin/windows"/>
153
154 <exec executable="${basedir}/compiled/bin/windows/gunzip.exe" dir="${basedir}/compiled/runtime-src/packages/apache-httpd">
155 <arg value="-d"/>
156 <arg value="httpd-2.2.11-gs.tar.gz"/>
157 </exec>
158
159 <exec executable="${basedir}/compiled/bin/windows/tar.exe" dir="${basedir}/compiled/runtime-src/packages/apache-httpd">
160 <arg value="-xvf"/>
161 <arg value="httpd-2.2.11-gs.tar"/>
162 </exec>
163
164 <!-- Insert a unique number after every occurrence of the word tempfile to prevent some strange race conditions present on Windows 7 (iuv = InsertUniqueValue) -->
165 <iuv>
166 <fileset dir="${basedir}/compiled/runtime-src/packages/apache-httpd/httpd-2.2.11" includes="**/*.mak"/>
167 <job pattern="tempfile"/>
168 </iuv>
169
170 <!-- compile c code -->
171 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="clean"/></exec>
172 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="APACHE_HTTPD=1"/></exec>
173 <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="LOCAL_LIBRARY=1"/></exec>
174 <delete><fileset dir="${basedir}/compiled/apache-httpd" includes="**/*.pdb"/></delete>
175
176 <copy file="${rk.home}/shared/windows/Microsoft.VC80.CRT.manifest" tofile="${basedir}/compiled/apache-httpd/windows/bin/Microsoft.VC80.CRT.manifest"/>
177 <copy file="${rk.home}/shared/windows/Microsoft.VC80.CRT.manifest" tofile="${basedir}/compiled/apache-httpd/windows/lib/Microsoft.VC80.CRT.manifest"/>
178 <copy file="${rk.home}/shared/windows/Microsoft.VC80.CRT.manifest" tofile="${basedir}/compiled/apache-httpd/windows/modules/Microsoft.VC80.CRT.manifest"/>
179 <copy file="${rk.home}/shared/windows/msvcr80.dll" tofile="${basedir}/compiled/apache-httpd/windows/bin/msvcr80.dll"/>
180 <copy file="${rk.home}/shared/windows/msvcr80.dll" tofile="${basedir}/compiled/apache-httpd/windows/lib/msvcr80.dll"/>
181 <copy file="${rk.home}/shared/windows/msvcr80.dll" tofile="${basedir}/compiled/apache-httpd/windows/modules/msvcr80.dll"/>
182
183 <mkdir dir="products"/>
184 <copy file="${basedir}/compiled/server.exe" tofile="${basedir}/products/server-${version}${version-extra}.exe"/>
185 <move file="${basedir}/compiled/server.exe" todir="${basedir}/compiled/bin/windows"/>
186
187
188 <!-- linux only -->
189 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
190 <if><bool><equals arg1="${x64}" arg2="false"/></bool>
191 <!-- add static to configure.in, but not for x64. Why?? -->
192 <echo>********* adding -static to compiled/configure.in</echo>
193 <rsr file="${basedir}/compiled/configure.in" pattern="^LDFLAGS=.*$" replacement="LDFLAGS=-static"/>
194 <!-- set environment in packages/configure -->
195 <rsr file="${basedir}/compiled/common-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;"/>
196 <rsr file="${basedir}/compiled/build-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;"/>
197
198 </if>
199 <exec dir="${basedir}/compiled" executable="autoconf" output="${basedir}/compiled/configure">
200 <arg value="configure.in"/>
201 </exec>
202
203
204 <!-- run configure -->
205 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
206 <arg line="--enable-apache-httpd --disable-wvware"/>
207 </exec>
208
209 <exec executable="tar" dir="${basedir}/compiled/build-src/packages/wv">
210 <arg value="xvzf"/>
211 <arg value="wv-1.2.4-gs.tar.gz"/>
212 </exec>
213
214 <exec dir="${basedir}/compiled/build-src/packages/wv/wv-gs" executable="${basedir}/compiled/build-src/packages/wv/wv-gs/configure" failonerror="true">
215 <arg line="--prefix=${basedir}/compiled/build-src/packages/wv --bindir=${basedir}/compiled/bin/linux --libdir=${basedir}/compiled/lib/linux --datadir=${basedir}/compiled/etc/packages --disable-shared --enable-static"/>
216 <arg line="${allargs}"/>
217 </exec>
218
219 <!-- add -static to makefiles -->
220 <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/>
221 <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/>
222 <rsr file="${basedir}/compiled/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="(-o rtftohtml.{2}EXEEXT.{1})" replacement="$1 -static"/>
223
224 <!-- this bit from the lin32 compile-->
225 <if><bool><equals arg1="${x64}" arg2="false"/></bool>
226 <echo>******** modifying wget Makefile for linux 32</echo>
227 <rsr file="${basedir}/compiled/build-src/packages/wget/wget-1.17.1-gs/src/Makefile" pattern="^LDFLAGS =(.*) -static(.*)$" replacement="LDFLAGS = $1 $2"/>
228 </if>
229 <!-- mac only -->
230 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
231 <!-- run configure -->
232 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
233 <arg line="--enable-apache-httpd"/>
234 <arg line="${allargs}"/>
235 </exec>
236
237 <!-- tweak makefiles -->
238 <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"/>
239 <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"/>
240
241 </if></else></if></else></if>
242
243 <!-- mac and linux: compile -->
244 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
245 <!-- make -->
246 <exec dir="${basedir}/compiled" executable="make" failonerror="true">
247 <arg line="${ldlpath.arg}"/>
248 </exec>
249
250 <!-- make install -->
251 <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="install"/></exec>
252
253 <!-- make apache-for-dist -->
254 <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="apache-for-dist"/></exec>
255
256 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
257 <exec dir="${basedir}/compiled/build-src/packages/wv/wv-gs" executable="make" failonerror="true">
258 <arg line="${ldlpath.arg}"/>
259 </exec>
260 <exec dir="${basedir}/compiled/build-src/packages/wv/wv-gs" executable="make" failonerror="true"><arg value="install"/></exec>
261 </if>
262
263 <!-- strip executables -->
264 <exec dir="${basedir}/compiled/bin/${os.shell}" executable="find" failonerror="true">
265 <arg line=". ! -name . -type f -maxdepth 1 -exec strip {} &#59;"/>
266 </exec>
267
268 <!-- the libsqlite3.dylib is no longer compatible with Macs from Maverick/Yosemite/El Capitan onwards, so 10.9, 10.10, 10.11,
269 but also future versions of darwin, like anything that is version 11+, so major version numbers that are 2 digits or beyond) -->
270 <if><bool>
271 <and>
272 <contains string="${os.shell}" substring="darwin" casesensitive="false"/>
273 <not><matches pattern="^(10\.9|10\.[1-9][0-9]|1[1-9]|[2-9][0-9])" string="${os.version}"/></not><!--all darwin before Maverick/10.9-->
274 </and>
275 </bool>
276 <copy todir="${basedir}/compiled/lib/${os.shell}">
277 <fileset dir="${basedir}/compiled/common-src/packages/sqlite/lib" includes="*.dylib"/>
278 </copy>
279 </if>
280
281
282 <!-- for 64 bit need to copy in the statically compiled IsisGdl -->
283 <!--<delete file="${basedir}/compiled/bin/${os.shell}/IsisGdl"/>-->
284 <!--<get src="http://www.greenstone.org/caveat-emptor/IsisGdl.macleopard" dest="${basedir}/compiled/bin/${os.shell}/IsisGdl"/>-->
285 <!--<get src="http://www.greenstone.org/caveat-emptor/IsisGdl.mac64mojave" dest="${basedir}/compiled/bin/${os.shell}/IsisGdl"/>-->
286 <exec executable="wget" failonerror="true">
287 <arg value="-P"/>
288 <arg value="${basedir}/compiled/bin/${os.shell}"/>
289 <arg value="--no-check-certificate"/>
290 <arg value="http://www.greenstone.org/caveat-emptor/IsisGdl.mac64mojave"/>
291 </exec>
292
293 <move file="${basedir}/compiled/bin/${os.shell}/IsisGdl.mac64mojave" tofile="${basedir}/compiled/bin/${os.shell}/IsisGdl"/>
294 <chmod perm="755" file="${basedir}/compiled/bin/${os.shell}/IsisGdl"/>
295 </if>
296
297 <!-- in mac and linux 64 bit versions, we copy IsisGdl from caveat-emptor. However, now that it compiles under 64 bit, I don't think we need to do that anymore.-->
298
299 <!-- Delete all but the lib folder and the setup.bash script of the gnome support library -->
300 <if><bool><and>
301 <not><equals arg1="${keep.src}" arg2="true"/></not>
302 <or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or>
303 </and></bool>
304 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/${os.shell}/bin"/>
305 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/${os.shell}/include"/>
306 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/setup.bat"/>
307 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/devel.bash"/>
308 <delete file="${basedir}/compiled/ext/gnome-lib-minimal-${os.shell}.tar.gz"/>
309 </if>
310
311 <!-- insert the necessary additional xml parser versions-->
312 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
313 <!-- Add the 5.6 version if necessary -->
314 <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.6"/></not></bool>
315 <copy todir="${basedir}/compiled/perllib/cpan">
316 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.6,perl-5.6/**/*"/>
317 </copy>
318 </if>
319
320 <!-- Add the 5.8 version if necessary -->
321 <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.8"/></not></bool>
322 <copy todir="${basedir}/compiled/perllib/cpan">
323 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.8,perl-5.8/**/*"/>
324 </copy>
325 </if>
326
327 <!-- Add the 5.8 mutlithreaded version if necessary -->
328 <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.8-mt"/></not></bool>
329 <copy todir="${basedir}/compiled/perllib/cpan">
330 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.8-mt,perl-5.8-mt/**/*"/>
331 </copy>
332 </if>
333
334 <!-- Add the 5.10 version if necessary -->
335 <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.10"/></not></bool>
336 <copy todir="${basedir}/compiled/perllib/cpan">
337 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.10,perl-5.10/**/*"/>
338 </copy>
339 </if>
340
341 <!-- Add the 5.14 version if necessary -->
342 <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.14"/></not></bool>
343 <copy todir="${basedir}/compiled/perllib/cpan">
344 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.14,perl-5.14/**/*"/>
345 </copy>
346 </if>
347 </if>
348
349 <!-- compile gli -->
350 <!-- (linux and mac) -->
351 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
352 <exec dir="compiled/gli" executable="/bin/bash"><arg value="-c"/><arg value="./makegli.sh"/></exec>
353 <exec dir="compiled/gli" executable="/bin/bash"><arg value="-c"/><arg value="./makejar.sh"/></exec>
354 <!-- windows -->
355 <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
356 <exec dir="compiled/gli" executable="cmd.exe"><arg value="/c"/><arg value="makegli.bat"/></exec>
357 <exec dir="compiled/gli" executable="cmd.exe"><arg value="/c"/><arg value="makejar.bat"/></exec>
358 </if></else></if>
359
360 <if><bool><not><equals arg1="${keep.src}" arg2="true"/></not></bool>
361 <delete dir="compiled/gli/jar"/>
362 <delete dir="compiled/gli/classes/org"/>
363 </if>
364 <move file="compiled/gli/GLIServer.jar" todir="compiled/bin/java"/>
365
366 <!-- compile uninstaller -->
367 <antcall target="insert-and-compile-uninstaller" />
368
369 <!-- delete the source code -->
370 <if><bool><not><equals arg1="${keep.src}" arg2="true"/></not></bool>
371 <delete><fileset dir="compiled" includes="Makefile,config.cache,config.h,config.log,stamp-h,config.status"/></delete>
372 <delete dir="compiled/common-src"/>
373 <delete dir="compiled/build-src"/>
374 <delete dir="compiled/runtime-src"/>
375 <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,lib/**/*.a"/></delete>
376 </if>
377
378 <!-- strip .svn working-copy dirs -->
379 <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
380
381 <!-- create needed empty files -->
382 <mkdir dir="compiled/tmp"/>
383 <chmod dir="compiled/tmp" perm="a+rwx"/>
384 <echo file="compiled/etc/usage.txt"></echo>
385
386 <!-- scripts to compile GS2 are not needed in the binary -->
387 <delete file="compiled/makegs2.bat"/>
388 <delete file="compiled/makegs2x64.bat"/>
389 <delete file="compiled/makegs2.sh"/>
390
391 <!-- windows -->
392 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
393
394 <!-- make a copy of server.exe in the root -->
395 <copy file="compiled/bin/windows/server.exe" tofile="compiled/server.exe"/>
396
397 <!-- delete sourcecode -->
398 <delete dir="${binzip.dir}/common-src"/>
399 <delete dir="${binzip.dir}/build-src"/>
400 <delete dir="${binzip.dir}/runtime-src"/>
401
402 <!-- create simple zipped binary distribution
403 <mkdir dir="distributions"/>
404 <property name="binzip.dir" value="distributions/Greenstone-${version}-${os.suffix}-binary"/>
405 <copy todir="${binzip.dir}"><fileset dir="compiled"/></copy>
406 <delete><fileset dir="${binzip.dir}" includes="README*.txt,Uninstall.bat,Uninst.bat,uninst.jar,win32.mak,win32cfg.h,makegs2.bat" excludes="READMEen.txt"/></delete>
407 -->
408
409 <!-- delete unneeded files -->
410 <delete dir="compiled/bin/linux" />
411<!--
412 Actually, leaving these in is helpful for running a cross-platform
413 Pure JAVA install
414 <delete><fileset dir="compiled" includes="*.bash,*.sh,*.csh,.gstermrc,makegs2.bat"/></delete>
415 <delete><fileset dir="compiled/gli" includes="*.sh,*4gs3.bat"/></delete>
416
417-->
418 <delete><fileset dir="compiled/gli" includes="*4gs3.bat"/></delete>
419 <delete dir="compiled/autom4te.cache" />
420
421 <!-- linux -->
422 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
423
424 <!-- grab imagemagick and wv (if less than 2.84) binaries -->
425 <delete dir="compiled/bin/linux/imagemagick"/>
426
427 <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
428 <!--<if><bool><equals arg1="${x64}" arg2="true"/></bool>-->
429 <exec executable="svn">
430 <arg line="${global-svn-args}"/>
431 <arg value="export"/>
432 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux${extension-x64}.tar.gz"/>
433 <arg value="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
434 </exec>
435
436 <exec executable="tar" dir="compiled/ext">
437 <arg value="xvzf"/>
438 <arg value="imagemagick-linux${extension-x64}.tar.gz"/>
439 </exec>
440 <delete file="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
441 <move todir="compiled/bin/linux/imagemagick">
442 <fileset dir="compiled/ext/imagemagick/linux"/>
443 </move>
444 <!--<else>
445 <exec executable="svn">
446 <arg line="${global-svn-args}"/>
447 <arg value="export"/>
448 <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
449 <arg value="compiled/bin/linux/imagemagick"/>
450 </exec>
451 </else>
452 </if>-->
453 <else>
454 <delete dir="compiled/bin/linux/wv"/>
455 <exec executable="svn">
456 <arg line="${global-svn-args}"/>
457 <arg value="export"/>
458 <arg value="${svn.root}/main/trunk/binaries/linux/imagemagick"/>
459 <arg value="compiled/bin/linux/imagemagick"/>
460 </exec>
461
462 <exec executable="svn">
463 <arg line="${global-svn-args}"/>
464 <arg value="export"/>
465 <arg value="${svn.root}/main/trunk/binaries/linux/wv"/>
466 <arg value="compiled/bin/linux/wv"/>
467 </exec>
468 </else>
469 </if>
470
471 <!-- delete unneeded files -->
472 <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,micotest.cpp"/></delete>
473<!--
474 Actually useful to keep these files around for a Pure Java install
475 <delete><fileset dir="compiled/gli" includes="*.bat"/></delete>
476 <delete><fileset dir="compiled" includes="*.bat"/></delete>
477-->
478 <delete dir="compiled/common-src/packages/windows"/>
479 <delete dir="compiled/common-src/indexers/packages/windows"/>
480
481 <!-- mac -->
482 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
483 <!-- grab imagemagick and ghostscript binaries -->
484 <delete dir="compiled/bin/darwin/imagemagick"/>
485 <delete dir="compiled/bin/darwin/ghostscript"/>
486
487 <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
488
489 <!-- before mojave -->
490 <!--<property name="darwin-imagick-tarball" value="imagemagick-darwin-10.5.tar.gz"/>-->
491 <!-- mojave onwards -->
492 <property name="darwin-imagick-tarball" value="imagemagick-darwin-10.11.tar.gz"/>
493
494 <!-- grab imagemagick binaries for El Capitan -->
495 <!-- Grab the imagemagick compiled on an XWindows-less darwin 10.11 (El Capitan)
496 but where it was made backwards compatible with 10.8 (Mountain Lion) with mmacosx-version-min flag.
497 Upto and including the gs3.08 release this code still referred to imagemagick-darwin-10.5.tar.gz -->
498 <exec executable="svn">
499 <arg line="${global-svn-args}"/>
500 <arg value="export"/>
501 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/${darwin-imagick-tarball}"/>
502 <arg value="compiled/ext/${darwin-imagick-tarball}"/>
503 </exec>
504
505 <exec executable="tar" dir="compiled/ext">
506 <arg value="xvzf"/>
507 <arg value="${darwin-imagick-tarball}"/>
508 </exec>
509 <delete file="compiled/ext/${darwin-imagick-tarball}"/>
510 <move todir="compiled/bin/darwin/imagemagick">
511 <fileset dir="compiled/ext/imagemagick/darwin"/>
512 </move>
513
514 <!-- No more use for the decompressed ext/imagemagick folder, as it contains only setup scripts
515 that end up referring to the (empty) ext/imagemagick in the environment.
516 On sourcing GS2's setup script, these env vars further conflict with cmdline wget on newer Macs,
517 as DYLD_FALLBACK_LIBRARY_PATH (another env var hidden on Macs) ends up set. -->
518 <delete dir="compiled/ext/imagemagick"/> <!-- dir = The directory to delete, including all its files and subdirectories. -->
519
520 <!--
521 <exec executable="svn">
522 <arg line="${global-svn-args}"/>
523 <arg value="export"/>
524 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
525 <arg value="compiled/bin/darwin/imagemagick"/>
526 </exec>
527 -->
528 <exec executable="svn">
529 <arg line="${global-svn-args}"/>
530 <arg value="export"/>
531 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
532 <arg value="compiled/bin/darwin/ghostscript"/>
533 </exec>
534
535 <else>
536 <exec executable="svn">
537 <arg line="${global-svn-args}"/>
538 <arg value="export"/>
539 <arg value="${svn.root}/main/trunk/binaries/mac/intel/imagemagick"/>
540 <arg value="compiled/bin/darwin/imagemagick"/>
541 </exec>
542
543 <exec executable="svn">
544 <arg line="${global-svn-args}"/>
545 <arg value="export"/>
546 <arg value="${svn.root}/main/trunk/binaries/mac/intel/ghostscript"/>
547 <arg value="compiled/bin/darwin/ghostscript"/>
548 </exec>
549 </else>
550 </if>
551
552 <!-- delete unneeded files -->
553 <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm"/></delete>
554<!--
555 Actually useful to keep these files around for a Pure Java install
556 <delete><fileset dir="compiled/gli" includes="*.bat"/></delete>
557 <delete><fileset dir="compiled" includes="*.bat"/></delete>
558-->
559
560 <delete dir="compiled/common-src/packages/windows"/>
561
562 </if></else></if></else></if>
563
564 <!-- build demo collection -->
565 <!-- the envs on these execs simulate the environment when you run setup.bat -->
566 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
567
568 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/bin/windows/perl/bin/perl">
569 <arg line="-S"/>
570 <arg line="bin/script/import.pl demo"/>
571 <env key="GSDLHOME" path="${basedir}/compiled"/>
572 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
573 <env key="GSDLOS" value="windows"/>
574 <env key="PERL_PERTURB_KEYS" value="0"/>
575 <env key="PERL_HASH_SEED" value="0"/>
576 <env key="PATH" path="${basedir}/compiled/bin/windows/perl/bin:${basedir}/compiled/bin/windows:${basedir}/compiled/bin/script:${env.PATH}"/>
577 </exec>
578 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/bin/windows/perl/bin/perl">
579 <arg line="-S"/>
580 <arg line="bin/script/buildcol.pl demo"/>
581 <env key="PERL_PERTURB_KEYS" value="0"/>
582 <env key="PERL_HASH_SEED" value="0"/>
583 <env key="GSDLHOME" path="${basedir}/compiled"/>
584 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
585 <env key="GSDLOS" value="windows"/>
586 <env key="PATH" path="${basedir}/compiled/bin/windows/perl/bin:${basedir}/compiled/bin/windows:${basedir}/compiled/bin/script:${env.PATH}"/>
587 </exec>
588
589 <delete dir="${basedir}/compiled/collect/demo/index"/>
590 <move file="${basedir}/compiled/collect/demo/building" tofile="${basedir}/compiled/collect/demo/index"/>
591
592 <else>
593 <echo file="${basedir}/compiled/buildscript.sh">
594 #!/bin/bash
595 source setup.bash
596 /usr/bin/perl -S ${basedir}/compiled/bin/script/full-rebuild.pl demo
597 </echo>
598 <chmod perm="755" file="${basedir}/compiled/buildscript.sh"/>
599 <exec dir="${basedir}/compiled" executable="/bin/bash">
600 <arg line="buildscript.sh"/>
601 </exec>
602 <delete file="${basedir}/compiled/buildscript.sh"/>
603 </else>
604 </if>
605
606 <!-- delete unneeded files -->
607 <delete dir="compiled/uninstaller" />
608 <delete file="compiled/bin/java/SignedGatherer.jar" />
609
610 <!-- tidy up gli -->
611 <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
612 <echo>Setting up export to cdrom package</echo>
613 <!-- mac and linux: insert export to cdrom package -->
614 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
615 <mkdir dir="compiled/bin/windows"/>
616 <!--<get src="${server.exe.location}" dest="compiled/bin/windows/server.exe"/>-->
617 <exec executable="wget" failonerror="true">
618 <arg value="-P"/>
619 <arg value="compiled/bin/windows"/>
620 <arg value="--no-check-certificate"/>
621 <arg value="${server.exe.location}"/>
622 </exec>
623 <move file="compiled/bin/windows/latest-server.exe"
624 tofile="distributions/${dist.name}/bin/windows/server.exe"/>
625
626 <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
627 <!--<get src="${svn.root}/main/${branch.path}/binaries/windows/bin/Setup.exe" dest="compiled/bin/windows/Setup.exe"/>
628 <get src="${svn.root}/main/${branch.path}/binaries/windows/bin/gssetup.exe" dest="compiled/bin/windows/gssetup.exe"/>-->
629 <exec executable="svn">
630 <arg line="${global-svn-args}"/>
631 <arg value="export"/>
632 <arg value="${svn.root}/main/${branch.path}/binaries/windows/bin/Setup.exe"/>
633 <arg value="compiled/bin/windows/Setup.exe"/>
634 </exec>
635 <exec executable="svn">
636 <arg line="${global-svn-args}"/>
637 <arg value="export"/>
638 <arg value="${svn.root}/main/${branch.path}/binaries/windows/bin/gssetup.exe"/>
639 <arg value="compiled/bin/windows/gssetup.exe"/>
640 </exec>
641
642 <else>
643 <!--<get src="${svn.root}/main/trunk/binaries/windows/bin/Setup.exe" dest="compiled/bin/windows/Setup.exe"/>
644 <get src="${svn.root}/main/trunk/binaries/windows/bin/gssetup.exe" dest="compiled/bin/windows/gssetup.exe"/>-->
645 <exec executable="svn">
646 <arg line="${global-svn-args}"/>
647 <arg value="export"/>
648 <arg value="${svn.root}/main/trunk/binaries/windows/bin/Setup.exe"/>
649 <arg value="compiled/bin/windows/Setup.exe"/>
650 </exec>
651 <exec executable="svn">
652 <arg line="${global-svn-args}"/>
653 <arg value="export"/>
654 <arg value="${svn.root}/main/trunk/binaries/windows/bin/gssetup.exe"/>
655 <arg value="compiled/bin/windows/gssetup.exe"/>
656 </exec>
657 </else>
658 </if>
659 </if>
660
661 </target>
662
663</project>
Note: See TracBrowser for help on using the repository browser.