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

Last change on this file since 28512 was 28512, checked in by ak19, 11 years ago

Needed to add an additional test to ensure that the -Lion suffix for the binary file generated is only on Macs (darwin) and not on other machines

File size: 12.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 <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 <!-- insert an xml parser (matched to the version of Perl being used by the release kit) -->
121 <copy todir="compiled/gs2build/perllib/cpan">
122 <fileset dir="${rk.home}/shared/linux" includes="XML-Parser/**/*"/>
123 </copy>
124
125 <!-- insert ant -->
126 <property name="insert.ant.version" value="1.8.2"/>
127 <mkdir dir="compiled/packages"/>
128 <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"/>
129 <untar src="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/" compression="gzip"/>
130 <move file="compiled/packages/apache-ant-${insert.ant.version}" tofile="compiled/packages/ant"/>
131 <delete file="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>
132
133 <!-- put the uninstaller in place -->
134 <antcall target="insert-and-compile-uninstaller"/>
135
136 <!-- (windows only) -->
137 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
138 <!-- insert perl -->
139 <unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>
140 </if>
141
142 <!-- minify tomcat -->
143 <delete dir="compiled/packages/tomcat/webapps/docs"/>
144 <delete dir="compiled/packages/tomcat/webapps/examples"/>
145
146 <!-- tidy up gli to make it smaller -->
147 <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
148
149 <!-- strip out .svn dirs -->
150 <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
151
152 <!-- (linux only) -->
153 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
154 <!-- grab imagemagick binaries -->
155 <delete dir="compiled/gs2build/bin/linux/imagemagick"/>
156
157 <exec executable="svn">
158 <arg value="export"/>
159 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux${extension-x64}.tar.gz"/>
160 <arg value="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
161 </exec>
162
163 <exec executable="tar" dir="compiled/ext">
164 <arg value="xvzf"/>
165 <arg value="imagemagick-linux${extension-x64}.tar.gz"/>
166 </exec>
167 <delete file="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
168 <move todir="compiled/gs2build/bin/linux/imagemagick">
169 <fileset dir="compiled/ext/imagemagick/linux"/>
170 </move>
171 <delete dir="compiled/ext/imagemagick"/>
172
173 <!--<delete dir="compiled/gs2build/bin/linux/imagemagick"/>
174 <exec executable="svn">
175 <arg value="export"/>
176 <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
177 <arg value="compiled/gs2build/bin/linux/imagemagick"/>
178 </exec>-->
179
180 <!-- grab wv binaries -->
181 <delete dir="compiled/gs2build/bin/linux/wv"/>
182 <exec executable="svn">
183 <arg value="export"/>
184 <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
185 <arg value="compiled/gs2build/bin/linux/wv"/>
186 </exec>
187 <!-- (mac only) -->
188 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
189 <!-- grab imagemagick binaries -->
190
191 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
192
193 <!--<exec executable="svn">
194 <arg value="export"/>
195 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.5.tar.gz"/>
196 <arg value="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
197 </exec>
198
199 <exec executable="tar" dir="compiled/ext">
200 <arg value="xvzf"/>
201 <arg value="imagemagick-darwin-10.5.tar.gz"/>
202 </exec>
203 <delete file="compiled/ext/imagemagick-darwin-10.5.tar.gz"/>
204 <move todir="compiled/gs2build/bin/darwin/imagemagick">
205 <fileset dir="compiled/ext/imagemagick/darwin"/>
206 </move>
207 <delete dir="compiled/ext/imagemagick"/>-->
208
209 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
210 <exec executable="svn">
211 <arg value="export"/>
212 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
213 <arg value="compiled/gs2build/bin/darwin/imagemagick"/>
214 </exec>
215
216 <if><bool><not><equals arg1="${forward.install.flax}" arg2="true"/></not></bool>
217 <!-- grab ghostscript binaries -->
218 <delete dir="compiled/gs2build/bin/darwin/ghostscript"/>
219 <exec executable="svn">
220 <arg value="export"/>
221 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
222 <arg value="compiled/gs2build/bin/darwin/ghostscript"/>
223 </exec>
224 </if>
225 </if></else></if>
226
227 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
228 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
229 <arg line="-S"/>
230 <arg line="gs2build/bin/script/import.pl -removeold -site localsite lucene-jdbm-demo"/>
231 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
232 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
233 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
234 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
235 <env key="GSDLOS" value="windows"/>
236 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
237 </exec>
238 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
239 <arg line="-S"/>
240 <arg line="gs2build/bin/script/buildcol.pl -removeold -site localsite lucene-jdbm-demo"/>
241 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
242 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
243 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
244 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
245 <env key="GSDLOS" value="windows"/>
246 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
247 </exec>
248 <delete dir="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
249 <move file="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building" tofile="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
250 <else>
251 <echo file="${basedir}/compiled/buildscript.sh">
252 #!/bin/bash
253 source gs3-setup.sh
254 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/import.pl -site localsite lucene-jdbm-demo
255 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/buildcol.pl -site localsite lucene-jdbm-demo
256 rm -rf ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
257 mv ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
258 </echo>
259 <chmod perm="775" file="${basedir}/compiled/buildscript.sh"/>
260 <exec dir="${basedir}/compiled" executable="/bin/bash">
261 <arg line="buildscript.sh"/>
262 </exec>
263 <delete file="${basedir}/compiled/buildscript.sh"/>
264 </else>
265 </if>
266
267 </target>
268
269</project>
Note: See TracBrowser for help on using the repository browser.