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

Last change on this file since 13855 was 13855, checked in by kjdon, 15 years ago

removed some old windows-c++ stuff - if you want to compile on windows, you now need to have visual studio. main compile for windows does all the c++ stuff as well as java.

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