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

Last change on this file since 32497 was 32497, checked in by sjm84, 6 years ago

GS3 release binary's ant version now increased to ant 1.9.13. This required uploading ant 1.9.13 tarball to greenstone.org/gs3files from where a GS3 binary's ant is always obtained. Needed to upgrade from 1.8.2 to 1.9.x since on a mac 1.8.2 was still attempting to find JAVA_HOME in an old fixed location that no longer has a java. The newer ant uses the dynamic way (running libexec) to find where JAVA_HOME is. Without this upgrade, cannot run gs3-server.sh on mac without first manually setting JAVA_HOME: doing so would result in error messages from ant's own scripts about JAVA_HOME not being set/being incorrect.

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