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

Revision 28301, 12.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="rk3-compile">
3
4    <target name="compile">
5
6        <!-- checkout greenstone3 -->
7        <exec executable="svn">
8            <arg value="checkout"/>
9            <arg value="${svn.root}/main/${branch.path}/greenstone3"/>
10            <arg value="compiled"/>
11            <arg value="-r"/><arg value="${branch.revision}"/>
12        </exec>
13
14        <if><bool><equals arg1="${with.jni}" arg2="false"/></bool>
15            <rsr file="${basedir}/compiled/build.properties.in" pattern="with.jni=true" replacement="#with.jni=true"/>
16        </if>
17
18        <if><bool><equals arg1="${with.gli.and.gems}" arg2="false"/></bool>
19            <rsr file="${basedir}/compiled/build.properties.in" pattern="with.gli.and.gems=true" replacement="#with.gli.and.gems=true"/>
20        </if>
21
22        <!-- make sure all c++ compilation is done statically on linux -->
23        <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
24            <property name="forward.compile.static" value="true"/>
25        </if>
26
27        <!-- make sure the c++ compilation can see the support library in the extension folder -->
28        <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
29            <property name="forward.use.gnomelib.ext" value="true"/>
30        </if>
31
32        <antcall target="persist-forwarded-properties">
33            <param name="greenstone3basedir" value="compiled"/>
34        </antcall>
35
36        <!-- run greenstone3's ant prepare -->
37        <ant dir="compiled" inheritAll="false">
38            <target name="prepare"/>
39            <propertyset refid="forward.properties"/>
40            <property name="properties.accepted" value="true"/>
41        </ant>
42
43        <!-- set all version numbers -->
44        <antcall target="greenstone3-set-version-numbers"><param name="greenstone3basedir" value="compiled"/></antcall>
45        <antcall target="gli-set-version-numbers"><param name="glibasedir" value="compiled/gli"/></antcall>
46        <antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="compiled/gs2build"/></antcall>
47
48        <!-- mac or linux: compile the support library -->
49        <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
50            <!-- checkout the gnome support library extension-->
51
52            <!-- For Lions, need a specific gnome-lib-minimal tar file. The file name contains darwin12 for Lion, it contains the os.shell name (darwin/linux) for other cases.
53            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) -->
54            <condition property="specific.os.type" value="${os.shell}-Lion" else="${os.shell}">
55                <matches pattern="^(10\.7\.[4-9]|10\.[8-9]|1[1-9]|[2-9])" string="${os.version}"/>
56            </condition>
57
58            <if><bool><or>
59                <equals arg1="${post.2.83.version}" arg2="true"/>
60            </or></bool>
61                <echo>EXPORTING GNOME LIB EXTENSION</echo>
62                <exec executable="svn">
63                    <arg value="export"/>
64                    <arg value="${svn.root}/gs2-extensions/gnome-lib/trunk/gnome-lib-minimal-${specific.os.type}${arch}${extension-x64}.tar.gz"/>
65                    <arg value="${basedir}/compiled/ext/gnome-lib-${specific.os.type}.tar.gz"/>
66                </exec>
67
68                <exec executable="tar" dir="${basedir}/compiled/ext">
69                    <arg value="xvzf"/>
70                    <arg value="gnome-lib-${specific.os.type}.tar.gz"/>
71                </exec>
72
73                <exec executable="/bin/bash" dir="${basedir}/compiled/ext/gnome-lib-minimal">
74                    <arg value="-c"/>
75                    <arg value="source setup.bash_old &amp;&amp; source devel.bash"/>
76                </exec>
77                <echo>DONE COMPILING GNOME LIB EXTENSION</echo>
78            </if>
79        </if>
80
81        <!-- run greenstone3's ant install and ant dist-tidy -->
82        <ant dir="compiled" inheritAll="false">
83            <target name="install"/>
84            <target name="dist-tidy"/>
85            <propertyset refid="forward.properties"/>
86            <property name="properties.accepted" value="true"/>
87        </ant>
88
89        <!-- Delete all collections apart from the Lucene demo collection -->
90        <delete dir="${basedir}/compiled/web/sites/localsite/collect/gberg"/>
91        <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgdemo"/>
92        <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgppdemo"/>
93        <delete dir="${basedir}/compiled/web/sites/localsite/collect/infomine"/>       
94
95        <!-- Delete the entire gnome support library on Linux -->
96        <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
97            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal"/>
98            <delete file="${basedir}/compiled/ext/gnome-lib-linux.tar.gz"/>
99        </if>
100
101        <!-- Delete all but the lib folder of the gnome support library on Mac,
102             then move this smaller gnome-lib-minimal dir from the top-level ext folder
103             to gs2build/ext, since wvware on mac needs gnome-lib-minimal -->
104        <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
105            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/cascade-make"/>
106            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/packages"/>
107            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/bin"/>
108            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/etc"/>
109            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/include"/>
110            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/share"/>
111            <delete file="${basedir}/compiled/ext/gnome-lib-minimal/setup.bat"/>
112            <delete file="${basedir}/compiled/ext/gnome-lib-minimal/CASCADE-MAKE.sh"/>
113            <delete file="${basedir}/compiled/ext/gnome-lib-darwin.tar.gz"/>
114            <move file="${basedir}/compiled/ext/gnome-lib-minimal" todir="compiled/gs2build/ext"/>
115        </if>
116
117        <!-- insert an xml parser (matched to the version of Perl being used by the release kit) -->
118        <copy todir="compiled/gs2build/perllib/cpan">
119            <fileset dir="${rk.home}/shared/linux" includes="XML-Parser/**/*"/>
120        </copy>
121
122        <!-- insert ant -->
123        <property name="insert.ant.version" value="1.8.2"/>
124        <mkdir dir="compiled/packages"/>
125        <get src="http://www.greenstone.org/gs3files/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>
126        <untar src="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/" compression="gzip"/>
127        <move file="compiled/packages/apache-ant-${insert.ant.version}" tofile="compiled/packages/ant"/>
128        <delete file="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>
129
130        <!-- put the uninstaller in place -->
131        <antcall target="insert-and-compile-uninstaller"/>
132
133        <!-- (windows only) -->
134        <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
135            <!-- insert perl -->
136            <unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>
137        </if>
138
139        <!-- minify tomcat -->
140        <delete dir="compiled/packages/tomcat/webapps/docs"/>
141        <delete dir="compiled/packages/tomcat/webapps/examples"/>
142
143        <!-- tidy up gli to make it smaller -->
144        <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
145
146        <!-- strip out .svn dirs -->
147        <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
148
149        <!-- (linux only) -->
150        <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
151            <!-- grab imagemagick binaries -->
152            <delete dir="compiled/gs2build/bin/linux/imagemagick"/>
153
154            <exec executable="svn">
155               <arg value="export"/>
156               <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux${extension-x64}.tar.gz"/>
157               <arg value="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
158            </exec>
159
160            <exec executable="tar" dir="compiled/ext">
161               <arg value="xvzf"/>
162               <arg value="imagemagick-linux${extension-x64}.tar.gz"/>
163            </exec>
164            <delete file="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
165            <move todir="compiled/gs2build/bin/linux/imagemagick">
166               <fileset dir="compiled/ext/imagemagick/linux"/>
167            </move>
168            <delete dir="compiled/ext/imagemagick"/>
169
170            <!--<delete dir="compiled/gs2build/bin/linux/imagemagick"/>
171            <exec executable="svn">
172                <arg value="export"/>
173                <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
174                <arg value="compiled/gs2build/bin/linux/imagemagick"/>
175            </exec>-->
176
177            <!-- grab wv binaries -->
178            <delete dir="compiled/gs2build/bin/linux/wv"/>
179            <exec executable="svn">
180                <arg value="export"/>
181                <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
182                <arg value="compiled/gs2build/bin/linux/wv"/>
183            </exec>
184        <!-- (mac only) -->
185        <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
186            <!-- grab imagemagick binaries -->
187
188            <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
189
190            <!--<exec executable="svn">
191               <arg value="export"/>
192               <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.5.tar.gz"/>
193               <arg value="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
194            </exec>
195
196            <exec executable="tar" dir="compiled/ext">
197               <arg value="xvzf"/>
198               <arg value="imagemagick-darwin-10.5.tar.gz"/>
199            </exec>
200            <delete file="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
201            <move todir="compiled/gs2build/bin/darwin/imagemagick">
202               <fileset dir="compiled/ext/imagemagick/darwin"/>
203            </move>
204            <delete dir="compiled/ext/imagemagick"/>-->
205
206            <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
207            <exec executable="svn">
208                <arg value="export"/>
209                <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
210                <arg value="compiled/gs2build/bin/darwin/imagemagick"/>
211            </exec>
212
213            <if><bool><not><equals arg1="${forward.install.flax}" arg2="true"/></not></bool>
214                <!-- grab ghostscript binaries -->
215                <delete dir="compiled/gs2build/bin/darwin/ghostscript"/>
216                <exec executable="svn">
217                    <arg value="export"/>
218                    <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
219                    <arg value="compiled/gs2build/bin/darwin/ghostscript"/>
220                </exec>
221            </if>
222        </if></else></if>
223
224        <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
225            <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
226                <arg line="-S"/>
227                <arg line="gs2build/bin/script/import.pl -removeold -site localsite lucene-jdbm-demo"/>
228                <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
229                <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
230                <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
231                <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
232                <env key="GSDLOS" value="windows"/>
233                <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
234            </exec>
235            <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
236                <arg line="-S"/>
237                <arg line="gs2build/bin/script/buildcol.pl -removeold -site localsite lucene-jdbm-demo"/>
238                <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
239                <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
240                <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
241                <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
242                <env key="GSDLOS" value="windows"/>
243                <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
244            </exec>
245            <delete dir="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
246            <move file="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building" tofile="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
247        <else>
248            <echo file="${basedir}/compiled/buildscript.sh">
249                #!/bin/bash
250                source gs3-setup.sh
251                /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/import.pl -site localsite lucene-jdbm-demo
252                /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/buildcol.pl -site localsite lucene-jdbm-demo
253                rm -rf ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
254                mv ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
255            </echo>
256            <chmod perm="775" file="${basedir}/compiled/buildscript.sh"/>
257            <exec dir="${basedir}/compiled" executable="/bin/bash">
258                <arg line="buildscript.sh"/>
259            </exec>
260            <delete file="${basedir}/compiled/buildscript.sh"/>
261        </else>
262        </if>
263       
264    </target>
265
266</project>
Note: See TracBrowser for help on using the browser.