root/release-kits/wirk3/ant-scripts/operations-on-gs3home.xml @ 16523

Revision 16523, 10.7 KB (checked in by oranfry, 11 years ago)

don't delete client-gli.bat as it works for greenstone3 now

Line 
1<?xml version="1.0"?>
2
3<!-- ======================================================================
4     March 2005                                                   
5
6     Greenstone3 build and install script
7                   
8     kjdon                                                               
9     ====================================================================== -->
10
11<project name="opeations-on-gs3home" default="usage">
12 
13    <!-- include standard build file -->
14    <import file="${basedir}/build.xml"/>
15
16    <property name="documented.collections.home" value="/home/nzdl/for-distributions/collect"/>
17    <property name="greenstone3-change-date" value="Tue Feb 20 12:13:42 NZDT 2007"/>
18    <property name="gs2build-change-date" value="Wed Dec 13 10:35:57 NZDT 2006"/>
19
20    <!-- ====================== DISTRIBUTION Targets ========================= -->
21
22    <!-- these two, do we need tomcat and axis for compilation??-->
23    <!-- Create the binaries for windows distribution -->
24    <target name="prepare-windows" depends="init">
25        <antcall target="checkout-gs2build"/>
26        <antcall target="checkout-gli"/>
27        <antcall target="unzip-windows-packages"/>
28        <antcall target="unzip-windows-packages"/>
29        <antcall target="checkout-winbin"/>
30        <antcall target="get-perl-for-windows"/>
31    </target>
32 
33    <target name="build-windows" depends="init">
34        <antcall target="svnupdate-distribution"/>
35        <antcall target="update-winbin"/>
36        <antcall target="get-windows-binaries"/>
37        <antcall target="rename-gs2build-files-windows"/>
38        <antcall target="compile-gs2build"/>
39        <antcall target="compile-packages"/>
40    </target>
41
42   
43    <target name="create-distribution-1" depends="init" description="do all the initial downloading and setting up">
44       
45        <antcall target="checkout-gs2build"/>
46        <antcall target="checkout-gli"/>
47        <!--<delete file="${gli.home}/gli.bat"/>-->
48        <delete file="${gli.home}/gli.sh"/>
49        <delete file="${gli.home}/gems.bat"/>
50        <delete file="${gli.home}/gems.sh"/>
51        <antcall target="rename-gs2build-files-dist"/>   
52        <delete dir="${gs2build-extra.home}"/>
53
54        <!-- <antcall target="unzip-windows-packages"/> do we need this? -->
55        <antcall target="prepare-tomcat"/>
56        <delete file="${packages.home}/apache-tomcat-5.5.12.zip"/>
57        <delete file="${packages.home}/apache-tomcat-5.5.12-compat.zip"/>
58        <antcall target="prepare-axis"/>
59        <delete file="${packages.home}/axis-bin-1_2_1.zip"/>
60       
61        <!-- delete old axis dir -->
62        <delete dir="${packages.home}/axis"/>
63        <mkdir dir="${web.home}/applet"/>
64        <mkdir dir="${web.home}/logs"/>
65        <antcall target="prepare-ant"/>
66        <delete file="${packages.home}/apache-ant-1.7.0-bin.zip"/>
67        <antcall target="prepare-collections"/>
68
69        <!-- get good XML-Parser - does this work? -->
70        <antcall target="get-xml-parser"/>
71       
72        <!-- documented collections -->
73        <antcall target="get-documented-collections"/>
74
75        <delete file="${basedir}/README-CVS.txt"/>
76        <delete file="${basedir}/TODO.txt"/>
77       
78        <!-- create extra directories necessary the releases -->
79        <mkdir dir="${gs2build.home}/source"/>
80
81        </target>
82
83    <target name="create-distribution-2" description="do all the compilation">
84        <!-- compile the java stuff -->
85        <antcall target="compile-web"/>
86       
87        <!-- we can get this from the main greenstone3 directory
88        <antcall target="compile-packages-and-indexers"/>-->
89        <antcall target="compile-packages-and-indexers-javaonly"/>
90       
91        <antcall target="compile-core"/>
92        <antcall target="compile-gli"/>
93    </target>
94
95    <target name="create-distribution-3" depends="init" description="Do the rearranging of source code etc">
96
97        <!-- put gs2build source code in a tidy place -->
98        <move todir="${gs2build.home}/source/src" failonerror="false"><fileset dir="${gs2build.home}/src" defaultexcludes="no"/></move>
99        <move todir="${gs2build.home}/source/lib" failonerror="false"><fileset dir="${gs2build.home}/lib" defaultexcludes="no"/></move>
100        <move todir="${gs2build.home}/source/packages" failonerror="false"><fileset dir="${gs2build.home}/packages" defaultexcludes="no"/></move>
101        <move todir="${gs2build.home}/source/indexers" failonerror="false"><fileset dir="${gs2build.home}/indexers" defaultexcludes="no"/></move>
102        <move file="${gs2build.home}/win32.mak" tofile="${gs2build.home}/source/win32.mak"/>
103        <!--<move file="${gs2build.home}/setup.bat" tofile="${gs2build.home}/source/setup.bat"/>-->
104        <move file="${gs2build.home}/WIN32cfg.h" tofile="${gs2build.home}/source/WIN32cfg.h"/>
105
106        <!-- clean up -->
107        <delete><fileset dir="${basedir}" includes="**/.svn"/></delete>
108        <delete><fileset dir="${basedir}" includes="*.sh"/></delete>
109        <delete><fileset dir="${basedir}/gli" includes="*.sh"/></delete>
110        <delete><fileset dir="${basedir}/gs2build" includes="*.sh"/></delete>
111        <delete><fileset dir="${basedir}/bin/script" includes="*.sh"/></delete>
112
113        <delete dir="${basedir}/build"/>
114        <delete dir="${basedir}/lib/jni"/>
115        <delete dir="${basedir}/dist-resources"/>
116        <delete dir="${basedir}/gs2build/source"/>
117
118        <delete>
119            <fileset dir="${gs2build.home}">
120                <include name="config*"/>
121                <include name="ac*"/>
122                <include name="install-sh"/>
123                <include name="setup.bash"/>
124                <include name="Makefile.in"/>
125            </fileset>
126        </delete>
127
128        <!-- generate modified build.xml file -->
129        <antcall target="run-xslt-binary"/>
130
131       
132    </target>
133
134    <!-- Supplementary targets -->
135    <target name="svnupdate-distribution" depends="init">
136        <antcall target="svnupdate-packages"/>
137        <antcall target="svnupdate-core"/>
138        <antcall target="svnupdate-gs2build"/>
139        <antcall target="svnupdate-web"/>
140    </target>
141
142    <target name="run-xslt-source" depends="init">
143        <xslt in="${basedir}/build.xml" out="${basedir}/dist-build.xml" style="${basedir}/dist-resources/convert-build-xml-source.xsl"/>
144    </target>
145 
146    <target name="run-xslt-binary" depends="init">
147        <xslt in="${basedir}/build.xml" out="${basedir}/modified-build.xml" style="${wirk3.home}/greenstone3/xsl/convert-build-xml.xsl"/>
148    </target>
149 
150    <target name="rename-gs2build-files-dist" depends="init">
151        <mkdir dir="${gs2build.home}/gs2build-extra/lib"/>
152        <copy file="${gs2build.home}/gs2build-extra/lib.win32.mak" tofile="${gs2build.home}/lib/win32.mak"/>
153        <copy file="${gs2build.home}/gs2build-extra/win32.mak" tofile="${gs2build.home}/win32.mak"/>
154        <copy file="${gs2build.home}/gs2build-extra/setup.bat" tofile="${gs2build.home}/setup.bat"/>
155    </target>   
156
157    <target name="compile-packages-and-indexers-javaonly" depends="init">
158        <echo>Getting Indexer Jars</echo>
159        <!-- install the jar files -->
160        <copy file="${basedir}/../../greenstone3/gs2build/indexers/mg/mg.jar" todir="${lib.jni}"/>
161        <copy file="${basedir}/../../greenstone3/gs2build/indexers/mgpp/mgpp.jar" todir="${lib.jni}"/>
162        <copy file="${basedir}/../../greenstone3/gs2build/indexers/lucene-gs/LuceneWrapper.jar" todir="${web.lib}"/>
163        <!-- javagdbm -->
164        <!-- install the jar file -->
165        <copy file="${basedir}/../../greenstone3/src/packages/javagdbm/javagdbm.jar" todir="${lib.jni}"/>
166    </target>
167
168    <target name="delete-windows-files" depends="init" unless="current.os.iswindows">
169        <delete dir="${basedir}/winutil"/>
170        <delete>
171            <fileset dir="${lib.jni}" includes="*.dll"/>
172        </delete>
173    </target>
174
175    <target name="get-perl-for-windows" depends="init" if="current.os.iswindows">
176        <mkdir dir="${gs2build.home}/bin/windows"/>
177        <get src="http://www.greenstone.org/gs3files/perl-for-windows.zip" dest="${gs2build.home}/bin/windows/perl-for-windows.zip" usetimestamp="true"/>
178        <unzip src="${gs2build.home}/bin/windows/perl-for-windows.zip" dest="${gs2build.home}/bin/windows"/>
179        <delete file="${gs2build.home}/bin/windows/perl-for-windows.zip"/>
180    </target>
181
182    <!-- copy the doc eg colls from /home/nzdl - note we don't include the formatting ones -->
183    <target name="get-documented-collections" depends="init">
184        <property name="collect.home" value="${basedir}/web/sites/localsite/collect"/>
185
186        <!--    <copy todir="${collect.home}/authen-e">
187          <fileset dir="${documented.collections.home}/authen-e"/>
188        </copy>
189        <copy todir="${collect.home}/bibliog1">
190          <fileset dir="${documented.collections.home}/bibliog1"/>
191        </copy>
192        <copy todir="${collect.home}/bibliogr">
193          <fileset dir="${documented.collections.home}/bibliogr"/>
194        </copy>
195        <copy todir="${collect.home}/dls-e">
196          <fileset dir="${documented.collections.home}/dls-e"/>
197        </copy>
198        <copy todir="${collect.home}/dspace-e">
199          <fileset dir="${documented.collections.home}/dspace-e"/>
200        </copy>
201        <copy todir="${collect.home}/gsarch-e">
202          <fileset dir="${documented.collections.home}/gsarch-e"/>
203        </copy>
204        <copy todir="${collect.home}/image-e">
205          <fileset dir="${documented.collections.home}/image-e"/>
206        </copy>
207        <copy todir="${collect.home}/isis-e">
208          <fileset dir="${documented.collections.home}/isis-e"/>
209        </copy>
210        <copy todir="${collect.home}/oai-e">
211          <fileset dir="${documented.collections.home}/oai-e"/>
212        </copy>
213        <copy todir="${collect.home}/pagedimg-e">
214          <fileset dir="${documented.collections.home}/pagedimg-e"/>
215        </copy>
216        <copy todir="${collect.home}/wrdpdf-e">
217          <fileset dir="${documented.collections.home}/wrdpdf-e"/>
218        </copy>
219
220        <copy todir="${collect.home}/garish">
221          <fileset dir="${documented.collections.home}/garish"/>
222        </copy>
223        <copy todir="${collect.home}/marcexam">
224          <fileset dir="${documented.collections.home}/marcexam"/>
225        </copy>
226        <copy todir="${collect.home}/style-e">
227          <fileset dir="${documented.collections.home}/style-e"/>
228        </copy>
229        <copy todir="${collect.home}/wiki">
230          <fileset dir="${documented.collections.home}/wiki"/>
231        </copy> -->
232    </target>
233
234    <target name="get-xml-parser" depends="init">
235        <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz" dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz" usetimestamp="true"/>
236        <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz" dest="${gs2build.home}/perllib/cpan/" compression="gzip"/>
237        <delete file="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"/>
238    </target>
239
240    <!-- new targets to go in distribution build.xml files -->
241
242    <!-- new usage target for binary release -->
243    <target name="usage-for-binary-dist" description="Print a help message">
244        <echo message="  Execute 'ant -projecthelp' for a list of targets."/>
245        <echo message="  Execute 'ant -help' for Ant help."/>
246    </target>
247   
248    <!-- new install target for source distribution -->
249    <target name="install-for-source-dist" depends="init" description="install the source distribution. Includes configuring and compiling">
250        <antcall target="unzip-windows-packages"/>
251        <!-- do the java version dependent stuff -->
252        <antcall target="configure-java-version"/>
253        <antcall target="install-macos-extra"/>
254        <!-- set gsdlhome in setup.bat -->
255        <antcall target="gs2build-edit-setup-bat"/>
256        <antcall target="install-indexer-files"/>
257        <antcall target="configure"/>
258        <antcall target="configure-c++"/>
259        <antcall target="compile"/>
260        <!-- make sure we have execute permission for the .sh files -->
261        <chmod dir="${basedir}" perm="ugo+rx" includes="*.sh"/>
262    </target>
263   
264</project>
265 
Note: See TracBrowser for help on using the browser.