root/greenstone3/trunk/dist-resources/dist-build.xml @ 14599

Revision 14599, 15.8 KB (checked in by oranfry, 12 years ago)

have the create-distributions script delete the greenstone2 gli-launching scripts as they are not used in greenstone3

  • Property svn:keywords set to Author Date Id Revision
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  <property name="greenstone3-change-date" value="Tue Feb 20 12:13:42 NZDT 2007"/>
17  <property name="gs2build-change-date" value="Wed Dec 13 10:35:57 NZDT 2006"/>
18
19  <!-- ====================== DISTRIBUTION Targets ========================= -->
20 
21  <!-- these two, do we need tomcat and axis for compilation??-->
22  <!-- Create the binaries for windows distribution -->
23  <target name="prepare-windows" depends="init">
24    <antcall target="checkout-gs2build"/>
25    <antcall target="unzip-windows-packages"/>
26    <antcall target="unzip-windows-packages"/>
27    <antcall target="checkout-winbin"/>
28    <antcall target="get-perl-for-windows"/>
29  </target>
30 
31    <target name="build-windows" depends="init">
32
33        <antcall target="svnupdate-distribution"/>
34        <antcall target="update-winbin"/>
35        <antcall target="get-windows-binaries"/>
36        <antcall target="rename-gs2build-files-windows"/>
37        <antcall target="compile-gs2build"/>
38        <antcall target="compile-packages"/>
39
40    </target>
41 
42  <!-- Create the binaries for Unix/Mac distributions -->
43  <target name="prepare-unix" depends="init">
44    <antcall target="checkout-gs2build"/>
45    <antcall target="checkout-gli"/>
46  </target>
47
48  <target name="update-unix" depends="init">
49    <antcall target="svnupdate-distribution"/>
50    <antcall target="rename-gs2build-files-unix"/>
51    <antcall target="delete-windows-files"/>
52  </target>
53 
54  <target name="configure-unix" depends="init">
55    <antcall target="configure-c++"/>
56  </target>   
57  <target name="build-unix" depends="init">
58    <antcall target="compile-packages"/>
59    <antcall target="compile-gs2build"/>
60  </target>
61   
62  <!-- creates the base distribution. Needs binaries copied in to it from other
63    greenstones (prepare-os targets) -->
64  <target name="create-distribution-1" depends="init" description="do all the initial downloading and setting up">
65    <antcall target="checkout-gs2build"/>
66    <antcall target="checkout-gli"/>
67    <delete file="${gli.home}/gli.bat"/>
68    <delete file="${gli.home}/gli.sh"/>
69    <delete file="${gli.home}/gems.bat"/>
70    <delete file="${gli.home}/gems.sh"/>
71    <antcall target="rename-gs2build-files-dist"/>   
72    <delete dir="${gs2build-extra.home}"/>
73   
74    <!--<antcall target="unzip-windows-packages"/> do we need this?-->
75    <antcall target="prepare-tomcat"/>
76    <delete file="${packages.home}/apache-tomcat-5.5.12.zip"/>
77    <delete file="${packages.home}/apache-tomcat-5.5.12-compat.zip"/>
78    <antcall target="prepare-axis"/>
79    <delete file="${packages.home}/axis-bin-1_2_1.zip"/>
80    <!-- delete old axis dir -->
81    <delete dir="${packages.home}/axis"/>
82    <mkdir dir="${web.home}/applet"/>
83    <mkdir dir="${web.home}/logs"/>
84    <antcall target="prepare-ant"/>
85    <delete file="${packages.home}/apache-ant-1.7.0-bin.zip"/>
86    <antcall target="prepare-collections"/>
87
88    <!-- get good XML-Parser - does this work? -->
89    <antcall target="get-xml-parser"/>
90    <!-- documented collections -->
91    <antcall target="get-documented-collections"/>
92
93    <delete file="${basedir}/README-CVS.txt"/>
94    <delete file="${basedir}/TODO.txt"/>
95
96    <!-- make the extra directories needed for a release -->
97    <mkdir dir="${basedir}/Linux/lib/jni"/>
98    <mkdir dir="${basedir}/Darwin/lib/jni"/>
99    <mkdir dir="${basedir}/Windows/lib/jni"/>
100    <mkdir dir="${gs2build.home}/Unix/bin/linux"/>
101    <mkdir dir="${gs2build.home}/Unix/bin/darwin"/>
102    <mkdir dir="${gs2build.home}/Windows/bin/windows"/>
103    <mkdir dir="${gs2build.home}/source/Windows"/>
104    <mkdir dir="${gs2build.home}/source/Unix"/>
105
106  </target>
107
108  <target name="create-distribution-2" description="do all the compilation">
109    <!-- compile the java stuff -->
110    <antcall target="compile-web"/>
111    <antcall target="configure-packages-and-indexers"/>
112    <antcall target="compile-packages-and-indexers-javaonly"/>
113    <antcall target="distclean-packages"/>
114    <antcall target="compile-core"/>
115    <antcall target="compile-gli"/>
116  </target>
117
118  <target name="create-distribution-3" depends="init" description="Do the rearranging of source code etc">
119
120    <!-- move top-level os dependent files -->
121    <copy todir="${basedir}/Linux">
122      <fileset dir="${basedir}">
123    <include name="*.sh"/>
124      </fileset>
125    </copy>
126    <chmod dir="${basedir}/Linux" perm="ugo+rx"
127      includes="*.sh"/>
128    <move todir="${basedir}/Darwin">
129      <fileset dir="${basedir}">
130    <include name="*.sh"/>
131      </fileset>
132    </move>
133    <chmod dir="${basedir}/Darwin" perm="ugo+rx"
134      includes="*.sh"/>
135    <move todir="${basedir}/Windows">
136      <fileset dir="${basedir}">
137    <include name="*.bat"/>
138      </fileset>
139    </move>
140
141    <!-- rearrange collection building stuff -->
142    <move file="${gs2build.home}/win32.mak" tofile="${gs2build.home}/source/Windows/win32.mak"/>
143    <move file="${gs2build.home}/setup.bat" tofile="${gs2build.home}/source/Windows/setup.bat"/>
144    <move file="${gs2build.home}/WIN32cfg.h" tofile="${gs2build.home}/source/Windows/WIN32cfg.h"/>
145    <move todir="${gs2build.home}/source/Unix/">
146      <fileset dir="${gs2build.home}">
147    <include name="config*"/>
148    <include name="ac*"/>
149    <include name="install-sh"/>
150    <include name="setup.bash"/>
151    <include name="Makefile.in"/>
152      </fileset>
153    </move>
154    <!-- general source files -->
155    <move todir="${gs2build.home}/source/src" failonerror="false">
156      <fileset dir="${gs2build.home}/src" defaultexcludes="no"/>
157    </move>
158    <move todir="${gs2build.home}/source/lib" failonerror="false">
159      <fileset dir="${gs2build.home}/lib" defaultexcludes="no"/>
160    </move>
161    <move todir="${gs2build.home}/source/packages" failonerror="false">
162      <fileset dir="${gs2build.home}/packages" defaultexcludes="no"/>
163    </move>
164    <move todir="${gs2build.home}/source/indexers" failonerror="false">
165      <fileset dir="${gs2build.home}/indexers" defaultexcludes="no"/>
166    </move>
167
168    <!-- generate modified build.xml file -->
169    <antcall target="run-xslt-binary"/>
170
171    <!-- clean up -->
172    <delete dir="${basedir}/build"/>
173    <delete dir="${basedir}/lib/jni"/>
174    <delete file="${basedir}/gli/client-gli.sh"/>
175    <delete file="${basedir}/gli/client-gli.bat"/>
176  </target>
177 
178
179  <target name="create-source-distribution" depends="init">
180    <antcall target="checkout-gs2build"/>
181    <antcall target="checkout-gli"/>
182    <delete file="${gli.home}/gli.bat"/>
183    <delete file="${gli.home}/gli.sh"/>
184    <antcall target="rename-gs2build-files-dist"/>
185    <delete dir="${gs2build-extra.home}"/>
186    <antcall target="prepare-tomcat"/>
187    <delete file="${packages.home}/apache-tomcat-5.5.12.zip"/>
188    <delete file="${packages.home}/apache-tomcat-5.5.12-compat.zip"/>
189    <antcall target="prepare-ant"/>
190    <delete file="${packages.home}/apache-ant-1.7.0-bin.zip"/>
191    <antcall target="prepare-collections"/>
192    <antcall target="prepare-axis"/>
193    <delete file="${packages.home}/axis-bin-1_2_1.zip"/>
194    <!-- delete old axis dir -->
195    <delete dir="${packages.home}/axis"/>
196    <mkdir dir="${web.home}/applet"/>
197    <mkdir dir="${web.home}/logs"/>
198
199    <!-- download the mac XML parser just in case: it will only be unpacked if on a mac  -->
200    <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz"
201      dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
202      usetimestamp="true"/>
203
204    <!-- generate modified build.xml file -->
205    <antcall target="run-xslt-source"/>
206    <!--<delete dir="${basedir}/dist-resources"/>-->
207
208  </target>
209
210  <!-- Supplementary targets -->
211
212  <target name="svnupdate-distribution" depends="init">
213    <antcall target="svnupdate-packages"/>
214    <antcall target="svnupdate-core"/>
215    <antcall target="svnupdate-gs2build"/>
216    <antcall target="svnupdate-web"/>
217  </target>
218
219  <target name="run-xslt-source" depends="init">
220    <xslt in="${basedir}/build.xml" out="${basedir}/dist-build.xml" style="${basedir}/dist-resources/convert-build-xml-source.xsl"/>
221  </target>
222 
223  <target name="run-xslt-binary" depends="init">
224    <xslt in="${basedir}/build.xml" out="${basedir}/dist-build.xml" style="${basedir}/dist-resources/convert-build-xml.xsl"/>
225  </target>
226 
227  <target name="rename-gs2build-files-dist" depends="init,rename-gs2build-files-unix">
228    <copy file="${gs2build-extra.home}/lib.win32.mak" tofile="${gs2build.home}/lib/win32.mak"/>
229   <copy file="${gs2build-extra.home}/win32.mak" tofile="${gs2build.home}/win32.mak"/>
230   <copy file="${gs2build-extra.home}/setup.bat" tofile="${gs2build.home}/setup.bat"/>
231  </target>   
232
233  <target name="configure-packages-and-indexers" depends="init">
234    <exec executable="${indexers.home}/configure"
235      dir="${indexers.home}">
236      <arg value="--prefix=${basedir}"/>
237      <arg value="--libdir=${lib.jni}"/>
238    </exec>         
239    <exec executable="${javagdbm.home}/configure"
240      dir="${javagdbm.home}">
241      <arg value="--prefix=${basedir}"/>
242      <arg value="--libdir=${lib.jni}"/>
243    </exec>   
244
245  </target>
246  <target name="compile-packages-and-indexers-javaonly" depends="init">
247    <echo>Compiling Indexers</echo>
248    <exec executable="make" os="${os.unix}"
249       dir="${indexers.home}">
250      <arg value="javaonly"/>
251    </exec>
252    <exec executable="make" os="${os.unix}"
253      dir="${indexers.home}">
254      <arg value="install-javaonly"/>
255    </exec>
256    <!-- install the jar files -->
257    <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
258    <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
259    <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/>
260   
261    <!-- javagdbm -->
262    <exec executable="make" os="${os.unix}"
263      dir="${javagdbm.home}">
264      <arg value="javaonly"/>
265    </exec>
266    <exec executable="make" os="${os.unix}"
267      dir="${javagdbm.home}">
268      <arg value="installjava"/>
269    </exec>
270    <!-- install the jar file -->
271    <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
272
273  </target>
274
275  <target name="delete-windows-files" depends="init" unless="current.os.iswindows">
276    <delete dir="${basedir}/winutil"/>
277    <delete>
278      <fileset dir="${lib.jni}" includes="*.dll"/>
279    </delete>
280  </target>
281
282  <target name="get-perl-for-windows" depends="init" if="current.os.iswindows">
283    <mkdir dir="${gs2build.home}/bin/windows"/>
284    <get src="http://www.greenstone.org/gs3files/perl-for-windows.zip"
285      dest="${gs2build.home}/bin/windows/perl-for-windows.zip"
286      usetimestamp="true"/>
287    <unzip src="${gs2build.home}/bin/windows/perl-for-windows.zip"
288      dest="${gs2build.home}/bin/windows"/>
289    <delete file="${gs2build.home}/bin/windows/perl-for-windows.zip"/>
290  </target>
291
292  <target name="distclean-packages" depends="init">
293    <!-- indexers : just call the make target -->
294    <exec executable="make" os="${os.unix}"
295      dir="${indexers.home}">
296      <arg value="distclean"/>
297    </exec>
298    <!-- javagdbm -->
299    <exec executable="make" os="${os.unix}"
300      dir="${javagdbm.home}">
301      <arg value="distclean"/>
302    </exec>
303  </target>
304
305  <!-- copy the doc eg colls from /home/nzdl - note we don't include the formatting ones -->
306  <target name="get-documented-collections" depends="init">
307    <property name="collect.home" value="${basedir}/web/sites/localsite/collect"/>
308
309    <copy todir="${collect.home}/authen-e">
310      <fileset dir="${documented.collections.home}/authen-e"/>
311    </copy>
312    <copy todir="${collect.home}/bibliog1">
313      <fileset dir="${documented.collections.home}/bibliog1"/>
314    </copy>
315    <copy todir="${collect.home}/bibliogr">
316      <fileset dir="${documented.collections.home}/bibliogr"/>
317    </copy>
318    <copy todir="${collect.home}/dls-e">
319      <fileset dir="${documented.collections.home}/dls-e"/>
320    </copy>
321    <copy todir="${collect.home}/dspace-e">
322      <fileset dir="${documented.collections.home}/dspace-e"/>
323    </copy>
324    <copy todir="${collect.home}/gsarch-e">
325      <fileset dir="${documented.collections.home}/gsarch-e"/>
326    </copy>
327    <copy todir="${collect.home}/image-e">
328      <fileset dir="${documented.collections.home}/image-e"/>
329    </copy>
330    <copy todir="${collect.home}/isis-e">
331      <fileset dir="${documented.collections.home}/isis-e"/>
332    </copy>
333    <copy todir="${collect.home}/oai-e">
334      <fileset dir="${documented.collections.home}/oai-e"/>
335    </copy>
336    <copy todir="${collect.home}/pagedimg-e">
337      <fileset dir="${documented.collections.home}/pagedimg-e"/>
338    </copy>
339    <copy todir="${collect.home}/wrdpdf-e">
340      <fileset dir="${documented.collections.home}/wrdpdf-e"/>
341    </copy>
342
343    <copy todir="${collect.home}/garish">
344      <fileset dir="${documented.collections.home}/garish"/>
345    </copy>
346    <copy todir="${collect.home}/marcexam">
347      <fileset dir="${documented.collections.home}/marcexam"/>
348    </copy>
349    <copy todir="${collect.home}/style-e">
350      <fileset dir="${documented.collections.home}/style-e"/>
351    </copy>
352    <copy todir="${collect.home}/wiki">
353      <fileset dir="${documented.collections.home}/wiki"/>
354    </copy>
355  </target>
356
357  <target name="get-xml-parser" depends="init">
358    <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz"
359      dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
360      usetimestamp="true"/>
361    <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"
362      dest="${gs2build.home}/perllib/cpan/"
363      compression="gzip"/>
364    <delete file="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"/>
365  </target>
366
367<!--  <target name="create-changelog"> -->
368    <!-- generate greenstone 3 changelog -->
369<!--    <exec executable="/home/nzdl/for-distributions/bin/script/cvs2cl.pl"
370      dir="${basedir}">
371      <arg value="-P"/>
372      <arg value="-F"/>
373      <arg value="trunk"/>
374      <arg value="-r"/>
375      <arg value="-S"/>
376      <arg value="-l"/>
377      <arg value="-d'${greenstone3-change-date}&lt;tomorrow'"/>
378      <arg value="-f"/>
379      <arg value="greenstone-${app.version}-ChangeLog.txt"/>
380      <arg value="-I"/>
381      <arg value="gli/.*|gs2build/.*"/>
382    </exec> -->
383    <!-- generate coll building change log -->
384<!--    <exec executable="/home/nzdl/for-distributions/bin/script/cvs2cl.pl"
385      dir="${basedir}">
386      <arg value="-P"/>
387      <arg value="-F"/>
388      <arg value="trunk"/>
389      <arg value="-r"/>
390      <arg value="-S"/>
391      <arg value="-l"/>
392      <arg value="-d'${gs2build-change-date}&lt;tomorrow'"/>
393      <arg value="-f"/>
394      <arg value="greenstone-${app.version}-ChangeLog-collbuilding.txt"/>
395      <arg value="gli"/>
396      <arg value="gs2build"/>
397    </exec>
398  </target> -->
399
400
401  <!-- new targets to go in distribution build.xml files -->
402
403  <!-- new usage target for binary release -->
404  <target name="usage-for-binary-dist" description="Print a help message">
405    <echo message="  Execute 'ant -projecthelp' for a list of targets."/>
406    <echo message="  Execute 'ant -help' for Ant help."/>
407  </target>
408   
409
410  <!-- new install target for source distribution -->
411  <target name="install-for-source-dist" depends="init" description="install the source distribution. Includes configuring and compiling">
412    <antcall target="unzip-windows-packages"/>
413    <!-- do the java version dependent stuff -->
414    <antcall target="configure-java-version"/>
415    <antcall target="install-macos-extra"/>
416    <!-- set gsdlhome in setup.bat -->
417    <antcall target="gs2build-edit-setup-bat"/>
418    <antcall target="install-indexer-files"/>
419    <antcall target="configure"/>
420    <antcall target="configure-c++"/>
421    <antcall target="compile"/>
422    <!-- make sure we have execute permission for the .sh files -->
423    <chmod dir="${basedir}" perm="ugo+rx"
424      includes="*.sh"/>
425
426  </target>
427
428</project>
429 
430
Note: See TracBrowser for help on using the browser.