source: release-kits/cdrk2/ant-scripts/build.xml@ 19900

Last change on this file since 19900 was 19900, checked in by oranfry, 15 years ago

final set of changes to cdrk2 which made it into 2.82cd release

File size: 13.0 KB
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="../core/ant-scripts/init.xml"/>
22 <import file="../greenstone2/ant-scripts/rk2-targets.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 <svn>
64 <checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="documentation/shared"/>
65 </svn>
66 <javac srcdir="documentation/shared" destdir="documentation/shared" debug="on">
67 <include name="*.java"/>
68 </javac>
69
70 </target>
71
72 <target name="build-tutorials">
73
74 <svn>
75 <checkout url="${svn.root}/documentation/${branch.path}/tutorials" destPath="documentation/tutorials"/>
76 <checkout url="${svn.root}/gli/${branch.path}" destPath="documentation/gli"/>
77 <checkout url="${svn.root}/gsdl/${branch.path}/perllib" destPath="documentation/perllib"/>
78 <checkout url="${svn.root}/gsdl/${branch.path}/macros" destPath="documentation/macros"/>
79 <checkout url="${svn.root}/documentation/${branch.path}/tutorial_sample_files" destPath="documentation/tutorial_sample_files"/>
80 </svn>
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 <svn>
116 <checkout url="${svn.root}/documentation/${branch.path}/manuals" destPath="documentation/manuals"/>
117 <checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="documentation/shared"/>
118 <checkout url="${svn.root}/gli/${branch.path}" destPath="documentation/gli"/>
119 </svn>
120 <unzip src="documentation/shared/fop.zip" dest="documentation/shared"/>
121 <chmod perm="a+x" file="documentation/shared/fop/fop.sh"/>
122
123 <antcall target="generate-gli-chapter"><param name="language" value="en"/></antcall>
124 <antcall target="generate-gli-chapter"><param name="language" value="fr"/></antcall>
125 <antcall target="generate-gli-chapter"><param name="language" value="es"/></antcall>
126 <antcall target="generate-gli-chapter"><param name="language" value="ru"/></antcall>
127
128 <delete dir="documentation/manuals/build"/>
129 <exec dir="documentation/manuals" executable="/bin/bash">
130 <arg value="generate-pdf.sh"/>
131 <arg value="all"/>
132 <arg value="en es ru fr"/>
133 </exec>
134
135 <exec spawn="true" dir="documentation/manuals" executable="/bin/bash">
136 <arg value="generate-pdf.sh"/>
137 <arg value="Install"/>
138 <arg value="ar"/>
139 </exec>
140
141 <delete dir="cdrom/Documentation"/>
142 <copy todir="cdrom/Documentation/English"><fileset dir="documentation/manuals/build/en/pdf"/></copy>
143 <copy todir="cdrom/Documentation/French"><fileset dir="documentation/manuals/build/fr/pdf"/></copy>
144 <copy todir="cdrom/Documentation/Spanish"><fileset dir="documentation/manuals/build/es/pdf"/></copy>
145 <copy todir="cdrom/Documentation/Russian"><fileset dir="documentation/manuals/build/ru/pdf"/></copy>
146 <copy todir="cdrom/Documentation/Arabic"><fileset dir="documentation/manuals/build/ar/pdf"/></copy>
147
148 <!-- top it off with a few more -->
149 <get src="http://wiki.greenstone.org/wiki/gsdoc/others/CDS-ISIS_to_DL.pdf" dest="cdrom/Documentation/English/CDS-ISIS_to_DL.pdf"/>
150 <get src="http://www.greenstone.org/docs/inside_greenstone.pdf" dest="cdrom/Documentation/English/inside_greenstone.pdf"/>
151
152 <get src="http://www.greenstone.org/manuals/gsdl2/ar/pdf/Users_Guide_Arabic.doc" dest="cdrom/Documentation/Arabic/Users_Guide_Arabic.doc"/>
153 <get src="http://www.greenstone.org/manuals/gsdl2/ar/pdf/Install_ar.pdf" dest="cdrom/Documentation/Arabic/Install_ar.pdf"/>
154
155 <mkdir dir="cdrom/Documentation/Brazilian Portuguese"/>
156 <get src="http://www.greenstone.org/manuals/gsdl2/pt-br/pdf/Install_pt-br.pdf" dest="cdrom/Documentation/Brazilian Portuguese/Install_pt-br.pdf"/>
157
158 <mkdir dir="cdrom/Documentation/Vietnamese"/>
159 <get src="http://prdownloads.sourceforge.net/greenstone/Install-2.39-vi.pdf" dest="cdrom/Documentation/Vietnamese/Install-2.39-vi.pdf"/>
160 <get src="http://prdownloads.sourceforge.net/greenstone/User-2.39-vi.pdf" dest="cdrom/Documentation/Vietnamese/User-2.39-vi.pdf"/>
161 <get src="http://prdownloads.sourceforge.net/greenstone/Paper-2.39-vi.pdf" dest="cdrom/Documentation/Vietnamese/Paper-2.39-vi.pdf"/>
162
163 <mkdir dir="cdrom/Documentation/Kazakh"/>
164 <get src="http://prdownloads.sourceforge.net/greenstone/Install-2.39-kz.pdf" dest="cdrom/Documentation/Kazakh/Install-2.39-kz.pdf"/>
165 <get src="http://prdownloads.sourceforge.net/greenstone/User-2.39-kz.pdf" dest="cdrom/Documentation/Kazakh/User-2.39-kz.pdf"/>
166 <get src="http://prdownloads.sourceforge.net/greenstone/Paper-2.39-kz.pdf" dest="cdrom/Documentation/Kazakh/Paper-2.39-kz.pdf"/>
167
168
169 </target>
170
171 <target name="insert-documented-examples">
172 <antcall target="download-documented-examples"/>
173 <antcall target="untar-documented-examples"/>
174 </target>
175
176 <target name="download-documented-examples">
177 <!-- download the documented examples -->
178 <mkdir dir="archives"/>
179 <get src="${software.archive.documented-examples}" dest="archives/documented-examples.tar.gz"/>
180 </target>
181
182 <target name="untar-documented-examples">
183 <!-- create Document Examples folder -->
184 <!-- insert the documented examples -->
185 <delete dir="cdrom/Documented Examples"/>
186 <copy toDir="cdrom">
187 <fileset dir="${cdrk2.home}/resources">
188 <include name="Documented Examples/**/*"/>
189 <include name="Documented Examples"/>
190 </fileset>
191 </copy>
192 <exec executable="tar" dir="cdrom/Documented Examples"><arg value="-xzf"/><arg value="../../archives/documented-examples.tar.gz"/></exec>
193 </target>
194
195
196 <target name="generate-gli-chapter">
197 <path id="documentation.compile.classpath">
198 <fileset dir="documentation">
199 <include name="**/*.jar"/>
200 </fileset>
201 <pathelement path="documentation/gli/classes"/>
202 <pathelement path="documentation/shared"/>
203 <pathelement path="documentation/manuals"/>
204 </path>
205 <java classname="ApplyXSLT" classpathref="documentation.compile.classpath" output="documentation/manuals/xml-source/${language}/help-${language}.xml">
206 <arg value="${language}" />
207 <arg value="documentation/manuals/processing/gen-gli-help-to-manual-chapter.xsl" />
208 <arg value="documentation/gli/help/${language}/help.xml" />
209 <arg value="compiled" />
210 </java>
211 <copy file="documentation/manuals/xml-source/${language}/help-${language}.xml" todir="documentation/manuals"/>
212 </target>
213
214 <target name="insert-readmes">
215 <copy todir="cdrom"><fileset dir="${rk.home}/greenstone2/docs"/></copy>
216 <antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${basedir}/cdrom"/></antcall>
217 </target>
218
219 <target name="insert-software">
220 <antcall target="insert-software-linux"/>
221 <antcall target="insert-software-windows"/>
222 <antcall target="insert-software-mac"/>
223 </target>
224
225 <target name="insert-software-linux">
226 <mkdir dir="cdrom"/>
227 <mkdir dir="archives"/>
228 <get src="${software.archive.linux}" dest="archives/linux.tar.gz"/>
229 <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/linux.tar.gz"/></exec>
230 </target>
231
232 <target name="insert-software-windows">
233 <mkdir dir="cdrom"/>
234 <mkdir dir="archives"/>
235 <get src="${software.archive.windows}" dest="archives/windows.tar.gz"/>
236 <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/windows.tar.gz"/></exec>
237 </target>
238
239 <target name="insert-software-mac">
240 <mkdir dir="cdrom"/>
241 <mkdir dir="archives"/>
242 <get src="${software.archive.mac}" dest="archives/mac.tar.gz"/>
243 <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/mac.tar.gz"/></exec>
244 </target>
245
246 <target name="create-autorun">
247 <exec executable="cp">
248 <arg value="${cdrk2.home}/resources/AUTORUN.INF"/>
249 <arg value="cdrom"/>
250 </exec>
251 </target>
252
253 <target name="create-image">
254
255 <mkdir dir="products"/>
256
257 <exec executable="mkisofs">
258 <arg value="-V"/>
259 <arg value="Greenstone-${version}"/>
260 <arg value="-input-charset"/>
261 <arg value="utf-8"/>
262 <arg value="-o"/>
263 <arg value="products/Greenstone-${version}-cdrom.iso"/>
264 <arg value="-J"/>
265 <arg value="-R"/>
266 <arg value="-D"/>
267 <arg value="cdrom"/>
268 </exec>
269
270 <exec executable="/bin/bash" dir="products">
271 <arg value="-c"/>
272 <arg value="cat Greenstone-${version}-cdrom.iso | gzip > Greenstone-${version}-cdrom.iso.gz"/>
273 </exec>
274
275 <exec executable="/bin/bash" dir="products">
276 <arg value="-c"/>
277 <arg value="zip Greenstone-${version}-cdrom.zip Greenstone-${version}-cdrom.iso"/>
278 </exec>
279
280 </target>
281
282</project>
Note: See TracBrowser for help on using the repository browser.