source: main/trunk/release-kits/kits/rk3/ant-scripts/lin64-compile.xml@ 35515

Last change on this file since 35515 was 35515, checked in by anupama, 3 years ago

Related to commits 35511 to 35514: for linux 64 release-kit too, turn off checkout.gnomelib.ext when release-kits are running, as this property is now turned on by default in GS3checked out from SVN after discussion some weeks ago with Dr Bainbridge and Kathy.

File size: 15.3 KB
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 <!-- Comment out any active checkout.gnomelib.ext=true line in build.properties.svn
15 So that the release-kits go back to behaving how they did when the line
16 used to be commented out by default in build properties.
17 For alternative ways to achieve this, see
18 https://jeeva-paramasamy.blogspot.com/2012/07/removeunset-property-in-property-file.html
19 Further options in the propertyfile task https://ant.apache.org/manual/Tasks/propertyfile.html
20 -->
21 <!--<if><bool><equals arg1="${checkout.gnomelib.ext}" arg2="true"/></bool>-->
22 <rsr file="${basedir}/compiled/build.properties.svn" pattern="checkout.gnomelib.ext=true" replacement="#checkout.gnomelib.ext=true"/>
23 <!--</if>-->
24
25 <if><bool><equals arg1="${with.jni}" arg2="false"/></bool>
26 <rsr file="${basedir}/compiled/build.properties.svn" pattern="with.jni=true" replacement="#with.jni=true"/>
27 </if>
28
29 <if><bool><equals arg1="${with.gli.and.gems}" arg2="false"/></bool>
30 <rsr file="${basedir}/compiled/build.properties.svn" pattern="with.gli.and.gems=true" replacement="#with.gli.and.gems=true"/>
31 </if>
32
33 <!-- make sure all c++ compilation is done statically on linux -->
34 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
35 <property name="forward.compile.static" value="true"/>
36 </if>
37
38 <!-- make sure the c++ compilation can see the support library in the extension folder -->
39 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
40 <property name="forward.use.gnomelib.ext" value="true"/>
41 </if>
42
43 <antcall target="persist-forwarded-properties">
44 <param name="greenstone3basedir" value="compiled"/>
45 </antcall>
46
47 <!-- run greenstone3's ant prepare -->
48 <ant dir="compiled" inheritAll="false">
49 <target name="prepare"/>
50 <propertyset refid="forward.properties"/>
51 <property name="properties.accepted" value="true"/>
52 </ant>
53
54 <!-- set all version numbers -->
55 <antcall target="greenstone3-set-version-numbers"><param name="greenstone3basedir" value="compiled"/></antcall>
56 <antcall target="gli-set-version-numbers"><param name="glibasedir" value="compiled/gli"/></antcall>
57 <antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="compiled/gs2build"/></antcall>
58
59 <!-- mac or linux: compile the support library -->
60 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
61 <!-- checkout the gnome support library extension-->
62
63 <!-- 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.
64 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) -->
65 <condition property="specific.os.type" value="${os.shell}-Lion" else="${os.shell}">
66 <and>
67 <contains string="${os.shell}" substring="darwin" casesensitive="false"/>
68 <matches pattern="^(10\.7\.[4-9]|10\.[8-9]|1[1-9]|[2-9])" string="${os.version}"/>
69 </and>
70 </condition>
71
72 <if><bool><or>
73 <equals arg1="${post.2.83.version}" arg2="true"/>
74 </or></bool>
75 <echo>EXPORTING GNOME LIB EXTENSION</echo>
76 <exec executable="svn">
77 <arg value="export"/>
78 <arg value="${svn.root}/gs2-extensions/gnome-lib/trunk/gnome-lib-minimal-${specific.os.type}${arch}${extension-x64}.tar.gz"/>
79 <arg value="${basedir}/compiled/ext/gnome-lib-${specific.os.type}.tar.gz"/>
80 </exec>
81
82 <exec executable="tar" dir="${basedir}/compiled/ext">
83 <arg value="xvzf"/>
84 <arg value="gnome-lib-${specific.os.type}.tar.gz"/>
85 </exec>
86
87 <exec executable="/bin/bash" dir="${basedir}/compiled/ext/gnome-lib-minimal">
88 <arg value="-c"/>
89 <arg value="source setup.bash_old &amp;&amp; source devel.bash"/>
90 </exec>
91 <echo>DONE COMPILING GNOME LIB EXTENSION</echo>
92 </if>
93 </if>
94
95 <rsr file="${basedir}/compiled/build.xml" pattern="CFLAGS=&amp;quot;" replacement="CFLAGS=&amp;quot;-fPIC "/>
96
97
98 <!-- run greenstone3's ant install and ant dist-tidy -->
99 <ant dir="compiled" inheritAll="false">
100 <target name="install"/>
101 <target name="dist-tidy"/>
102 <propertyset refid="forward.properties"/>
103 <property name="properties.accepted" value="true"/>
104 <property name="properties.keep.src" value="${keep.src}"/>
105 </ant>
106
107 <!-- Delete all collections apart from the Lucene demo collection -->
108 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gberg"/>
109 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgdemo"/>
110 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgppdemo"/>
111 <delete dir="${basedir}/compiled/web/sites/localsite/collect/infomine"/>
112
113 <!-- Delete the entire gnome support library on Linux -->
114 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
115 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal"/>
116 <delete file="${basedir}/compiled/ext/gnome-lib-linux.tar.gz"/>
117 </if>
118
119 <!-- Delete all but the lib folder of the gnome support library on Mac,
120 then move this smaller gnome-lib-minimal dir from the top-level ext folder
121 to gs2build/ext, since wvware on mac needs gnome-lib-minimal -->
122 <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
123 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/cascade-make"/>
124 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/packages"/>
125 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/bin"/>
126 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/etc"/>
127 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/include"/>
128 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/share"/>
129 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/setup.bat"/>
130 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/CASCADE-MAKE.sh"/>
131 <delete file="${basedir}/compiled/ext/gnome-lib-darwin.tar.gz"/>
132 <move file="${basedir}/compiled/ext/gnome-lib-minimal" todir="compiled/gs2build/ext"/>
133 </if>
134
135 <!-- Delete Lucene 3.3 specific ext/solr folders, since we've switched over to Lucene 4.7.2 -->
136 <delete dir="${basedir}/compiled/ext/solr/lib3" />
137 <delete dir="${basedir}/compiled/ext/solr/conf3" />
138 <delete dir="${basedir}/compiled/ext/solr/etc3" />
139
140
141 <if><bool><and>
142 <equals arg1="${rk.os}" arg2="linux"/>
143 <equals arg1="${extension-x64}" arg2="-x64"/>
144 </and></bool>
145 <property name="bitness" value="64"/>
146 <else>
147 <property name="bitness" value="32"/>
148 </else>
149 </if>
150
151 <!-- insert an xml parser (matched to the version of Perl being used by the release kit).
152 For Linux 64 bit, use the 64 bit versions.
153 For other *nix cases, including Macs, we stick to the 32 bit
154 versions since there have been no problems yet, probably
155 because our Mac has 5.12 which is not included in
156 XML-Parser so that our mac then tries to find the xml
157 parser on the system.-->
158 <if><bool><not><equals arg1="${rk.os}" arg2="windows"/></not></bool>
159 <copy todir="compiled/gs2build/perllib/cpan">
160 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="${bitness}-bit/**/*"/>
161 </copy>
162 <move file="compiled/gs2build/perllib/cpan/${bitness}-bit" tofile="compiled/gs2build/perllib/cpan/XML-Parser"/>
163 </if>
164
165 <!-- insert ant -->
166 <property name="insert.ant.version" value="1.9.13"/> <!-- value="1.8.2" -->
167 <mkdir dir="compiled/packages"/>
168 <!--<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"/>-->
169 <exec executable="wget" failonerror="true">
170 <arg value="-P"/>
171 <arg value="compiled/packages"/>
172 <arg value="--no-check-certificate"/>
173 <arg value="http://www.greenstone.org/gs3files/apache-ant-${insert.ant.version}-bin.tar.gz"/>
174 </exec>
175 <untar src="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/" compression="gzip"/>
176 <move file="compiled/packages/apache-ant-${insert.ant.version}" tofile="compiled/packages/ant"/>
177 <delete file="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>
178
179 <!-- put the uninstaller in place -->
180 <antcall target="insert-and-compile-uninstaller"/>
181
182 <!-- (windows only) -->
183 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
184 <!-- insert perl -->
185 <unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>
186 </if>
187
188 <!-- minify tomcat -->
189 <delete dir="compiled/packages/tomcat/webapps/docs"/>
190 <delete dir="compiled/packages/tomcat/webapps/examples"/>
191
192 <!-- tidy up gli to make it smaller -->
193 <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
194
195 <!-- strip out .svn dirs -->
196 <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
197
198 <!-- get rid of bin/formatconverter on windows and get rid of bin/formatconverter.exe on linux/mac. Now we have specific OS dirs, so get rid of the irrelevant OS dirs instead -->
199 <if>
200 <bool><equals arg1="${rk.os}" arg2="windows"/></bool>
201 <delete dir="compiled/bin/darwin"/>
202 <delete dir="compiled/bin/linux"/>
203 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
204 <delete dir="compiled/bin/windows"/>
205 <delete dir="compiled/bin/linux"/>
206 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
207 <delete dir="compiled/bin/windows"/>
208 <delete dir="compiled/bin/darwin"/>
209 </if></else>
210 </if></else>
211 </if>
212
213 <!-- (linux only) -->
214 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
215 <!-- grab imagemagick binaries -->
216 <delete dir="compiled/gs2build/bin/linux/imagemagick"/>
217
218 <exec executable="svn">
219 <arg value="export"/>
220 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux${extension-x64}.tar.gz"/>
221 <arg value="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
222 </exec>
223
224 <exec executable="tar" dir="compiled/ext">
225 <arg value="xvzf"/>
226 <arg value="imagemagick-linux${extension-x64}.tar.gz"/>
227 </exec>
228 <delete file="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
229 <move todir="compiled/gs2build/bin/linux/imagemagick">
230 <fileset dir="compiled/ext/imagemagick/linux"/>
231 </move>
232 <delete dir="compiled/ext/imagemagick"/>
233
234 <!--<delete dir="compiled/gs2build/bin/linux/imagemagick"/>
235 <exec executable="svn">
236 <arg value="export"/>
237 <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
238 <arg value="compiled/gs2build/bin/linux/imagemagick"/>
239 </exec>-->
240
241 <!-- We don't want to bundle the old pre-compiled 32 bit wv folder anymore -->
242 <!-- grab wv binaries -->
243 <!--<delete dir="compiled/gs2build/bin/linux/wv"/>
244 <exec executable="svn">
245 <arg value="export"/>
246 <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
247 <arg value="compiled/gs2build/bin/linux/wv"/>
248 </exec>
249 -->
250 <!-- (mac only) -->
251 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
252 <!-- grab imagemagick binaries -->
253
254 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
255
256 <!--<exec executable="svn">
257 <arg value="export"/>
258 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.5.tar.gz"/>
259 <arg value="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
260 </exec>
261
262 <exec executable="tar" dir="compiled/ext">
263 <arg value="xvzf"/>
264 <arg value="imagemagick-darwin-10.5.tar.gz"/>
265 </exec>
266 <delete file="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
267 <move todir="compiled/gs2build/bin/darwin/imagemagick">
268 <fileset dir="compiled/ext/imagemagick/darwin"/>
269 </move>
270 <delete dir="compiled/ext/imagemagick"/>-->
271
272 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
273 <exec executable="svn">
274 <arg value="export"/>
275 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
276 <arg value="compiled/gs2build/bin/darwin/imagemagick"/>
277 </exec>
278
279 <if><bool><not><equals arg1="${forward.install.flax}" arg2="true"/></not></bool>
280 <!-- grab ghostscript binaries -->
281 <delete dir="compiled/gs2build/bin/darwin/ghostscript"/>
282 <exec executable="svn">
283 <arg value="export"/>
284 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
285 <arg value="compiled/gs2build/bin/darwin/ghostscript"/>
286 </exec>
287 </if>
288 </if></else></if>
289
290 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
291 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
292 <arg line="-S"/>
293 <arg line="gs2build/bin/script/import.pl -removeold -site localsite lucene-jdbm-demo"/>
294 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
295 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
296 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
297 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
298 <env key="GSDLOS" value="windows"/>
299 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
300 </exec>
301 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
302 <arg line="-S"/>
303 <arg line="gs2build/bin/script/buildcol.pl -removeold -site localsite lucene-jdbm-demo"/>
304 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
305 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
306 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
307 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
308 <env key="GSDLOS" value="windows"/>
309 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
310 </exec>
311 <delete dir="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
312 <move file="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building" tofile="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
313 <else>
314 <echo file="${basedir}/compiled/buildscript.sh">
315 #!/bin/bash
316 source gs3-setup.sh
317 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/import.pl -site localsite lucene-jdbm-demo
318 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/buildcol.pl -site localsite lucene-jdbm-demo
319 rm -rf ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
320 mv ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
321 </echo>
322 <chmod perm="775" file="${basedir}/compiled/buildscript.sh"/>
323 <exec dir="${basedir}/compiled" executable="/bin/bash">
324 <arg line="buildscript.sh"/>
325 </exec>
326 <delete file="${basedir}/compiled/buildscript.sh"/>
327 </else>
328 </if>
329
330 </target>
331
332</project>
Note: See TracBrowser for help on using the repository browser.