source: greenstone3/trunk/dist-resources/dist-build.xml@ 14825

Last change on this file since 14825 was 14603, checked in by oranfry, 15 years ago

don't include the greenstone2 collections in the distribution

  • Property svn:keywords set to Author Date Id Revision
File size: 15.8 KB
Line 
1<?xml version="1.0"?>
2
3<!-- ======================================================================
4 March 2005
5
6 Greenstone3 build and install script
7
8 kjdon
9 ====================================================================== -->
10<project name="greenstone3-distribution" default="usage" basedir="..">
11
12 <!-- include standard build file -->
13 <import file="../build.xml"/>
14
15 <property name="documented.collections.home" value="/home/nzdl/for-distributions/collect"/>
16 <property name="greenstone3-change-date" value="Tue Feb 20 12:13:42 NZDT 2007"/>
17 <property name="gs2build-change-date" value="Wed Dec 13 10:35:57 NZDT 2006"/>
18
19 <!-- ====================== DISTRIBUTION Targets ========================= -->
20
21 <!-- these two, do we need tomcat and axis for compilation??-->
22 <!-- Create the binaries for windows distribution -->
23 <target name="prepare-windows" depends="init">
24 <antcall target="checkout-gs2build"/>
25 <antcall target="unzip-windows-packages"/>
26 <antcall target="unzip-windows-packages"/>
27 <antcall target="checkout-winbin"/>
28 <antcall target="get-perl-for-windows"/>
29 </target>
30
31 <target name="build-windows" depends="init">
32
33 <antcall target="svnupdate-distribution"/>
34 <antcall target="update-winbin"/>
35 <antcall target="get-windows-binaries"/>
36 <antcall target="rename-gs2build-files-windows"/>
37 <antcall target="compile-gs2build"/>
38 <antcall target="compile-packages"/>
39
40 </target>
41
42 <!-- Create the binaries for Unix/Mac distributions -->
43 <target name="prepare-unix" depends="init">
44 <antcall target="checkout-gs2build"/>
45 <antcall target="checkout-gli"/>
46 </target>
47
48 <target name="update-unix" depends="init">
49 <antcall target="svnupdate-distribution"/>
50 <antcall target="rename-gs2build-files-unix"/>
51 <antcall target="delete-windows-files"/>
52 </target>
53
54 <target name="configure-unix" depends="init">
55 <antcall target="configure-c++"/>
56 </target>
57 <target name="build-unix" depends="init">
58 <antcall target="compile-packages"/>
59 <antcall target="compile-gs2build"/>
60 </target>
61
62 <!-- creates the base distribution. Needs binaries copied in to it from other
63 greenstones (prepare-os targets) -->
64 <target name="create-distribution-1" depends="init" description="do all the initial downloading and setting up">
65 <antcall target="checkout-gs2build"/>
66 <antcall target="checkout-gli"/>
67 <delete file="${gli.home}/gli.bat"/>
68 <delete file="${gli.home}/gli.sh"/>
69 <delete file="${gli.home}/gems.bat"/>
70 <delete file="${gli.home}/gems.sh"/>
71 <antcall target="rename-gs2build-files-dist"/>
72 <delete dir="${gs2build-extra.home}"/>
73
74 <!--<antcall target="unzip-windows-packages"/> do we need this?-->
75 <antcall target="prepare-tomcat"/>
76 <delete file="${packages.home}/apache-tomcat-5.5.12.zip"/>
77 <delete file="${packages.home}/apache-tomcat-5.5.12-compat.zip"/>
78 <antcall target="prepare-axis"/>
79 <delete file="${packages.home}/axis-bin-1_2_1.zip"/>
80 <!-- delete old axis dir -->
81 <delete dir="${packages.home}/axis"/>
82 <mkdir dir="${web.home}/applet"/>
83 <mkdir dir="${web.home}/logs"/>
84 <antcall target="prepare-ant"/>
85 <delete file="${packages.home}/apache-ant-1.7.0-bin.zip"/>
86 <antcall target="prepare-collections"/>
87
88 <!-- get good XML-Parser - does this work? -->
89 <antcall target="get-xml-parser"/>
90 <!-- documented collections -->
91 <antcall target="get-documented-collections"/>
92
93 <delete file="${basedir}/README-CVS.txt"/>
94 <delete file="${basedir}/TODO.txt"/>
95
96 <!-- make the extra directories needed for a release -->
97 <mkdir dir="${basedir}/Linux/lib/jni"/>
98 <mkdir dir="${basedir}/Darwin/lib/jni"/>
99 <mkdir dir="${basedir}/Windows/lib/jni"/>
100 <mkdir dir="${gs2build.home}/Unix/bin/linux"/>
101 <mkdir dir="${gs2build.home}/Unix/bin/darwin"/>
102 <mkdir dir="${gs2build.home}/Windows/bin/windows"/>
103 <mkdir dir="${gs2build.home}/source/Windows"/>
104 <mkdir dir="${gs2build.home}/source/Unix"/>
105
106 </target>
107
108 <target name="create-distribution-2" description="do all the compilation">
109 <!-- compile the java stuff -->
110 <antcall target="compile-web"/>
111 <antcall target="configure-packages-and-indexers"/>
112 <antcall target="compile-packages-and-indexers-javaonly"/>
113 <antcall target="distclean-packages"/>
114 <antcall target="compile-core"/>
115 <antcall target="compile-gli"/>
116 </target>
117
118 <target name="create-distribution-3" depends="init" description="Do the rearranging of source code etc">
119
120 <!-- move top-level os dependent files -->
121 <copy todir="${basedir}/Linux">
122 <fileset dir="${basedir}">
123 <include name="*.sh"/>
124 </fileset>
125 </copy>
126 <chmod dir="${basedir}/Linux" perm="ugo+rx"
127 includes="*.sh"/>
128 <move todir="${basedir}/Darwin">
129 <fileset dir="${basedir}">
130 <include name="*.sh"/>
131 </fileset>
132 </move>
133 <chmod dir="${basedir}/Darwin" perm="ugo+rx"
134 includes="*.sh"/>
135 <move todir="${basedir}/Windows">
136 <fileset dir="${basedir}">
137 <include name="*.bat"/>
138 </fileset>
139 </move>
140
141 <!-- rearrange collection building stuff -->
142 <move file="${gs2build.home}/win32.mak" tofile="${gs2build.home}/source/Windows/win32.mak"/>
143 <move file="${gs2build.home}/setup.bat" tofile="${gs2build.home}/source/Windows/setup.bat"/>
144 <move file="${gs2build.home}/WIN32cfg.h" tofile="${gs2build.home}/source/Windows/WIN32cfg.h"/>
145 <move todir="${gs2build.home}/source/Unix/">
146 <fileset dir="${gs2build.home}">
147 <include name="config*"/>
148 <include name="ac*"/>
149 <include name="install-sh"/>
150 <include name="setup.bash"/>
151 <include name="Makefile.in"/>
152 </fileset>
153 </move>
154 <!-- general source files -->
155 <move todir="${gs2build.home}/source/src" failonerror="false">
156 <fileset dir="${gs2build.home}/src" defaultexcludes="no"/>
157 </move>
158 <move todir="${gs2build.home}/source/lib" failonerror="false">
159 <fileset dir="${gs2build.home}/lib" defaultexcludes="no"/>
160 </move>
161 <move todir="${gs2build.home}/source/packages" failonerror="false">
162 <fileset dir="${gs2build.home}/packages" defaultexcludes="no"/>
163 </move>
164 <move todir="${gs2build.home}/source/indexers" failonerror="false">
165 <fileset dir="${gs2build.home}/indexers" defaultexcludes="no"/>
166 </move>
167
168 <!-- generate modified build.xml file -->
169 <antcall target="run-xslt-binary"/>
170
171 <!-- clean up -->
172 <delete dir="${basedir}/build"/>
173 <delete dir="${basedir}/lib/jni"/>
174 <delete file="${basedir}/gli/client-gli.sh"/>
175 <delete file="${basedir}/gli/client-gli.bat"/>
176 </target>
177
178
179 <target name="create-source-distribution" depends="init">
180 <antcall target="checkout-gs2build"/>
181 <antcall target="checkout-gli"/>
182 <delete file="${gli.home}/gli.bat"/>
183 <delete file="${gli.home}/gli.sh"/>
184 <antcall target="rename-gs2build-files-dist"/>
185 <delete dir="${gs2build-extra.home}"/>
186 <antcall target="prepare-tomcat"/>
187 <delete file="${packages.home}/apache-tomcat-5.5.12.zip"/>
188 <delete file="${packages.home}/apache-tomcat-5.5.12-compat.zip"/>
189 <antcall target="prepare-ant"/>
190 <delete file="${packages.home}/apache-ant-1.7.0-bin.zip"/>
191 <antcall target="prepare-collections"/>
192 <antcall target="prepare-axis"/>
193 <delete file="${packages.home}/axis-bin-1_2_1.zip"/>
194 <!-- delete old axis dir -->
195 <delete dir="${packages.home}/axis"/>
196 <mkdir dir="${web.home}/applet"/>
197 <mkdir dir="${web.home}/logs"/>
198
199 <!-- download the mac XML parser just in case: it will only be unpacked if on a mac -->
200 <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz"
201 dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
202 usetimestamp="true"/>
203
204 <!-- generate modified build.xml file -->
205 <antcall target="run-xslt-source"/>
206 <!--<delete dir="${basedir}/dist-resources"/>-->
207
208 </target>
209
210 <!-- Supplementary targets -->
211
212 <target name="svnupdate-distribution" depends="init">
213 <antcall target="svnupdate-packages"/>
214 <antcall target="svnupdate-core"/>
215 <antcall target="svnupdate-gs2build"/>
216 <antcall target="svnupdate-web"/>
217 </target>
218
219 <target name="run-xslt-source" depends="init">
220 <xslt in="${basedir}/build.xml" out="${basedir}/dist-build.xml" style="${basedir}/dist-resources/convert-build-xml-source.xsl"/>
221 </target>
222
223 <target name="run-xslt-binary" depends="init">
224 <xslt in="${basedir}/build.xml" out="${basedir}/dist-build.xml" style="${basedir}/dist-resources/convert-build-xml.xsl"/>
225 </target>
226
227 <target name="rename-gs2build-files-dist" depends="init,rename-gs2build-files-unix">
228 <copy file="${gs2build-extra.home}/lib.win32.mak" tofile="${gs2build.home}/lib/win32.mak"/>
229 <copy file="${gs2build-extra.home}/win32.mak" tofile="${gs2build.home}/win32.mak"/>
230 <copy file="${gs2build-extra.home}/setup.bat" tofile="${gs2build.home}/setup.bat"/>
231 </target>
232
233 <target name="configure-packages-and-indexers" depends="init">
234 <exec executable="${indexers.home}/configure"
235 dir="${indexers.home}">
236 <arg value="--prefix=${basedir}"/>
237 <arg value="--libdir=${lib.jni}"/>
238 </exec>
239 <exec executable="${javagdbm.home}/configure"
240 dir="${javagdbm.home}">
241 <arg value="--prefix=${basedir}"/>
242 <arg value="--libdir=${lib.jni}"/>
243 </exec>
244
245 </target>
246
247 <target name="compile-packages-and-indexers-javaonly" depends="init">
248 <echo>Compiling Indexers</echo>
249 <exec executable="make" os="${os.unix}"
250 dir="${indexers.home}">
251 <arg value="javaonly"/>
252 </exec>
253 <exec executable="make" os="${os.unix}"
254 dir="${indexers.home}">
255 <arg value="install-javaonly"/>
256 </exec>
257 <!-- install the jar files -->
258 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
259 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
260 <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/>
261
262 <!-- javagdbm -->
263 <exec executable="make" os="${os.unix}"
264 dir="${javagdbm.home}">
265 <arg value="javaonly"/>
266 </exec>
267 <exec executable="make" os="${os.unix}"
268 dir="${javagdbm.home}">
269 <arg value="installjava"/>
270 </exec>
271 <!-- install the jar file -->
272 <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
273
274 </target>
275
276 <target name="delete-windows-files" depends="init" unless="current.os.iswindows">
277 <delete dir="${basedir}/winutil"/>
278 <delete>
279 <fileset dir="${lib.jni}" includes="*.dll"/>
280 </delete>
281 </target>
282
283 <target name="get-perl-for-windows" depends="init" if="current.os.iswindows">
284 <mkdir dir="${gs2build.home}/bin/windows"/>
285 <get src="http://www.greenstone.org/gs3files/perl-for-windows.zip"
286 dest="${gs2build.home}/bin/windows/perl-for-windows.zip"
287 usetimestamp="true"/>
288 <unzip src="${gs2build.home}/bin/windows/perl-for-windows.zip"
289 dest="${gs2build.home}/bin/windows"/>
290 <delete file="${gs2build.home}/bin/windows/perl-for-windows.zip"/>
291 </target>
292
293 <target name="distclean-packages" depends="init">
294 <!-- indexers : just call the make target -->
295 <exec executable="make" os="${os.unix}"
296 dir="${indexers.home}">
297 <arg value="distclean"/>
298 </exec>
299 <!-- javagdbm -->
300 <exec executable="make" os="${os.unix}"
301 dir="${javagdbm.home}">
302 <arg value="distclean"/>
303 </exec>
304 </target>
305
306 <!-- copy the doc eg colls from /home/nzdl - note we don't include the formatting ones -->
307 <target name="get-documented-collections" depends="init">
308 <property name="collect.home" value="${basedir}/web/sites/localsite/collect"/>
309
310<!-- <copy todir="${collect.home}/authen-e">
311 <fileset dir="${documented.collections.home}/authen-e"/>
312 </copy>
313 <copy todir="${collect.home}/bibliog1">
314 <fileset dir="${documented.collections.home}/bibliog1"/>
315 </copy>
316 <copy todir="${collect.home}/bibliogr">
317 <fileset dir="${documented.collections.home}/bibliogr"/>
318 </copy>
319 <copy todir="${collect.home}/dls-e">
320 <fileset dir="${documented.collections.home}/dls-e"/>
321 </copy>
322 <copy todir="${collect.home}/dspace-e">
323 <fileset dir="${documented.collections.home}/dspace-e"/>
324 </copy>
325 <copy todir="${collect.home}/gsarch-e">
326 <fileset dir="${documented.collections.home}/gsarch-e"/>
327 </copy>
328 <copy todir="${collect.home}/image-e">
329 <fileset dir="${documented.collections.home}/image-e"/>
330 </copy>
331 <copy todir="${collect.home}/isis-e">
332 <fileset dir="${documented.collections.home}/isis-e"/>
333 </copy>
334 <copy todir="${collect.home}/oai-e">
335 <fileset dir="${documented.collections.home}/oai-e"/>
336 </copy>
337 <copy todir="${collect.home}/pagedimg-e">
338 <fileset dir="${documented.collections.home}/pagedimg-e"/>
339 </copy>
340 <copy todir="${collect.home}/wrdpdf-e">
341 <fileset dir="${documented.collections.home}/wrdpdf-e"/>
342 </copy>
343
344 <copy todir="${collect.home}/garish">
345 <fileset dir="${documented.collections.home}/garish"/>
346 </copy>
347 <copy todir="${collect.home}/marcexam">
348 <fileset dir="${documented.collections.home}/marcexam"/>
349 </copy>
350 <copy todir="${collect.home}/style-e">
351 <fileset dir="${documented.collections.home}/style-e"/>
352 </copy>
353 <copy todir="${collect.home}/wiki">
354 <fileset dir="${documented.collections.home}/wiki"/>
355 </copy> -->
356 </target>
357
358 <target name="get-xml-parser" depends="init">
359 <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz"
360 dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
361 usetimestamp="true"/>
362 <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
363 dest="${gs2build.home}/perllib/cpan/"
364 compression="gzip"/>
365 <delete file="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"/>
366 </target>
367
368<!-- <target name="create-changelog"> -->
369 <!-- generate greenstone 3 changelog -->
370<!-- <exec executable="/home/nzdl/for-distributions/bin/script/cvs2cl.pl"
371 dir="${basedir}">
372 <arg value="-P"/>
373 <arg value="-F"/>
374 <arg value="trunk"/>
375 <arg value="-r"/>
376 <arg value="-S"/>
377 <arg value="-l"/>
378 <arg value="-d'${greenstone3-change-date}&lt;tomorrow'"/>
379 <arg value="-f"/>
380 <arg value="greenstone-${app.version}-ChangeLog.txt"/>
381 <arg value="-I"/>
382 <arg value="gli/.*|gs2build/.*"/>
383 </exec> -->
384 <!-- generate coll building change log -->
385<!-- <exec executable="/home/nzdl/for-distributions/bin/script/cvs2cl.pl"
386 dir="${basedir}">
387 <arg value="-P"/>
388 <arg value="-F"/>
389 <arg value="trunk"/>
390 <arg value="-r"/>
391 <arg value="-S"/>
392 <arg value="-l"/>
393 <arg value="-d'${gs2build-change-date}&lt;tomorrow'"/>
394 <arg value="-f"/>
395 <arg value="greenstone-${app.version}-ChangeLog-collbuilding.txt"/>
396 <arg value="gli"/>
397 <arg value="gs2build"/>
398 </exec>
399 </target> -->
400
401
402 <!-- new targets to go in distribution build.xml files -->
403
404 <!-- new usage target for binary release -->
405 <target name="usage-for-binary-dist" description="Print a help message">
406 <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
407 <echo message=" Execute 'ant -help' for Ant help."/>
408 </target>
409
410
411 <!-- new install target for source distribution -->
412 <target name="install-for-source-dist" depends="init" description="install the source distribution. Includes configuring and compiling">
413 <antcall target="unzip-windows-packages"/>
414 <!-- do the java version dependent stuff -->
415 <antcall target="configure-java-version"/>
416 <antcall target="install-macos-extra"/>
417 <!-- set gsdlhome in setup.bat -->
418 <antcall target="gs2build-edit-setup-bat"/>
419 <antcall target="install-indexer-files"/>
420 <antcall target="configure"/>
421 <antcall target="configure-c++"/>
422 <antcall target="compile"/>
423 <!-- make sure we have execute permission for the .sh files -->
424 <chmod dir="${basedir}" perm="ugo+rx"
425 includes="*.sh"/>
426
427 </target>
428
429</project>
430
431
Note: See TracBrowser for help on using the repository browser.