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

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

updated for new indexers repository. haven't tested yet

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