source: release-kits/mark3/ant-scripts/operations-on-gs3home.xml@ 18501

Last change on this file since 18501 was 18501, checked in by oranfry, 12 years ago

make sure the build.properties file has been created before trying to modify it

File size: 11.5 KB
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 <!-- Create the binaries for Unix/Mac distributions -->
23 <target name="prepare-unix" depends="init">
24 <antcall target="checkout-gs2build"/>
25 <antcall target="checkout-gli"/>
26 </target>
27
28 <target name="update-unix" depends="init">
29 <antcall target="svnupdate-distribution"/>
30 <antcall target="delete-windows-files"/>
31 </target>
32
33 <target name="configure-unix" depends="init">
34 <antcall target="configure-c++"/>
35 </target>
36 <target name="build-unix" depends="init">
37 <antcall target="compile-packages"/>
38 <antcall target="compile-gs2build"/>
39 </target>
40
41 <!-- creates the base distribution. Needs binaries copied in to it from other greenstones (prepare-os targets) -->
42 <target name="create-distribution-1" depends="init" description="do all the initial downloading and setting up">
43
44 <antcall target="checkout-gs2build"/>
45
46 <delete><fileset dir="." includes="*.bat"/></delete>
47 <delete dir="${gs2build.home}/gs2build-extra"/>
48
49 <antcall target="prepare-tomcat"/>
50 <antcall target="prepare-axis"/>
51
52 <!-- delete old axis dir -->
53 <delete dir="${packages.home}/axis"/>
54 <mkdir dir="${web.home}/applet"/>
55 <mkdir dir="${web.home}/logs"/>
56 <antcall target="prepare-ant"/>
57 <antcall target="prepare-collections"/>
58
59 <!-- get good XML-Parser - does this work? -->
60 <antcall target="get-xml-parser"/>
61
62 <delete>
63 <fileset dir="${packages.home}" includes="*.zip"/>
64 </delete>
65
66
67 <!-- documented collections -->
68 <antcall target="get-documented-collections"/>
69
70 <delete file="${basedir}/README-CVS.txt"/>
71 <delete file="${basedir}/TODO.txt"/>
72
73 </target>
74
75 <target name="create-distribution-2" description="do all the compilation">
76
77 <!-- compile the java stuff -->
78 <antcall target="compile-web"/>
79 <antcall target="configure-tomcat"/>
80 <antcall target="configure-packages-and-indexers"/>
81 <antcall target="compile-packages-and-indexers-javaonly"/>
82 <antcall target="distclean-packages"/>
83 <antcall target="compile-core"/>
84 <antcall target="compile-gli"/>
85
86 </target>
87
88 <target name="create-distribution-3" depends="init" description="Do the rearranging of source code and others">
89
90 <!-- delete some source files -->
91 <delete dir="${gs2build.home}/source/src"/>
92 <delete dir="${gs2build.home}/source/lib"/>
93 <delete dir="${gs2build.home}/source/packages"/>
94 <delete dir="${gs2build.home}/source/indexers"/>
95
96 <!-- generate modified build.xml file -->
97 <antcall target="run-xslt-binary"/>
98
99 <!-- clean up -->
100 <delete><fileset dir="${basedir}" includes="*.bat"/></delete>
101 <delete><fileset dir="${basedir}/gli" includes="*.bat"/></delete>
102 <delete><fileset dir="${basedir}/gs2build" includes="*.bat"/></delete>
103 <delete><fileset dir="${basedir}/bin/script" includes="*.bat"/></delete>
104
105 <delete dir="${basedir}/build"/>
106 <delete dir="${basedir}/lib/jni"/>
107 <delete dir="${basedir}/winutil"/>
108 <delete dir="${basedir}/dist-resources"/>
109 <delete dir="${basedir}/gs2build/source"/>
110
111 <delete file="${basedir}/gs2build/win32cfg.h"/>
112 <delete file="${basedir}/gs2build/win32.mak"/>
113
114 </target>
115
116 <!-- Supplementary targets -->
117
118 <target name="svnupdate-distribution" depends="init">
119 <antcall target="svnupdate-packages"/>
120 <antcall target="svnupdate-core"/>
121 <antcall target="svnupdate-gs2build"/>
122 <antcall target="svnupdate-web"/>
123 </target>
124
125 <target name="run-xslt-binary" depends="init">
126 <xslt in="${basedir}/build.xml" out="${basedir}/modified-build.xml" style="${mark3.home}/greenstone3/xsl/convert-build-xml.xsl"/>
127 </target>
128
129 <target name="run-xslt-source" depends="init">
130 <xslt in="${basedir}/build.xml" out="${basedir}/modified-build.xml" style="${mark3.home}/greenstone3/xsl/convert-build-xml-source.xsl"/>
131 </target>
132
133 <target name="configure-packages-and-indexers" depends="init">
134 <exec executable="${indexers.home}/configure"
135 dir="${indexers.home}">
136 <arg value="--prefix=${basedir}"/>
137 <arg value="--libdir=${lib.jni}"/>
138 </exec>
139 <exec executable="${javagdbm.home}/configure"
140 dir="${javagdbm.home}">
141 <arg value="--prefix=${basedir}"/>
142 <arg value="--libdir=${lib.jni}"/>
143 </exec>
144
145 </target>
146
147 <target name="compile-packages-and-indexers-javaonly" depends="init">
148 <echo>Compiling Indexers</echo>
149 <exec executable="make" os="${os.unix}"
150 dir="${indexers.home}">
151 <arg value="javaonly"/>
152 </exec>
153 <exec executable="make" os="${os.unix}"
154 dir="${indexers.home}">
155 <arg value="install-javaonly"/>
156 </exec>
157 <!-- install the jar files -->
158 <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
159 <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
160 <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/>
161
162 <!-- javagdbm -->
163 <!-- skip compile, just get compiled jar from /greenstone3 directory
164 <exec executable="make" os="${os.unix}"
165 dir="${javagdbm.home}">
166 <arg value="javaonly"/>
167 </exec>
168 <exec executable="make" os="${os.unix}"
169 dir="${javagdbm.home}">
170 <arg value="installjava"/>
171 </exec>
172 -->
173
174 <!-- install the jar file -->
175 <copy file="../../compiled/src/packages/javagdbm/javagdbm.jar" todir="${lib.jni}"/>
176
177 </target>
178
179 <target name="delete-windows-files" depends="init" unless="current.os.iswindows">
180 <delete dir="${basedir}/winutil"/>
181 <delete>
182 <fileset dir="${lib.jni}" includes="*.dll"/>
183 </delete>
184 </target>
185
186 <target name="get-perl-for-windows" depends="init" if="current.os.iswindows">
187 <mkdir dir="${gs2build.home}/bin/windows"/>
188 <get src="http://www.greenstone.org/gs3files/perl-for-windows.zip"
189 dest="${gs2build.home}/bin/windows/perl-for-windows.zip"
190 usetimestamp="true"/>
191 <unzip src="${gs2build.home}/bin/windows/perl-for-windows.zip"
192 dest="${gs2build.home}/bin/windows"/>
193 <delete file="${gs2build.home}/bin/windows/perl-for-windows.zip"/>
194 </target>
195
196 <target name="distclean-packages" depends="init">
197 <!-- indexers : just call the make target -->
198 <exec executable="make" os="${os.unix}"
199 dir="${indexers.home}">
200 <arg value="distclean"/>
201 </exec>
202 <!-- javagdbm -->
203 <exec executable="make" os="${os.unix}"
204 dir="${javagdbm.home}">
205 <arg value="distclean"/>
206 </exec>
207 </target>
208
209 <!-- copy the doc eg colls from /home/nzdl - note we don't include the formatting ones -->
210 <target name="get-documented-collections" depends="init">
211 <property name="collect.home" value="${basedir}/web/sites/localsite/collect"/>
212
213<!-- <copy todir="${collect.home}/authen-e">
214 <fileset dir="${documented.collections.home}/authen-e"/>
215 </copy>
216 <copy todir="${collect.home}/bibliog1">
217 <fileset dir="${documented.collections.home}/bibliog1"/>
218 </copy>
219 <copy todir="${collect.home}/bibliogr">
220 <fileset dir="${documented.collections.home}/bibliogr"/>
221 </copy>
222 <copy todir="${collect.home}/dls-e">
223 <fileset dir="${documented.collections.home}/dls-e"/>
224 </copy>
225 <copy todir="${collect.home}/dspace-e">
226 <fileset dir="${documented.collections.home}/dspace-e"/>
227 </copy>
228 <copy todir="${collect.home}/gsarch-e">
229 <fileset dir="${documented.collections.home}/gsarch-e"/>
230 </copy>
231 <copy todir="${collect.home}/image-e">
232 <fileset dir="${documented.collections.home}/image-e"/>
233 </copy>
234 <copy todir="${collect.home}/isis-e">
235 <fileset dir="${documented.collections.home}/isis-e"/>
236 </copy>
237 <copy todir="${collect.home}/oai-e">
238 <fileset dir="${documented.collections.home}/oai-e"/>
239 </copy>
240 <copy todir="${collect.home}/pagedimg-e">
241 <fileset dir="${documented.collections.home}/pagedimg-e"/>
242 </copy>
243 <copy todir="${collect.home}/wrdpdf-e">
244 <fileset dir="${documented.collections.home}/wrdpdf-e"/>
245 </copy>
246
247 <copy todir="${collect.home}/garish">
248 <fileset dir="${documented.collections.home}/garish"/>
249 </copy>
250 <copy todir="${collect.home}/marcexam">
251 <fileset dir="${documented.collections.home}/marcexam"/>
252 </copy>
253 <copy todir="${collect.home}/style-e">
254 <fileset dir="${documented.collections.home}/style-e"/>
255 </copy>
256 <copy todir="${collect.home}/wiki">
257 <fileset dir="${documented.collections.home}/wiki"/>
258 </copy> -->
259 </target>
260
261 <target name="get-xml-parser" depends="init">
262 <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz" dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz" usetimestamp="true"/>
263 <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz" dest="${gs2build.home}/perllib/cpan/" compression="gzip"/>
264 <delete file="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"/>
265 </target>
266
267<!-- <target name="create-changelog"> -->
268 <!-- generate greenstone 3 changelog -->
269<!-- <exec executable="/home/nzdl/for-distributions/bin/script/cvs2cl.pl"
270 dir="${basedir}">
271 <arg value="-P"/>
272 <arg value="-F"/>
273 <arg value="trunk"/>
274 <arg value="-r"/>
275 <arg value="-S"/>
276 <arg value="-l"/>
277 <arg value="-d'${greenstone3-change-date}&lt;tomorrow'"/>
278 <arg value="-f"/>
279 <arg value="greenstone-${app.version}-ChangeLog.txt"/>
280 <arg value="-I"/>
281 <arg value="gli/.*|gs2build/.*"/>
282 </exec> -->
283 <!-- generate coll building change log -->
284<!-- <exec executable="/home/nzdl/for-distributions/bin/script/cvs2cl.pl"
285 dir="${basedir}">
286 <arg value="-P"/>
287 <arg value="-F"/>
288 <arg value="trunk"/>
289 <arg value="-r"/>
290 <arg value="-S"/>
291 <arg value="-l"/>
292 <arg value="-d'${gs2build-change-date}&lt;tomorrow'"/>
293 <arg value="-f"/>
294 <arg value="greenstone-${app.version}-ChangeLog-collbuilding.txt"/>
295 <arg value="gli"/>
296 <arg value="gs2build"/>
297 </exec>
298 </target> -->
299
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 <!-- do the java version dependent stuff -->
314 <antcall target="configure-java-version"/>
315 <antcall target="install-macos-extra"/>
316 <!-- set gsdlhome in setup.bat -->
317 <antcall target="gs2build-edit-setup-bat"/>
318 <antcall target="install-indexer-files"/>
319 <antcall target="configure"/>
320 <antcall target="configure-c++"/>
321 <antcall target="compile"/>
322 <!-- make sure we have execute permission for the .sh files -->
323 <chmod dir="${basedir}" perm="ugo+rx"
324 includes="*.sh"/>
325
326 </target>
327
328</project>
329
330
Note: See TracBrowser for help on using the repository browser.