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

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

need to delete gems.bat/sh wheen creating a distribution cos we use gems4gs3 scripts

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