root/main/trunk/release-kits/kits/cdrk2/ant-scripts/build.xml @ 21649

Revision 21649, 13.4 KB (checked in by oranfry, 11 years ago)

change all uses of svnant to execs of system svn

Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<!--
3        ..........................................................
4        March 2009
5        CD Release Kit for Greenstone2 (cdrk2)
6        Oran Fry
7        ..........................................................
8-->
9
10<project name="cdrk2-build" default="cdrk2">
11
12    <!-- CONSTANTS -->
13
14    <!-- for the benefit of the shared scripts, set release-kit home -->
15    <property name="rk.name" value="cdrk2"/>
16    <property name="rk.home" value="${cdrk2.home}" />
17    <property name="rk.os" value="multi" />
18    <property name="os.suffix" value="AnyPlatform"/>
19   
20    <!-- IMPORT OTHER ANT SCRIPTS -->
21    <import file="${rk.home}/shared/core/ant-scripts/shared.xml"/>
22    <import file="${rk.home}/shared/greenstone2/ant-scripts/greenstone2-shared.xml"/>
23
24    <!-- figure out where the compiled software is coming from -->
25    <property name="software.archive.linux"                     value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-linux.tar.gz"/>
26    <property name="software.archive.windows"                   value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-windows.tar.gz"/>
27    <property name="software.archive.mac"                       value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-mac.tar.gz"/>
28    <property name="software.archive.documented-examples"       value="http://www.greenstone.org/caveat-emptor/Greenstone-documented-examples-${version}-candidate-${date}.tar.gz"/>
29
30    <target name="cdrk2-init">
31        <echo message="software.archive.linux:                    ${software.archive.linux}"/>
32        <echo message="software.archive.windows:                  ${software.archive.windows}"/>
33        <echo message="software.archive.mac:                      ${software.archive.mac}"/>
34        <echo message="software.archive.documented-examples:      ${software.archive.documented-examples}"/>
35    </target>
36
37
38    <!-- THE MAIN TARGET -->
39    <target name="cdrk2" depends="init,cdrk2-init">
40        <antcall target="checkout-and-compile-documentation"/>
41        <antcall target="build-tutorials"/>
42        <antcall target="build-documentation"/>
43        <antcall target="insert-documented-examples"/>
44        <antcall target="insert-readmes"/>
45        <antcall target="insert-software"/>
46        <antcall target="create-autorun"/>
47        <antcall target="create-image"/>
48    </target>
49
50    <target name="properties">
51        <echo>Required Properties:</echo>
52        <echo>version                                     the version string for the release</echo>
53        <echo/>
54        <echo>Optional Properties:</echo>
55        <echo>software.archive.linux                      the URL to the linux archive of components</echo>
56        <echo>software.archive.windows                    the URL to the windows archive of components</echo>
57        <echo>software.archive.mac                        the URL to the mac archive of components</echo>
58        <echo>software.archive.documented-examples        the URL to the archive of documented examples</echo>
59        <echo/>
60    </target>
61
62    <target name="checkout-and-compile-documentation">
63        <exec executable="svn">
64            <arg value="export"/>
65            <arg value="${svn.root}/documentation/${branch.path}/shared"/>
66            <arg value="documentation/shared"/>
67        </exec>
68        <javac srcdir="documentation/shared" destdir="" debug="on">
69            <include name="*.java"/>
70        </javac>
71
72    </target>
73
74    <target name="build-tutorials">
75
76        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/documentation/${branch.path}/tutorials"/><arg value="documentation/tutorials"/></exec>
77        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/main/${branch.path}/gli"/><arg value="documentation/gli"/></exec>
78        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/main/${branch.path}/greenstone2/perllib"/><arg value="documentation/perllib"/></exec>
79        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/main/${branch.path}/greenstone2/macros"/><arg value="documentation/macros"/></exec>
80        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/documentation/${branch.path}/tutorial_sample_files"/><arg value="documentation/tutorial_sample_files"/></exec>
81
82        <delete dir="documentation/tutorials/html"/>
83        <exec dir="documentation/tutorials" executable="/bin/bash">
84            <arg value="generate-html.sh"/>
85            <env key="GSDLHOME" value="${basedir}/documentation"/>
86        </exec>
87
88        <delete dir="cdrom/Tutorial Exercises"/>
89        <mkdir dir="cdrom/Tutorial Exercises/sample_files"/>
90
91        <!-- tutorial html -->
92        <copy todir="cdrom/Tutorial Exercises/English"><fileset dir="documentation/tutorials/html/en"/></copy>
93        <copy todir="cdrom/Tutorial Exercises/French"><fileset dir="documentation/tutorials/html/fr"/></copy>
94        <copy todir="cdrom/Tutorial Exercises/Spanish"><fileset dir="documentation/tutorials/html/es"/></copy>
95        <copy todir="cdrom/Tutorial Exercises/Russian"><fileset dir="documentation/tutorials/html/ru"/></copy>
96
97        <!-- sample files -->
98        <zip destfile="cdrom/Tutorial Exercises/sample_files/beatles.zip" basedir="documentation/tutorial_sample_files/beatles"/>
99        <zip destfile="cdrom/Tutorial Exercises/sample_files/custom.zip" basedir="documentation/tutorial_sample_files/custom"/>
100        <zip destfile="cdrom/Tutorial Exercises/sample_files/demo_NewFiles.zip" basedir="documentation/tutorial_sample_files/demo_NewFiles"/>
101        <zip destfile="cdrom/Tutorial Exercises/sample_files/dspace.zip" basedir="documentation/tutorial_sample_files/dspace"/>
102        <zip destfile="cdrom/Tutorial Exercises/sample_files/images.zip" basedir="documentation/tutorial_sample_files/images"/>
103        <zip destfile="cdrom/Tutorial Exercises/sample_files/isis.zip" basedir="documentation/tutorial_sample_files/isis"/>
104        <zip destfile="cdrom/Tutorial Exercises/sample_files/marc.zip" basedir="documentation/tutorial_sample_files/marc"/>
105        <zip destfile="cdrom/Tutorial Exercises/sample_files/niupepa.zip" basedir="documentation/tutorial_sample_files/niupepa"/>
106        <zip destfile="cdrom/Tutorial Exercises/sample_files/oai.zip" basedir="documentation/tutorial_sample_files/oai"/>
107        <zip destfile="cdrom/Tutorial Exercises/sample_files/simple_html.zip" basedir="documentation/tutorial_sample_files/simple_html"/>
108        <zip destfile="cdrom/Tutorial Exercises/sample_files/tudor.zip" basedir="documentation/tutorial_sample_files/tudor"/>
109        <zip destfile="cdrom/Tutorial Exercises/sample_files/Word_and_PDF.zip" basedir="documentation/tutorial_sample_files/Word_and_PDF"/>
110
111    </target>
112
113    <target name="build-documentation">
114       
115        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/documentation/${branch.path}/manuals"/><arg value="documentation/manuals"/></exec>
116        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/documentation/${branch.path}/shared"/><arg value="documentation/shared"/></exec>
117        <exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/main/${branch.path}/gli"/><arg value="documentation/gli"/></exec>
118
119        <unzip src="documentation/shared/fop.zip" dest="documentation/shared"/>
120        <chmod perm="a+x" file="documentation/shared/fop/fop.sh"/>
121
122        <antcall target="generate-gli-chapter"><param name="language" value="en"/></antcall>
123        <antcall target="generate-gli-chapter"><param name="language" value="fr"/></antcall>
124        <antcall target="generate-gli-chapter"><param name="language" value="es"/></antcall>
125        <antcall target="generate-gli-chapter"><param name="language" value="ru"/></antcall>
126
127        <delete dir="documentation/manuals/build"/>
128        <exec dir="documentation/manuals" executable="/bin/bash">
129            <arg value="generate-pdf.sh"/>
130            <arg value="all"/>
131            <arg value="en es ru fr"/>
132        </exec>
133
134        <exec spawn="true" dir="documentation/manuals" executable="/bin/bash">
135            <arg value="generate-pdf.sh"/>
136            <arg value="Install"/>
137            <arg value="ar"/>
138        </exec>
139
140        <delete dir="cdrom/Documentation"/>
141        <copy todir="cdrom/Documentation/English"><fileset dir="documentation/manuals/build/en/pdf"/></copy>
142        <copy todir="cdrom/Documentation/French"><fileset dir="documentation/manuals/build/fr/pdf"/></copy>
143        <copy todir="cdrom/Documentation/Spanish"><fileset dir="documentation/manuals/build/es/pdf"/></copy>
144        <copy todir="cdrom/Documentation/Russian"><fileset dir="documentation/manuals/build/ru/pdf"/></copy>
145        <copy todir="cdrom/Documentation/Arabic"><fileset dir="documentation/manuals/build/ar/pdf"/></copy>
146
147        <!-- top it off with a few more -->
148        <get src="http://wiki.greenstone.org/wiki/gsdoc/others/CDS-ISIS_to_DL.pdf" dest="cdrom/Documentation/English/CDS-ISIS_to_DL.pdf"/>
149        <get src="http://www.greenstone.org/docs/inside_greenstone.pdf" dest="cdrom/Documentation/English/inside_greenstone.pdf"/>
150
151        <get src="http://www.greenstone.org/manuals/gsdl2/ar/pdf/Users_Guide_Arabic.doc" dest="cdrom/Documentation/Arabic/Users_Guide_Arabic.doc"/>
152        <get src="http://www.greenstone.org/manuals/gsdl2/ar/pdf/Install_ar.pdf" dest="cdrom/Documentation/Arabic/Install_ar.pdf"/>
153
154        <mkdir dir="cdrom/Documentation/Brazilian Portuguese"/>
155        <get src="http://www.greenstone.org/manuals/gsdl2/pt-br/pdf/Install_pt-br.pdf" dest="cdrom/Documentation/Brazilian Portuguese/Install_pt-br.pdf"/>
156
157        <mkdir dir="cdrom/Documentation/Vietnamese"/>
158        <get src="http://prdownloads.sourceforge.net/greenstone/Install-2.39-vi.pdf" dest="cdrom/Documentation/Vietnamese/Install-2.39-vi.pdf"/>
159        <get src="http://prdownloads.sourceforge.net/greenstone/User-2.39-vi.pdf" dest="cdrom/Documentation/Vietnamese/User-2.39-vi.pdf"/>
160        <get src="http://prdownloads.sourceforge.net/greenstone/Paper-2.39-vi.pdf" dest="cdrom/Documentation/Vietnamese/Paper-2.39-vi.pdf"/>
161
162        <mkdir dir="cdrom/Documentation/Kazakh"/>
163        <get src="http://prdownloads.sourceforge.net/greenstone/Install-2.39-kz.pdf" dest="cdrom/Documentation/Kazakh/Install-2.39-kz.pdf"/>
164        <get src="http://prdownloads.sourceforge.net/greenstone/User-2.39-kz.pdf" dest="cdrom/Documentation/Kazakh/User-2.39-kz.pdf"/>
165        <get src="http://prdownloads.sourceforge.net/greenstone/Paper-2.39-kz.pdf" dest="cdrom/Documentation/Kazakh/Paper-2.39-kz.pdf"/>
166
167
168    </target>
169
170    <target name="insert-documented-examples">
171        <antcall target="download-documented-examples"/>
172        <antcall target="untar-documented-examples"/>
173    </target>
174
175    <target name="download-documented-examples">
176        <!-- download the documented examples -->
177        <mkdir dir="archives"/>
178        <get src="${software.archive.documented-examples}" dest="archives/documented-examples.tar.gz"/>
179    </target>
180
181    <target name="untar-documented-examples">
182        <!-- create Document Examples folder -->
183        <!-- insert the documented examples -->
184        <delete dir="cdrom/Documented Examples"/>
185        <copy toDir="cdrom">
186            <fileset dir="${cdrk2.home}/resources">
187                <include name="Documented Examples/**/*"/>
188                <include name="Documented Examples"/>
189            </fileset>
190        </copy>
191        <exec executable="tar" dir="cdrom/Documented Examples"><arg value="-xzf"/><arg value="../../archives/documented-examples.tar.gz"/></exec>
192    </target>
193
194
195    <target name="generate-gli-chapter">
196        <path id="documentation.compile.classpath">
197            <fileset dir="documentation">
198                <include name="**/*.jar"/>
199            </fileset>
200            <pathelement path="documentation/gli/classes"/>
201            <pathelement path="documentation/shared"/>
202            <pathelement path="documentation/manuals"/>
203        </path>
204        <java classname="ApplyXSLT" classpathref="documentation.compile.classpath" output="documentation/manuals/xml-source/${language}/help-${language}.xml">
205            <arg value="${language}" />
206            <arg value="documentation/manuals/processing/gen-gli-help-to-manual-chapter.xsl" />
207            <arg value="documentation/gli/help/${language}/help.xml" />
208            <arg value="compiled" />
209        </java>
210        <copy file="documentation/manuals/xml-source/${language}/help-${language}.xml" todir="documentation/manuals"/>
211    </target>
212
213    <target name="insert-readmes">
214        <copy todir="cdrom"><fileset dir="${rk.home}/greenstone2/docs"/></copy>
215        <antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${basedir}/cdrom"/></antcall>
216    </target>
217
218    <target name="insert-software">
219        <antcall target="insert-software-linux"/>
220        <antcall target="insert-software-windows"/>
221        <antcall target="insert-software-mac"/>
222    </target>
223
224    <target name="insert-software-linux">
225        <mkdir dir="cdrom"/>
226        <mkdir dir="archives"/>
227        <get src="${software.archive.linux}" dest="archives/linux.tar.gz"/>
228        <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/linux.tar.gz"/></exec>
229    </target>
230
231    <target name="insert-software-windows">
232        <mkdir dir="cdrom"/>
233        <mkdir dir="archives"/>
234        <get src="${software.archive.windows}" dest="archives/windows.tar.gz"/>
235        <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/windows.tar.gz"/></exec>
236    </target>
237
238    <target name="insert-software-mac">
239        <mkdir dir="cdrom"/>
240        <mkdir dir="archives"/>
241        <get src="${software.archive.mac}" dest="archives/mac.tar.gz"/>
242        <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/mac.tar.gz"/></exec>
243    </target>
244
245    <target name="create-autorun">
246        <exec executable="cp">
247            <arg value="${cdrk2.home}/resources/AUTORUN.INF"/>
248            <arg value="cdrom"/>
249        </exec>
250    </target>
251
252    <target name="create-image">
253
254        <mkdir dir="products"/>
255
256        <exec executable="mkisofs">
257            <arg value="-V"/>
258            <arg value="Greenstone-${version}"/>
259            <arg value="-input-charset"/>
260            <arg value="utf-8"/>
261            <arg value="-o"/>
262            <arg value="products/Greenstone-${version}-cdrom.iso"/>
263            <arg value="-J"/>
264            <arg value="-R"/>
265            <arg value="-D"/>
266            <arg value="cdrom"/>
267        </exec>
268
269        <exec executable="/bin/bash" dir="products">
270            <arg value="-c"/>
271            <arg value="cat Greenstone-${version}-cdrom.iso | gzip > Greenstone-${version}-cdrom.iso.gz"/>
272        </exec>
273
274        <exec executable="/bin/bash" dir="products">
275            <arg value="-c"/>
276            <arg value="zip Greenstone-${version}-cdrom.zip Greenstone-${version}-cdrom.iso"/>
277        </exec>
278
279    </target>
280
281</project>
Note: See TracBrowser for help on using the browser.