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

Last change on this file since 27769 was 27769, checked in by davidb, 8 years ago

Adjustment to ant files that copy in the XML-Parser files necessary for specific version of Perl (for linux). Perl 5.14 added

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