source: main/trunk/release-kits/kits/rk3/ant-scripts/mojave-compile.xml@ 35512

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

Some changes to the mojave Mac release-kit rk3 main compile.xml file that had been accumulating. The latest is to turn of 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.5 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}-Mojave">
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 <!-- run greenstone3's ant install and ant dist-tidy -->
98 <ant dir="compiled" inheritAll="false">
99 <target name="install"/>
100 <target name="dist-tidy"/>
101 <propertyset refid="forward.properties"/>
102 <property name="properties.accepted" value="true"/>
103 <property name="properties.keep.src" value="${keep.src}"/>
104 </ant>
105
106 <!-- Delete all collections apart from the Lucene demo collection -->
107 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gberg"/>
108 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgdemo"/>
109 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgppdemo"/>
110 <delete dir="${basedir}/compiled/web/sites/localsite/collect/infomine"/>
111
112 <!-- Delete the entire gnome support library on Linux -->
113 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
114 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal"/>
115 <delete file="${basedir}/compiled/ext/gnome-lib-linux.tar.gz"/>
116 </if>
117
118 <!-- Delete all but the lib folder of the gnome support library on Mac,
119 then move this smaller gnome-lib-minimal dir from the top-level ext folder
120 to gs2build/ext, since wvware on mac needs gnome-lib-minimal -->
121 <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
122 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/cascade-make"/>
123 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/packages"/>
124 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/bin"/>
125 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/etc"/>
126 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/include"/>
127 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/share"/>
128 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/setup.bat"/>
129 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/CASCADE-MAKE.sh"/>
130 <delete file="${basedir}/compiled/ext/gnome-lib-darwin.tar.gz"/>
131 <move file="${basedir}/compiled/ext/gnome-lib-minimal" todir="compiled/gs2build/ext"/>
132 </if>
133
134 <!-- Delete Lucene 3.3 specific ext/solr folders, since we've switched over to Lucene 4.7.2 -->
135 <delete dir="${basedir}/compiled/ext/solr/lib3" />
136 <delete dir="${basedir}/compiled/ext/solr/conf3" />
137 <delete dir="${basedir}/compiled/ext/solr/etc3" />
138
139
140 <if><bool><and>
141 <equals arg1="${rk.os}" arg2="linux"/>
142 <equals arg1="${extension-x64}" arg2="-x64"/>
143 </and></bool>
144 <property name="bitness" value="64"/>
145 <else>
146 <property name="bitness" value="32"/>
147 </else>
148 </if>
149
150 <!-- insert an xml parser (matched to the version of Perl being used by the release kit).
151 For Linux 64 bit, use the 64 bit versions.
152 For other *nix cases, including Macs, we stick to the 32 bit
153 versions since there have been no problems yet, probably
154 because our Mac has 5.12 which is not included in
155 XML-Parser so that our mac then tries to find the xml
156 parser on the system.-->
157 <if><bool><not><equals arg1="${rk.os}" arg2="windows"/></not></bool>
158 <copy todir="compiled/gs2build/perllib/cpan">
159 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="${bitness}-bit/**/*"/>
160 </copy>
161 <move file="compiled/gs2build/perllib/cpan/${bitness}-bit" tofile="compiled/gs2build/perllib/cpan/XML-Parser"/>
162 </if>
163
164 <!-- insert ant -->
165 <property name="insert.ant.version" value="1.8.2"/>
166 <mkdir dir="compiled/packages"/>
167 <!--<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"/>-->
168 <exec executable="wget" failonerror="true">
169 <arg value="-P"/>
170 <arg value="compiled/packages"/>
171 <arg value="--no-check-certificate"/>
172 <arg value="https://www.greenstone.org/gs3files/apache-ant-${insert.ant.version}-bin.tar.gz"/>
173 </exec>
174
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 <exec executable="svn" dir="compiled/gs2build/bin/windows">
187 <arg value="export"/>
188 <arg value="${svn.root}/main/trunk/release-kits/shared/windows/perl.zip"/>
189 </exec>
190 <unzip src="compiled/gs2build/bin/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>
191 <delete failonerror="false" file="compiled/gs2build/bin/windows/perl.zip" />
192 </if>
193
194 <!-- minify tomcat -->
195 <delete dir="compiled/packages/tomcat/webapps/docs"/>
196 <delete dir="compiled/packages/tomcat/webapps/examples"/>
197
198 <!-- tidy up gli to make it smaller -->
199 <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
200
201 <!-- strip out .svn dirs -->
202 <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
203
204 <!-- 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 -->
205 <if>
206 <bool><equals arg1="${rk.os}" arg2="windows"/></bool>
207 <delete dir="compiled/bin/darwin"/>
208 <delete dir="compiled/bin/linux"/>
209 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
210 <delete dir="compiled/bin/windows"/>
211 <delete dir="compiled/bin/linux"/>
212 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
213 <delete dir="compiled/bin/windows"/>
214 <delete dir="compiled/bin/darwin"/>
215 </if></else>
216 </if></else>
217 </if>
218
219 <!-- (linux only) -->
220 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
221 <!-- grab imagemagick binaries -->
222 <delete dir="compiled/gs2build/bin/linux/imagemagick"/>
223
224 <exec executable="svn">
225 <arg value="export"/>
226 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux${extension-x64}.tar.gz"/>
227 <arg value="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
228 </exec>
229
230 <exec executable="tar" dir="compiled/ext">
231 <arg value="xvzf"/>
232 <arg value="imagemagick-linux${extension-x64}.tar.gz"/>
233 </exec>
234 <delete file="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
235 <move todir="compiled/gs2build/bin/linux/imagemagick">
236 <fileset dir="compiled/ext/imagemagick/linux"/>
237 </move>
238 <delete dir="compiled/ext/imagemagick"/>
239
240 <!--<delete dir="compiled/gs2build/bin/linux/imagemagick"/>
241 <exec executable="svn">
242 <arg value="export"/>
243 <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
244 <arg value="compiled/gs2build/bin/linux/imagemagick"/>
245 </exec>-->
246
247 <!-- grab wv binaries -->
248 <delete dir="compiled/gs2build/bin/linux/wv"/>
249 <exec executable="svn">
250 <arg value="export"/>
251 <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
252 <arg value="compiled/gs2build/bin/linux/wv"/>
253 </exec>
254 <!-- (mac only) -->
255 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
256 <!-- grab imagemagick binaries -->
257
258 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
259 <exec executable="svn">
260 <arg value="export"/>
261 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.11.tar.gz"/>
262 <arg value="compiled/ext/imagemagick-darwin-10.11.tar.gz"/>
263 </exec>
264 <exec executable="tar" dir="compiled/ext">
265 <arg value="xvzf"/>
266 <arg value="imagemagick-darwin-10.11.tar.gz"/>
267 </exec>
268 <delete file="compiled/ext/imagemagick-darwin-10.11.tar.gz"/>
269 <move todir="compiled/gs2build/bin/darwin/imagemagick">
270 <fileset dir="compiled/ext/imagemagick/darwin"/>
271 </move>
272 <delete dir="compiled/ext/imagemagick"/>
273
274 <!--
275 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
276 <exec executable="svn">
277 <arg value="export"/>
278 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
279 <arg value="compiled/gs2build/bin/darwin/imagemagick"/>
280 </exec>-->
281
282 <if><bool><not><equals arg1="${forward.install.flax}" arg2="true"/></not></bool>
283 <!-- grab ghostscript binaries -->
284 <delete dir="compiled/gs2build/bin/darwin/ghostscript"/>
285 <exec executable="svn">
286 <arg value="export"/>
287 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
288 <arg value="compiled/gs2build/bin/darwin/ghostscript"/>
289 </exec>
290 </if>
291 </if></else></if>
292
293 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
294 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
295 <arg line="-S"/>
296 <arg line="gs2build/bin/script/import.pl -removeold -site localsite lucene-jdbm-demo"/>
297 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
298 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
299 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
300 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
301 <env key="GSDLOS" value="windows"/>
302 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
303 </exec>
304 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
305 <arg line="-S"/>
306 <arg line="gs2build/bin/script/buildcol.pl -removeold -site localsite lucene-jdbm-demo"/>
307 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
308 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
309 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
310 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
311 <env key="GSDLOS" value="windows"/>
312 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
313 </exec>
314 <delete dir="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
315 <move file="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building" tofile="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
316 <else>
317 <echo file="${basedir}/compiled/buildscript.sh">
318 #!/bin/bash
319 source gs3-setup.sh
320 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/import.pl -site localsite lucene-jdbm-demo
321 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/buildcol.pl -site localsite lucene-jdbm-demo
322 rm -rf ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
323 mv ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
324 </echo>
325 <chmod perm="775" file="${basedir}/compiled/buildscript.sh"/>
326 <exec dir="${basedir}/compiled" executable="/bin/bash">
327 <arg line="buildscript.sh"/>
328 </exec>
329 <delete file="${basedir}/compiled/buildscript.sh"/>
330 </else>
331 </if>
332
333 </target>
334
335</project>
Note: See TracBrowser for help on using the repository browser.