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

Revision 29236, 13.6 KB (checked in by ak19, 5 years ago)

1. Delete windows formatconverter.exe binary in linux and mac GS3 binaries and delete the linux/mac formatconverter binary in a Windows GS3 binary. 2. Delete the Lucene 3 ext/solr subfolders for a release binary, since we've moved to Lucene 4.

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                <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><or>
62                <equals arg1="${post.2.83.version}" arg2="true"/>
63            </or></bool>
64                <echo>EXPORTING GNOME LIB EXTENSION</echo>
65                <exec executable="svn">
66                    <arg value="export"/>
67                    <arg value="${svn.root}/gs2-extensions/gnome-lib/trunk/gnome-lib-minimal-${specific.os.type}${arch}${extension-x64}.tar.gz"/>
68                    <arg value="${basedir}/compiled/ext/gnome-lib-${specific.os.type}.tar.gz"/>
69                </exec>
70
71                <exec executable="tar" dir="${basedir}/compiled/ext">
72                    <arg value="xvzf"/>
73                    <arg value="gnome-lib-${specific.os.type}.tar.gz"/>
74                </exec>
75
76                <exec executable="/bin/bash" dir="${basedir}/compiled/ext/gnome-lib-minimal">
77                    <arg value="-c"/>
78                    <arg value="source setup.bash_old &amp;&amp; source devel.bash"/>
79                </exec>
80                <echo>DONE COMPILING GNOME LIB EXTENSION</echo>
81            </if>
82        </if>
83
84        <!-- run greenstone3's ant install and ant dist-tidy -->
85        <ant dir="compiled" inheritAll="false">
86            <target name="install"/>
87            <target name="dist-tidy"/>
88            <propertyset refid="forward.properties"/>
89            <property name="properties.accepted" value="true"/>
90        </ant>
91
92        <!-- Delete all collections apart from the Lucene demo collection -->
93        <delete dir="${basedir}/compiled/web/sites/localsite/collect/gberg"/>
94        <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgdemo"/>
95        <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgppdemo"/>
96        <delete dir="${basedir}/compiled/web/sites/localsite/collect/infomine"/>       
97
98        <!-- Delete the entire gnome support library on Linux -->
99        <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
100            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal"/>
101            <delete file="${basedir}/compiled/ext/gnome-lib-linux.tar.gz"/>
102        </if>
103
104        <!-- Delete all but the lib folder of the gnome support library on Mac,
105             then move this smaller gnome-lib-minimal dir from the top-level ext folder
106             to gs2build/ext, since wvware on mac needs gnome-lib-minimal -->
107        <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
108            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/cascade-make"/>
109            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/packages"/>
110            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/bin"/>
111            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/etc"/>
112            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/include"/>
113            <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/share"/>
114            <delete file="${basedir}/compiled/ext/gnome-lib-minimal/setup.bat"/>
115            <delete file="${basedir}/compiled/ext/gnome-lib-minimal/CASCADE-MAKE.sh"/>
116            <delete file="${basedir}/compiled/ext/gnome-lib-darwin.tar.gz"/>
117            <move file="${basedir}/compiled/ext/gnome-lib-minimal" todir="compiled/gs2build/ext"/>
118        </if>
119       
120        <!-- Delete Lucene 3.3 specific ext/solr folders, since we've switched over to Lucene 4.7.2 -->
121        <delete dir="${basedir}/compiled/ext/solr/lib3" />
122        <delete dir="${basedir}/compiled/ext/solr/conf3" />
123        <delete dir="${basedir}/compiled/ext/solr/etc3" />
124
125         
126        <if><bool><and>
127              <equals arg1="${rk.os}" arg2="linux"/>
128              <equals arg1="${extension-x64}" arg2="-x64"/>
129          </and></bool>
130          <property name="bitness" value="64"/>
131          <else>
132            <property name="bitness" value="32"/>
133          </else>
134        </if>
135
136        <!-- insert an xml parser (matched to the version of Perl being used by the release kit).
137             For Linux 64 bit, use the 64 bit versions.
138             For other cases, including Macs, we stick to the 32 bit
139             versions since there have been no problems yet, probably
140             because our Mac has 5.12 which is not included in
141             XML-Parser so that our mac then tries to find the xml
142             parser on the system.-->
143        <copy todir="compiled/gs2build/perllib/cpan">
144            <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="${bitness}-bit/**/*"/>
145        </copy>
146        <move file="compiled/gs2build/perllib/cpan/${bitness}-bit" tofile="compiled/gs2build/perllib/cpan/XML-Parser"/>
147
148        <!-- insert ant -->
149        <property name="insert.ant.version" value="1.8.2"/>
150        <mkdir dir="compiled/packages"/>
151        <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"/>
152        <untar src="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/" compression="gzip"/>
153        <move file="compiled/packages/apache-ant-${insert.ant.version}" tofile="compiled/packages/ant"/>
154        <delete file="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>
155
156        <!-- put the uninstaller in place -->
157        <antcall target="insert-and-compile-uninstaller"/>
158
159        <!-- (windows only) -->
160        <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
161            <!-- insert perl -->
162            <unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>
163        </if>
164
165        <!-- minify tomcat -->
166        <delete dir="compiled/packages/tomcat/webapps/docs"/>
167        <delete dir="compiled/packages/tomcat/webapps/examples"/>
168
169        <!-- tidy up gli to make it smaller -->
170        <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
171
172        <!-- strip out .svn dirs -->
173        <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
174
175        <!-- get rid of bin/formatconverter on windows and get rid of bin/formatconverter.exe on linux/mac -->
176        <if>
177            <bool><equals arg1="${rk.os}" arg2="windows"/></bool>
178                <delete file="compiled/bin/formatconverter"/>
179            <else>
180                <delete file="compiled/bin/formatconverter.exe"/>
181            </else>
182        </if>       
183       
184        <!-- (linux only) -->
185        <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
186            <!-- grab imagemagick binaries -->
187            <delete dir="compiled/gs2build/bin/linux/imagemagick"/>
188
189            <exec executable="svn">
190               <arg value="export"/>
191               <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux${extension-x64}.tar.gz"/>
192               <arg value="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
193            </exec>
194
195            <exec executable="tar" dir="compiled/ext">
196               <arg value="xvzf"/>
197               <arg value="imagemagick-linux${extension-x64}.tar.gz"/>
198            </exec>
199            <delete file="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
200            <move todir="compiled/gs2build/bin/linux/imagemagick">
201               <fileset dir="compiled/ext/imagemagick/linux"/>
202            </move>
203            <delete dir="compiled/ext/imagemagick"/>
204
205            <!--<delete dir="compiled/gs2build/bin/linux/imagemagick"/>
206            <exec executable="svn">
207                <arg value="export"/>
208                <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
209                <arg value="compiled/gs2build/bin/linux/imagemagick"/>
210            </exec>-->
211
212            <!-- grab wv binaries -->
213            <delete dir="compiled/gs2build/bin/linux/wv"/>
214            <exec executable="svn">
215                <arg value="export"/>
216                <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
217                <arg value="compiled/gs2build/bin/linux/wv"/>
218            </exec>
219        <!-- (mac only) -->
220        <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
221            <!-- grab imagemagick binaries -->
222
223            <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
224
225            <!--<exec executable="svn">
226               <arg value="export"/>
227               <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.5.tar.gz"/>
228               <arg value="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
229            </exec>
230
231            <exec executable="tar" dir="compiled/ext">
232               <arg value="xvzf"/>
233               <arg value="imagemagick-darwin-10.5.tar.gz"/>
234            </exec>
235            <delete file="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
236            <move todir="compiled/gs2build/bin/darwin/imagemagick">
237               <fileset dir="compiled/ext/imagemagick/darwin"/>
238            </move>
239            <delete dir="compiled/ext/imagemagick"/>-->
240
241            <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
242            <exec executable="svn">
243                <arg value="export"/>
244                <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
245                <arg value="compiled/gs2build/bin/darwin/imagemagick"/>
246            </exec>
247
248            <if><bool><not><equals arg1="${forward.install.flax}" arg2="true"/></not></bool>
249                <!-- grab ghostscript binaries -->
250                <delete dir="compiled/gs2build/bin/darwin/ghostscript"/>
251                <exec executable="svn">
252                    <arg value="export"/>
253                    <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
254                    <arg value="compiled/gs2build/bin/darwin/ghostscript"/>
255                </exec>
256            </if>
257        </if></else></if>
258
259        <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
260            <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
261                <arg line="-S"/>
262                <arg line="gs2build/bin/script/import.pl -removeold -site localsite lucene-jdbm-demo"/>
263                <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
264                <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
265                <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
266                <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
267                <env key="GSDLOS" value="windows"/>
268                <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
269            </exec>
270            <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
271                <arg line="-S"/>
272                <arg line="gs2build/bin/script/buildcol.pl -removeold -site localsite lucene-jdbm-demo"/>
273                <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
274                <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
275                <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
276                <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
277                <env key="GSDLOS" value="windows"/>
278                <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
279            </exec>
280            <delete dir="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
281            <move file="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building" tofile="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
282        <else>
283            <echo file="${basedir}/compiled/buildscript.sh">
284                #!/bin/bash
285                source gs3-setup.sh
286                /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/import.pl -site localsite lucene-jdbm-demo
287                /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/buildcol.pl -site localsite lucene-jdbm-demo
288                rm -rf ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
289                mv ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
290            </echo>
291            <chmod perm="775" file="${basedir}/compiled/buildscript.sh"/>
292            <exec dir="${basedir}/compiled" executable="/bin/bash">
293                <arg line="buildscript.sh"/>
294            </exec>
295            <delete file="${basedir}/compiled/buildscript.sh"/>
296        </else>
297        </if>
298       
299    </target>
300
301</project>
Note: See TracBrowser for help on using the browser.