root/release-kits/wirk2/ant-scripts/operations-on-gs3home.xml @ 18847

Revision 18847, 10.6 KB (checked in by oranfry, 11 years ago)

deleting traces of links to /home/nzdl, having installer create gsdlsite.cfg, changes to cdrk2

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="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="checkout-gli"/>
26        <antcall target="unzip-windows-packages"/>
27        <antcall target="unzip-windows-packages"/>
28        <antcall target="checkout-winbin"/>
29        <antcall target="get-perl-for-windows"/>
30    </target>
31 
32    <target name="build-windows" depends="init">
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    </target>
40
41   
42    <target name="create-distribution-1" depends="init" description="do all the initial downloading and setting up">
43       
44        <antcall target="checkout-gs2build"/>
45        <antcall target="checkout-gli"/>
46        <!--<delete file="${gli.home}/gli.bat"/>-->
47        <delete file="${gli.home}/gli.sh"/>
48        <delete file="${gli.home}/gems.bat"/>
49        <delete file="${gli.home}/gems.sh"/>
50        <antcall target="rename-gs2build-files-dist"/>   
51        <delete dir="${gs2build-extra.home}"/>
52
53        <!-- <antcall target="unzip-windows-packages"/> do we need this? -->
54        <antcall target="prepare-tomcat"/>
55        <antcall target="prepare-axis"/>
56       
57       
58        <!-- delete old axis dir -->
59        <delete dir="${packages.home}/axis"/>
60        <mkdir dir="${web.home}/applet"/>
61        <mkdir dir="${web.home}/logs"/>
62        <antcall target="prepare-ant"/>
63        <antcall target="prepare-collections"/>
64
65        <!-- get good XML-Parser - does this work? -->
66        <antcall target="get-xml-parser"/>
67       
68        <delete>
69            <fileset dir="${packages.home}" includes="*.zip"/>
70        </delete>
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 file="${basedir}/gli/client-gli.sh"/>
119        <delete file="${basedir}/gli/client-gli.bat"/>
120
121        <delete>
122            <fileset dir="${gs2build.home}">
123                <include name="config*"/>
124                <include name="ac*"/>
125                <include name="install-sh"/>
126                <include name="setup.bash"/>
127                <include name="Makefile.in"/>
128            </fileset>
129        </delete>
130
131        <!-- generate modified build.xml file -->
132        <antcall target="run-xslt-binary"/>
133
134       
135    </target>
136
137    <!-- Supplementary targets -->
138    <target name="svnupdate-distribution" depends="init">
139        <antcall target="svnupdate-packages"/>
140        <antcall target="svnupdate-core"/>
141        <antcall target="svnupdate-gs2build"/>
142        <antcall target="svnupdate-web"/>
143    </target>
144
145    <target name="run-xslt-source" depends="init">
146        <xslt in="${basedir}/build.xml" out="${basedir}/dist-build.xml" style="${basedir}/dist-resources/convert-build-xml-source.xsl"/>
147    </target>
148 
149    <target name="run-xslt-binary" depends="init">
150        <xslt in="${basedir}/build.xml" out="${basedir}/modified-build.xml" style="${wirk3.home}/xsl/convert-build-xml.xsl"/>
151    </target>
152 
153    <target name="rename-gs2build-files-dist" depends="init">
154        <mkdir dir="${gs2build.home}/gs2build-extra/lib"/>
155        <copy file="${gs2build.home}/gs2build-extra/lib.win32.mak" tofile="${gs2build.home}/lib/win32.mak"/>
156        <copy file="${gs2build.home}/gs2build-extra/win32.mak" tofile="${gs2build.home}/win32.mak"/>
157        <copy file="${gs2build.home}/gs2build-extra/setup.bat" tofile="${gs2build.home}/setup.bat"/>
158    </target>   
159
160    <target name="compile-packages-and-indexers-javaonly" depends="init">
161        <echo>Getting Indexer Jars</echo>
162        <!-- install the jar files -->
163        <copy file="${basedir}/../../greenstone3/gs2build/indexers/mg/mg.jar" todir="${lib.jni}"/>
164        <copy file="${basedir}/../../greenstone3/gs2build/indexers/mgpp/mgpp.jar" todir="${lib.jni}"/>
165        <copy file="${basedir}/../../greenstone3/gs2build/indexers/lucene-gs/LuceneWrapper.jar" todir="${web.lib}"/>
166        <!-- javagdbm -->
167        <!-- install the jar file -->
168        <copy file="${basedir}/../../greenstone3/src/packages/javagdbm/javagdbm.jar" todir="${lib.jni}"/>
169    </target>
170
171    <target name="delete-windows-files" depends="init" unless="current.os.iswindows">
172        <delete dir="${basedir}/winutil"/>
173        <delete>
174            <fileset dir="${lib.jni}" includes="*.dll"/>
175        </delete>
176    </target>
177
178    <target name="get-perl-for-windows" depends="init" if="current.os.iswindows">
179        <mkdir dir="${gs2build.home}/bin/windows"/>
180        <get src="http://www.greenstone.org/gs3files/perl-for-windows.zip" dest="${gs2build.home}/bin/windows/perl-for-windows.zip" usetimestamp="true"/>
181        <unzip src="${gs2build.home}/bin/windows/perl-for-windows.zip" dest="${gs2build.home}/bin/windows"/>
182        <delete file="${gs2build.home}/bin/windows/perl-for-windows.zip"/>
183    </target>
184
185    <!-- copy the doc eg colls from /home/nzdl - note we don't include the formatting ones -->
186    <target name="get-documented-collections" depends="init">
187        <property name="collect.home" value="${basedir}/web/sites/localsite/collect"/>
188
189        <!--    <copy todir="${collect.home}/authen-e">
190          <fileset dir="${documented.collections.home}/authen-e"/>
191        </copy>
192        <copy todir="${collect.home}/bibliog1">
193          <fileset dir="${documented.collections.home}/bibliog1"/>
194        </copy>
195        <copy todir="${collect.home}/bibliogr">
196          <fileset dir="${documented.collections.home}/bibliogr"/>
197        </copy>
198        <copy todir="${collect.home}/dls-e">
199          <fileset dir="${documented.collections.home}/dls-e"/>
200        </copy>
201        <copy todir="${collect.home}/dspace-e">
202          <fileset dir="${documented.collections.home}/dspace-e"/>
203        </copy>
204        <copy todir="${collect.home}/gsarch-e">
205          <fileset dir="${documented.collections.home}/gsarch-e"/>
206        </copy>
207        <copy todir="${collect.home}/image-e">
208          <fileset dir="${documented.collections.home}/image-e"/>
209        </copy>
210        <copy todir="${collect.home}/isis-e">
211          <fileset dir="${documented.collections.home}/isis-e"/>
212        </copy>
213        <copy todir="${collect.home}/oai-e">
214          <fileset dir="${documented.collections.home}/oai-e"/>
215        </copy>
216        <copy todir="${collect.home}/pagedimg-e">
217          <fileset dir="${documented.collections.home}/pagedimg-e"/>
218        </copy>
219        <copy todir="${collect.home}/wrdpdf-e">
220          <fileset dir="${documented.collections.home}/wrdpdf-e"/>
221        </copy>
222
223        <copy todir="${collect.home}/garish">
224          <fileset dir="${documented.collections.home}/garish"/>
225        </copy>
226        <copy todir="${collect.home}/marcexam">
227          <fileset dir="${documented.collections.home}/marcexam"/>
228        </copy>
229        <copy todir="${collect.home}/style-e">
230          <fileset dir="${documented.collections.home}/style-e"/>
231        </copy>
232        <copy todir="${collect.home}/wiki">
233          <fileset dir="${documented.collections.home}/wiki"/>
234        </copy> -->
235    </target>
236
237    <target name="get-xml-parser" depends="init">
238        <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz" dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz" usetimestamp="true"/>
239        <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz" dest="${gs2build.home}/perllib/cpan/" compression="gzip"/>
240        <delete file="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"/>
241    </target>
242
243    <!-- new targets to go in distribution build.xml files -->
244
245    <!-- new usage target for binary release -->
246    <target name="usage-for-binary-dist" description="Print a help message">
247        <echo message="  Execute 'ant -projecthelp' for a list of targets."/>
248        <echo message="  Execute 'ant -help' for Ant help."/>
249    </target>
250   
251    <!-- new install target for source distribution -->
252    <target name="install-for-source-dist" depends="init" description="install the source distribution. Includes configuring and compiling">
253        <antcall target="unzip-windows-packages"/>
254        <!-- do the java version dependent stuff -->
255        <antcall target="configure-java-version"/>
256        <antcall target="install-macos-extra"/>
257        <!-- set gsdlhome in setup.bat -->
258        <antcall target="gs2build-edit-setup-bat"/>
259        <antcall target="install-indexer-files"/>
260        <antcall target="configure"/>
261        <antcall target="configure-c++"/>
262        <antcall target="compile"/>
263        <!-- make sure we have execute permission for the .sh files -->
264        <chmod dir="${basedir}" perm="ugo+rx" includes="*.sh"/>
265    </target>
266   
267</project>
268 
Note: See TracBrowser for help on using the browser.