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

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

on installing source distribution, need to make sure .sh files are executable

  • Property svn:keywords set to Author Date Id Revision
File size: 12.7 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"/>
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-extra.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="delete-windows-files" depends="init" unless="current.os.iswindows">
226 <delete dir="${basedir}/winutil"/>
227 <delete>
228 <fileset dir="${lib.jni}" includes="*.dll"/>
229 </delete>
230 </target>
231
232 <target name="get-perl-for-windows" if="current.os.iswindows">
233 <get src="http://www.greenstone.org/gs3files/perl-for-windows.zip"
234 dest="${gs2build.home}/bin/windows/perl-for-windows.zip"
235 usetimestamp="true"/>
236 <unzip src="${gs2build.home}/bin/windows/perl-for-windows.zip"
237 dest="${gs2build.home}/bin/windows"/>
238 <delete file="${gs2build.home}/bin/windows/perl-for-windows.zip"/>
239 </target>
240
241 <target name="distclean-packages" depends="init,clean-packages-c++">
242 <!-- mg : just call the make target -->
243 <exec executable="make" os="${os.unix}"
244 dir="${mg.home}">
245 <arg value="distclean"/>
246 </exec>
247 <!-- mgpp -->
248 <exec executable="make" os="${os.unix}"
249 dir="${mgpp.home}">
250 <arg value="distclean"/>
251 </exec>
252 <!-- javagdbm -->
253 <exec executable="make" os="${os.unix}"
254 dir="${javagdbm.home}">
255 <arg value="distclean"/>
256 </exec>
257 </target>
258
259 <!-- copy the doc eg colls from /home/nzdl - note we don't include the formatting ones -->
260 <target name="get-documented-collections" depends="init">
261 <property name="collect.home" value="${basedir}/web/sites/localsite/collect"/>
262 <copy todir="${collect.home}/MARC-e">
263 <fileset dir="${documented.collections.home}/MARC-e"/>
264 </copy>
265 <copy todir="${collect.home}/cltbib-e">
266 <fileset dir="${documented.collections.home}/cltbib-e"/>
267 </copy>
268 <copy todir="${collect.home}/dls-e">
269 <fileset dir="${documented.collections.home}/dls-e"/>
270 </copy>
271 <copy todir="${collect.home}/dspace-e">
272 <fileset dir="${documented.collections.home}/dspace-e"/>
273 </copy>
274 <copy todir="${collect.home}/gsarch-e">
275 <fileset dir="${documented.collections.home}/gsarch-e"/>
276 </copy>
277 <copy todir="${collect.home}/image-e">
278 <fileset dir="${documented.collections.home}/isis-e"/>
279 </copy>
280 <copy todir="${collect.home}/oai-e">
281 <fileset dir="${documented.collections.home}/oai-e"/>
282 </copy>
283 <copy todir="${collect.home}/pagedimg-e">
284 <fileset dir="${documented.collections.home}/pagedimg-e"/>
285 </copy>
286 <copy todir="${collect.home}/wrdpdf-e">
287 <fileset dir="${documented.collections.home}/wrdpdf-e"/>
288 </copy>
289 </target>
290
291 <target name="get-xml-parser" depends="init">
292 <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz"
293 dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
294 usetimestamp="true"/>
295 <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
296 dest="${gs2build.home}/perllib/cpan/"
297 compression="gzip"/>
298 <delete file="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"/>
299 </target>
300
301 <!-- new targets to go in distribution build.xml files -->
302
303 <!-- new usage target for binary release -->
304 <target name="usage-for-binary-dist" description="Print a help message">
305 <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
306 <echo message=" Execute 'ant -help' for Ant help."/>
307 </target>
308
309
310 <!-- new install target for source distribution -->
311 <target name="install-for-source-dist" depends="init" description="install the source distribution. Includes configuring and compiling">
312 <antcall target="unzip-windows-packages"/>
313 <!-- install tomcat compat package if necessary -->
314 <condition property="need.tomcat.compat">
315 <equals arg1="1.4" arg2="${ant.java.version}"/>
316 </condition>
317 <antcall target="install-tomcat-compat"/>
318 <condition property="need.xml.jars">
319 <equals arg1="1.5" arg2="${ant.java.version}"/>
320 </condition>
321 <antcall target="rename-xml-jars"/>
322 <antcall target="install-macos-extra"/>
323 <!-- set gsdlhome in setup.bat -->
324 <antcall target="gs2build-edit-setup-bat"/>
325 <antcall target="configure"/>
326 <antcall target="configure-c++"/>
327 <antcall target="compile"/>
328 <!-- make sure we have execute permission for the .sh files -->
329 <chmod dir="${basedir}" perm="ugo+rx"
330 includes="*.sh"/>
331
332 </target>
333
334</project>
335
336
Note: See TracBrowser for help on using the repository browser.