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

Last change on this file since 13503 was 13503, checked in by kjdon, 16 years ago

fixed a bug

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