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

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

make the bin/windows dir if needed

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