root/main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml @ 28301

Revision 28301, 25.2 KB (checked in by ak19, 6 years ago)

Release-kit changes for Mac (Mountain) Lion which needs to check out its own specific version of the pre-compiled gnome-lib-minimal package.

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 value="checkout"/>
9                <arg value="${svn.root}/main/${branch.path}/greenstone2"/>
10                <arg value="${basedir}/compiled"/>
11            </exec>       
12            <else>
13                <exec executable="svn">
14                    <arg value="checkout"/>
15                    <arg value="${svn.root}/main/${branch.path}/gsdl"/>
16                    <arg value="${basedir}/compiled"/>
17                </exec>
18            </else>
19        </if>
20       
21        <exec executable="svn">
22            <arg value="checkout"/>
23            <arg value="${svn.root}/main/${branch.path}/gli"/>
24            <arg value="${basedir}/compiled/gli"/>
25        </exec>
26
27        <!-- drop in documentation -->
28        <copy todir="compiled" overwrite="true">
29            <fileset dir="${rk.home}/shared/greenstone2/docs" excludes="READMEar.txt,READMEes.txt,READMEfr.txt,READMEru.txt"/>
30        </copy>
31
32        <!-- set version numbers -->
33        <antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="${basedir}/compiled"/></antcall>
34        <antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/compiled/gli"/></antcall>
35
36        <!-- we do not want the *.app folders if we are not mac-->
37        <if><bool><not><equals arg1="${rk.os}" arg2="mac"/></not></bool>
38            <delete dir="${basedir}/compiled/client-gli.app"/>
39            <delete dir="${basedir}/compiled/gems.app"/>
40            <delete dir="${basedir}/compiled/gs2-server.app"/>
41            <delete dir="${basedir}/compiled/gli.app"/>
42        </if>
43
44        <!-- mac or linux: get the support library -->
45        <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
46            <!-- svn export the gnome support library extension-->
47
48            <!-- 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.
49                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) -->
50            <condition property="specific.os.type" value="${os.shell}-Lion" else="${os.shell}">
51                <matches pattern="^(10\.7\.[4-9]|10\.[8-9]|1[1-9]|[2-9])" string="${os.version}"/>
52            </condition>
53
54            <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
55                <echo>EXPORTING GNOME LIB EXTENSION</echo>
56                <exec executable="svn">
57                    <arg value="export"/>
58                    <arg value="${svn.root}/gs2-extensions/gnome-lib/trunk/gnome-lib-minimal-${specific.os.type}${arch}${extension-x64}.tar.gz"/>
59                    <arg value="${basedir}/compiled/ext/gnome-lib-minimal-${specific.os.type}.tar.gz"/>
60                </exec>
61
62                <exec executable="tar" dir="${basedir}/compiled/ext">
63                    <arg value="xvzf"/>
64                    <arg value="gnome-lib-minimal-${specific.os.type}.tar.gz"/>
65                </exec>
66
67                <exec executable="/bin/bash" dir="${basedir}/compiled/ext/gnome-lib-minimal">
68                    <arg value="-c"/>
69                    <arg value="source setup.bash_old &amp;&amp; source devel.bash"/>
70                </exec>
71               
72                <echo>DONE EXTRACTING GNOME LIB EXTENSION</echo>
73            </if>
74        </if>
75
76        <if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
77            <!-- LD_LIBRARY_PATH is DYLD_LIBRARY_PATH on mac-->
78            <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
79                <property name="libpathvar" value="DYLD_LIBRARY_PATH"/>
80            <else>
81                <property name="libpathvar" value="LD_LIBRARY_PATH"/>
82            </else>
83            </if>
84
85            <property name="gnome.lib.dir" value="${basedir}/compiled/ext/gnome-lib-minimal/${os.shell}"/>
86            <property name="path.arg" value="PATH=&quot;${gnome.lib.dir}/bin:${env.PATH}&quot;"/>
87            <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome.lib.dir}/include&quot;"/>
88            <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome.lib.dir}/include&quot;"/>
89            <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome.lib.dir}/include&quot;"/>
90            <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome.lib.dir}/lib&quot;"/>
91            <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome.lib.dir}/lib/pkgconfig&quot;"/>
92            <property name="ldlpath.arg" value="${libpathvar}=&quot;${gnome.lib.dir}/lib&quot;"/>
93
94            <property name="allargs" value="${path.arg} ${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${pcpath.arg} ${ldlpath.arg}"/>
95        </if>   
96       
97        <!-- windows only -->
98        <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
99
100            <!-- unzip packages -->
101            <unzip src="${basedir}/compiled/common-src/packages/windows/crypt/crypt.zip" dest="${basedir}/compiled/common-src/packages/windows/crypt"/>
102           
103            <!-- unzip expat if the version is less that 2.84 -->
104            <if><bool><equals arg1="${post.2.83.version}" arg2="false"/></bool>
105                <unzip src="${basedir}/compiled/common-src/packages/windows/expat/expat.zip" dest="${basedir}/compiled/common-src/packages/windows/expat"/>
106            </if>
107           
108            <unzip src="${basedir}/compiled/common-src/packages/windows/stlport/stlport.zip" dest="${basedir}/compiled/common-src/packages/windows/stlport"/>
109            <unzip src="${basedir}/compiled/common-src/indexers/packages/windows/iconv/iconv.zip" dest="${basedir}/compiled/common-src/indexers/packages/windows/iconv"/>
110            <untar src="${basedir}/compiled/common-src/packages/sqlite/sqlite-autoconf-3070602.tar.gz" dest="${basedir}/compiled/common-src/packages/sqlite" compression="gzip"/>
111
112            <!-- get winbin from tags if the version is greater than 2.83 otherwise get it from trunk -->
113            <if><bool><not><available file="${basedir}/compiled/bin/windows"/></not></bool>
114                <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
115                   
116                    <exec executable="svn">
117                        <arg value="export"/>
118                        <arg value="${svn.root}/main/${branch.path}/binaries/windows/bin"/>
119                        <arg value="${basedir}/compiled/bin/windows"/>
120                        <arg value="-r"/>
121                        <arg value="${branch.revision}"/>
122                    </exec>
123                   
124                    <else>
125                        <exec executable="svn">
126                            <arg value="export"/>
127                            <arg value="${svn.root}/main/trunk/binaries/windows/bin"/>
128                            <arg value="${basedir}/compiled/bin/windows"/>
129                            <arg value="-r"/>
130                            <arg value="${branch.revision}"/>
131                        </exec>
132                    </else>
133                </if>
134            </if>
135
136            <!-- insert windows perl -->
137            <unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/bin/windows"/>
138           
139            <exec executable="${basedir}/compiled/bin/windows/gunzip.exe" dir="${basedir}/compiled/runtime-src/packages/apache-httpd">
140                <arg value="-d"/>
141                <arg value="httpd-2.2.11-gs.tar.gz"/>
142            </exec>
143               
144            <exec executable="${basedir}/compiled/bin/windows/tar.exe" dir="${basedir}/compiled/runtime-src/packages/apache-httpd">
145                <arg value="-xvf"/>
146                <arg value="httpd-2.2.11-gs.tar"/>
147            </exec>
148           
149            <!-- Insert a unique number after every occurrence of the word tempfile to prevent some strange race conditions present on Windows 7 (iuv = InsertUniqueValue) -->
150            <iuv>
151                <fileset dir="${basedir}/compiled/runtime-src/packages/apache-httpd/httpd-2.2.11" includes="**/*.mak"/>
152                <job pattern="tempfile"/>
153            </iuv>
154           
155            <!-- compile c code -->
156            <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="clean"/></exec>
157            <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="APACHE_HTTPD=1"/></exec>
158            <exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="LOCAL_LIBRARY=1"/></exec>
159            <delete><fileset dir="${basedir}/compiled/apache-httpd" includes="**/*.pdb"/></delete>
160
161            <copy file="${rk.home}/shared/windows/Microsoft.VC80.CRT.manifest" tofile="${basedir}/compiled/apache-httpd/windows/bin/Microsoft.VC80.CRT.manifest"/>
162            <copy file="${rk.home}/shared/windows/Microsoft.VC80.CRT.manifest" tofile="${basedir}/compiled/apache-httpd/windows/lib/Microsoft.VC80.CRT.manifest"/>
163            <copy file="${rk.home}/shared/windows/Microsoft.VC80.CRT.manifest" tofile="${basedir}/compiled/apache-httpd/windows/modules/Microsoft.VC80.CRT.manifest"/>
164            <copy file="${rk.home}/shared/windows/msvcr80.dll" tofile="${basedir}/compiled/apache-httpd/windows/bin/msvcr80.dll"/>
165            <copy file="${rk.home}/shared/windows/msvcr80.dll" tofile="${basedir}/compiled/apache-httpd/windows/lib/msvcr80.dll"/>
166            <copy file="${rk.home}/shared/windows/msvcr80.dll" tofile="${basedir}/compiled/apache-httpd/windows/modules/msvcr80.dll"/>
167           
168            <mkdir dir="products"/>
169            <copy file="${basedir}/compiled/server.exe" tofile="${basedir}/products/server-${version}${version-extra}.exe"/>
170            <move file="${basedir}/compiled/server.exe" todir="${basedir}/compiled/bin/windows"/>
171
172
173        <!-- linux only -->
174        <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
175            <!-- add static to configure.in -->
176            <rsr file="${basedir}/compiled/configure.in" pattern="^LDFLAGS=.*$" replacement="LDFLAGS=-static"/>
177            <exec dir="${basedir}/compiled" executable="autoconf" output="${basedir}/compiled/configure">
178                <arg value="configure.in"/>
179            </exec>
180
181            <!-- set environment in packages/configure -->
182            <rsr file="${basedir}/compiled/common-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;"/>
183            <rsr file="${basedir}/compiled/build-src/packages/configure" pattern="^ENVIRONMENT=.*$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;"/>
184
185            <!-- run configure -->
186            <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
187                <arg line="--enable-apache-httpd --disable-wvware"/>
188            </exec>
189
190            <exec executable="tar" dir="${basedir}/compiled/build-src/packages/wv">
191                <arg value="xvzf"/>
192                <arg value="wv-1.2.4-gs.tar.gz"/>
193            </exec>
194               
195            <exec dir="${basedir}/compiled/build-src/packages/wv/wv-gs" executable="${basedir}/compiled/build-src/packages/wv/wv-gs/configure" failonerror="true">
196                <arg line="--prefix=${basedir}/compiled/build-src/packages/wv --bindir=${basedir}/compiled/bin/linux --libdir=${basedir}/compiled/lib/linux --datadir=${basedir}/compiled/etc/packages"/>
197                <arg line="${allargs}"/>
198            </exec>
199
200            <!-- add -static to makefiles -->
201            <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/>
202            <rsr file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" pattern="^LDFLAGS =.*$" replacement="LDFLAGS = -static"/>
203            <rsr file="${basedir}/compiled/build-src/packages/rtftohtml/rtftohtml_src/Makefile" pattern="(-o rtftohtml.{2}EXEEXT.{1})" replacement="$1 -static"/>
204
205        <!-- mac only -->
206        <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
207            <!-- run configure -->
208            <exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
209                <arg line="--enable-apache-httpd"/>
210                <arg line="${allargs}"/>
211            </exec>
212
213            <!-- tweak makefiles -->
214            <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"/>
215            <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"/>
216
217        </if></else></if></else></if>
218
219        <!-- mac and linux: compile -->
220        <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
221            <!-- make -->
222            <exec dir="${basedir}/compiled" executable="make" failonerror="true">
223                <arg line="${ldlpath.arg}"/>
224            </exec>
225
226            <!-- make install -->
227            <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="install"/></exec>
228
229            <!-- make apache-for-dist -->
230            <exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="apache-for-dist"/></exec>
231
232            <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
233                <exec dir="${basedir}/compiled/build-src/packages/wv/wv-gs" executable="make" failonerror="true">
234                    <arg line="${ldlpath.arg}"/>
235                </exec>
236                <exec dir="${basedir}/compiled/build-src/packages/wv/wv-gs" executable="make" failonerror="true"><arg value="install"/></exec>
237            </if>
238
239            <!-- strip executables -->
240            <exec dir="${basedir}/compiled/bin/${os.shell}" executable="find" failonerror="true">
241                <arg line=". ! -name . -type f -maxdepth 1 -exec strip {} &#59;"/>
242            </exec>
243           
244            <copy todir="${basedir}/compiled/lib/${os.shell}">
245                <fileset dir="${basedir}/compiled/common-src/packages/sqlite/lib" includes="*.dylib"/>
246            </copy>
247        </if>
248
249        <!-- Delete all but the lib folder and the setup.bash script of the gnome support library -->
250        <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
251            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/${os.shell}/bin"/>
252            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/${os.shell}/include"/>
253            <delete file="${basedir}/compiled/ext/gnome-lib-minimal/setup.bat"/>
254            <delete file="${basedir}/compiled/ext/gnome-lib-minimal/devel.bash"/>
255            <delete file="${basedir}/compiled/ext/gnome-lib-minimal-${os.shell}.tar.gz"/>
256        </if>
257
258        <!-- insert the necessary additional xml parser versions-->
259        <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
260            <!-- Add the 5.6 version if necessary -->
261            <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.6"/></not></bool>
262                <copy todir="${basedir}/compiled/perllib/cpan">
263                    <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.6,perl-5.6/**/*"/>
264                </copy>
265            </if>
266           
267            <!-- Add the 5.8 version if necessary -->
268            <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.8"/></not></bool>
269                <copy todir="${basedir}/compiled/perllib/cpan">
270                    <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.8,perl-5.8/**/*"/>
271                </copy>
272            </if>
273           
274            <!-- Add the 5.8 mutlithreaded version if necessary -->
275            <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.8-mt"/></not></bool>
276                <copy todir="${basedir}/compiled/perllib/cpan">
277                    <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.8-mt,perl-5.8-mt/**/*"/>
278                </copy>
279            </if>
280           
281            <!-- Add the 5.10 version if necessary -->
282            <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.10"/></not></bool>
283                <copy todir="${basedir}/compiled/perllib/cpan">
284                    <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.10,perl-5.10/**/*"/>
285                </copy>
286            </if>
287
288            <!-- Add the 5.14 version if necessary -->
289            <if><bool><not><available file="${basedir}/compiled/perllib/cpan/perl-5.14"/></not></bool>
290                <copy todir="${basedir}/compiled/perllib/cpan">
291                    <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="perl-5.14,perl-5.14/**/*"/>
292                </copy>
293            </if>
294        </if>
295
296        <!-- compile gli -->
297        <!-- (linux and mac) -->
298        <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
299            <exec dir="compiled/gli" executable="/bin/bash"><arg value="-c"/><arg value="./makegli.sh"/></exec>
300            <exec dir="compiled/gli" executable="/bin/bash"><arg value="-c"/><arg value="./makejar.sh"/></exec>
301        <!-- windows -->
302        <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
303            <exec dir="compiled/gli" executable="cmd.exe"><arg value="/c"/><arg value="makegli.bat"/></exec>
304            <exec dir="compiled/gli" executable="cmd.exe"><arg value="/c"/><arg value="makejar.bat"/></exec>
305        </if></else></if>
306
307        <delete dir="compiled/gli/jar"/>
308        <delete dir="compiled/gli/classes/org"/>
309        <move file="compiled/gli/GLIServer.jar" todir="compiled/bin/java"/>
310
311        <!-- compile uninstaller -->
312        <antcall target="insert-and-compile-uninstaller" />
313
314        <!-- delete the source code -->
315        <delete><fileset dir="compiled" includes="Makefile,config.cache,config.h,config.log,stamp-h,config.status"/></delete>
316        <delete dir="compiled/common-src"/>
317        <delete dir="compiled/build-src"/>
318        <delete dir="compiled/runtime-src"/>
319        <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>
320
321        <!-- strip .svn working-copy dirs -->
322        <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
323
324        <!-- create needed empty files -->
325        <mkdir dir="compiled/tmp"/>
326        <chmod dir="compiled/tmp" perm="a+rwx"/>
327        <echo file="compiled/etc/usage.txt"></echo>
328
329        <!-- windows -->
330        <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
331
332            <!-- make a copy of server.exe in the root -->
333            <copy file="compiled/bin/windows/server.exe" tofile="compiled/server.exe"/>
334
335            <!-- delete sourcecode -->
336            <delete dir="${binzip.dir}/common-src"/>
337            <delete dir="${binzip.dir}/build-src"/>
338            <delete dir="${binzip.dir}/runtime-src"/>
339           
340            <!-- create simple zipped binary distribution
341            <mkdir dir="distributions"/>
342            <property name="binzip.dir" value="distributions/Greenstone-${version}-${os.suffix}-binary"/>
343            <copy todir="${binzip.dir}"><fileset dir="compiled"/></copy>
344            <delete><fileset dir="${binzip.dir}" includes="README*.txt,Uninstall.bat,Uninst.bat,uninst.jar,win32.mak,win32cfg.h,makegs2.bat" excludes="READMEen.txt"/></delete>
345            -->
346
347            <!-- delete unneeded files -->
348            <delete dir="compiled/bin/linux" />
349<!--
350    Actually, leaving these in is helpful for running a cross-platform
351    Pure JAVA install
352            <delete><fileset dir="compiled" includes="*.bash,*.sh,*.csh,.gstermrc,makegs2.bat"/></delete>
353            <delete><fileset dir="compiled/gli" includes="*.sh,*4gs3.bat"/></delete>
354
355-->
356            <delete><fileset dir="compiled/gli" includes="*4gs3.bat"/></delete>
357            <delete dir="compiled/autom4te.cache" />
358
359        <!-- linux -->
360        <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
361
362            <!-- grab imagemagick and wv (if less than 2.84) binaries -->
363            <delete dir="compiled/bin/linux/imagemagick"/>
364
365            <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
366                <!--<if><bool><equals arg1="${x64}" arg2="true"/></bool>-->
367                    <exec executable="svn">
368                            <arg value="export"/>
369                            <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux${extension-x64}.tar.gz"/>
370                            <arg value="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
371                        </exec>
372
373                    <exec executable="tar" dir="compiled/ext">
374                            <arg value="xvzf"/>
375                        <arg value="imagemagick-linux${extension-x64}.tar.gz"/>
376                    </exec>
377                    <delete file="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
378                    <move todir="compiled/bin/linux/imagemagick">
379                        <fileset dir="compiled/ext/imagemagick/linux"/>
380                    </move>
381                <!--<else>
382                        <exec executable="svn">
383                            <arg value="export"/>
384                        <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
385                        <arg value="compiled/bin/linux/imagemagick"/>
386                    </exec>
387                </else>
388                </if>-->
389                <else>
390                    <delete dir="compiled/bin/linux/wv"/>   
391                    <exec executable="svn">
392                        <arg value="export"/>
393                        <arg value="${svn.root}/main/trunk/binaries/linux/imagemagick"/>
394                        <arg value="compiled/bin/linux/imagemagick"/>
395                    </exec>
396
397                    <exec executable="svn">
398                        <arg value="export"/>
399                        <arg value="${svn.root}/main/trunk/binaries/linux/wv"/>
400                        <arg value="compiled/bin/linux/wv"/>
401                    </exec>
402                </else>
403            </if>
404
405            <!-- delete unneeded files -->
406            <delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,micotest.cpp"/></delete>
407<!--
408  Actually useful to keep these files around for a Pure Java install
409            <delete><fileset dir="compiled/gli" includes="*.bat"/></delete>
410            <delete><fileset dir="compiled" includes="*.bat"/></delete>
411-->
412            <delete dir="compiled/common-src/packages/windows"/>
413            <delete dir="compiled/common-src/indexers/packages/windows"/>
414
415        <!-- mac -->
416        <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
417            <!-- grab imagemagick and ghostscript binaries -->
418            <delete dir="compiled/bin/darwin/imagemagick"/>
419            <delete dir="compiled/bin/darwin/ghostscript"/>
420
421            <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
422
423                    <!--<exec executable="svn">
424                       <arg value="export"/>
425                       <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.5.tar.gz"/>
426                       <arg value="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
427                    </exec>
428
429                    <exec executable="tar" dir="compiled/ext">
430                       <arg value="xvzf"/>
431                       <arg value="imagemagick-darwin-10.5.tar.gz"/>
432                    </exec>
433                    <delete file="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
434                    <move todir="compiled/bin/darwin/imagemagick">
435                       <fileset dir="compiled/ext/imagemagick/darwin"/>
436                    </move>-->
437
438                <exec executable="svn">
439                    <arg value="export"/>
440                    <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
441                    <arg value="compiled/bin/darwin/imagemagick"/>
442                </exec>
443             
444                <exec executable="svn">
445                    <arg value="export"/>
446                    <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
447                    <arg value="compiled/bin/darwin/ghostscript"/>
448                </exec>
449
450                <else>             
451                    <exec executable="svn">
452                        <arg value="export"/>
453                        <arg value="${svn.root}/main/trunk/binaries/mac/intel/imagemagick"/>
454                        <arg value="compiled/bin/darwin/imagemagick"/>
455                    </exec>
456               
457                    <exec executable="svn">
458                        <arg value="export"/>
459                        <arg value="${svn.root}/main/trunk/binaries/mac/intel/ghostscript"/>
460                        <arg value="compiled/bin/darwin/ghostscript"/>
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"/></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
473            <delete dir="compiled/common-src/packages/windows"/>
474
475        </if></else></if></else></if>
476
477        <!-- build demo collection -->
478        <!-- the envs on these execs simulate the environment when you run setup.bat -->
479        <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>   
480           
481            <exec dir="${basedir}/compiled" executable="${basedir}/compiled/bin/windows/perl/bin/perl">
482                <arg line="-S"/>
483                <arg line="bin/script/import.pl demo"/>
484                <env key="GSDLHOME" path="${basedir}/compiled"/>
485                <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
486                <env key="GSDLOS" value="windows"/>
487                <env key="PATH" path="${basedir}/compiled/bin/windows/perl/bin:${basedir}/compiled/bin/windows:${basedir}/compiled/bin/script:${env.PATH}"/>
488            </exec>
489            <exec dir="${basedir}/compiled" executable="${basedir}/compiled/bin/windows/perl/bin/perl">
490                <arg line="-S"/>
491                <arg line="bin/script/buildcol.pl demo"/>
492                <env key="GSDLHOME" path="${basedir}/compiled"/>
493                <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/collect"/>
494                <env key="GSDLOS" value="windows"/>
495                <env key="PATH" path="${basedir}/compiled/bin/windows/perl/bin:${basedir}/compiled/bin/windows:${basedir}/compiled/bin/script:${env.PATH}"/>
496            </exec>
497
498            <delete dir="${basedir}/compiled/collect/demo/index"/>
499            <move file="${basedir}/compiled/collect/demo/building" tofile="${basedir}/compiled/collect/demo/index"/>
500           
501            <else>
502                <echo file="${basedir}/compiled/buildscript.sh">
503                    #!/bin/bash
504                    source setup.bash
505                    /usr/bin/perl -S ${basedir}/compiled/bin/script/full-rebuild.pl demo
506                </echo>
507                <chmod perm="755" file="${basedir}/compiled/buildscript.sh"/>
508                <exec dir="${basedir}/compiled" executable="/bin/bash">
509                    <arg line="buildscript.sh"/>
510                </exec>
511                <delete file="${basedir}/compiled/buildscript.sh"/>
512            </else>
513        </if>
514
515        <!-- delete unneeded files -->
516        <delete dir="compiled/uninstaller" />
517        <delete file="compiled/bin/java/SignedGatherer.jar" />
518
519        <!-- tidy up gli -->
520        <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
521
522        <!-- mac and linux: insert export to cdrom package -->
523        <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
524            <mkdir dir="compiled/bin/windows"/>
525            <get src="${server.exe.location}" dest="compiled/bin/windows/server.exe"/>
526
527            <if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
528                <get src="${svn.root}/main/${branch.path}/binaries/windows/bin/Setup.exe" dest="compiled/bin/windows/Setup.exe"/>
529                <get src="${svn.root}/main/${branch.path}/binaries/windows/bin/gssetup.exe" dest="compiled/bin/windows/gssetup.exe"/>
530
531                <else>
532                    <get src="${svn.root}/main/trunk/binaries/windows/bin/Setup.exe" dest="compiled/bin/windows/Setup.exe"/>
533                    <get src="${svn.root}/main/trunk/binaries/windows/bin/gssetup.exe" dest="compiled/bin/windows/gssetup.exe"/>
534                </else>
535            </if>
536        </if>
537
538    </target>
539
540</project>
Note: See TracBrowser for help on using the browser.