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

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

Adding in global-svn-args tag in an svn checkout to match rest of recent changes that include this.

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