source: trunk/gsdl3/dist-resources/dist-build.xml@ 13924

Last change on this file since 13924 was 13924, checked in by kjdon, 17 years ago

download-tomcattarget now prepare-tomcat target

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