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

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

move indexers into source dir for a distribution, and make sure platform specific sh files are executable

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