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

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

Corrected URLs. Use gnu tar to untar.

File size: 9.1 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/release-snapshots/Greenstone-documented-examples-${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 <!-- THE MAIN TARGET -->
38 <target name="cdrk2" depends="init,cdrk2-init">
39 <antcall target="checkout-and-compile-documentation"/>
40 <antcall target="build-tutorials"/>
41 <antcall target="build-documentation"/>
42 <antcall target="get-documented-examples"/>
43 <antcall target="insert-readmes"/>
44 <antcall target="insert-software"/>
45 <antcall target="create-image"/>
46 </target>
47
48 <target name="properties">
49 <echo>Required Properties:</echo>
50 <echo>version the version string for the release</echo>
51 <echo/>
52 <echo>Optional Properties:</echo>
53 <echo>software.archive.linux the URL to the linux archive of components</echo>
54 <echo>software.archive.windows the URL to the windows archive of components</echo>
55 <echo>software.archive.mac the URL to the mac archive of components</echo>
56 <echo>software.archive.documented-examples the URL to the archive of documented examples</echo>
57 <echo/>
58 </target>
59
60 <target name="checkout-and-compile-documentation">
61 <svn>
62 <checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="documentation/shared"/>
63 </svn>
64 <javac srcdir="documentation/shared" destdir="documentation/shared" debug="on">
65 <include name="*.java"/>
66 </javac>
67
68 </target>
69
70 <target name="build-tutorials">
71 <svn>
72 <checkout url="${svn.root}/documentation/${branch.path}/tutorials" destPath="documentation/tutorials"/>
73 <checkout url="${svn.root}/gli/${branch.path}" destPath="documentation/gli"/>
74 <checkout url="${svn.root}/gsdl/${branch.path}/perllib" destPath="documentation/perllib"/>
75 <checkout url="${svn.root}/gsdl/${branch.path}/macros" destPath="documentation/macros"/>
76 </svn>
77
78 <delete dir="documentation/tutorials/html"/>
79 <exec dir="documentation/tutorials" executable="/bin/bash">
80 <arg value="generate-html.sh"/>
81 <env key="GSDLHOME" value="${basedir}/documentation"/>
82 </exec>
83
84 <delete dir="cdrom/Tutorial Exercises"/>
85 <copy todir="cdrom/Tutorial Exercises/English"><fileset dir="documentation/tutorials/html/en"/></copy>
86 <copy todir="cdrom/Tutorial Exercises/French"><fileset dir="documentation/tutorials/html/fr"/></copy>
87 <copy todir="cdrom/Tutorial Exercises/Spanish"><fileset dir="documentation/tutorials/html/es"/></copy>
88 <copy todir="cdrom/Tutorial Exercises/Russian"><fileset dir="documentation/tutorials/html/ru"/></copy>
89 </target>
90
91 <target name="build-documentation">
92 <svn>
93 <checkout url="${svn.root}/documentation/${branch.path}/manuals" destPath="documentation/manuals"/>
94 <checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="documentation/shared"/>
95 <checkout url="${svn.root}/gli/${branch.path}" destPath="documentation/gli"/>
96 </svn>
97 <unzip src="documentation/shared/fop.zip" dest="documentation/shared"/>
98 <chmod perm="a+x" file="documentation/shared/fop/fop.sh"/>
99
100 <antcall target="generate-gli-chapter"><param name="language" value="en"/></antcall>
101 <antcall target="generate-gli-chapter"><param name="language" value="fr"/></antcall>
102 <antcall target="generate-gli-chapter"><param name="language" value="es"/></antcall>
103 <antcall target="generate-gli-chapter"><param name="language" value="ru"/></antcall>
104
105 <delete dir="documentation/manuals/build"/>
106 <exec dir="documentation/manuals" executable="/bin/bash">
107 <arg value="generate-pdf.sh"/>
108 <arg value="all"/>
109 <arg value="en es ru fr"/>
110 </exec>
111
112 <exec spawn="true" dir="documentation/manuals" executable="/bin/bash">
113 <arg value="generate-pdf.sh"/>
114 <arg value="Install"/>
115 <arg value="ar"/>
116 </exec>
117
118 <delete dir="cdrom/Documentation"/>
119 <copy todir="cdrom/Documentation/English"><fileset dir="documentation/manuals/build/en/pdf"/></copy>
120 <copy todir="cdrom/Documentation/French"><fileset dir="documentation/manuals/build/fr/pdf"/></copy>
121 <copy todir="cdrom/Documentation/Spanish"><fileset dir="documentation/manuals/build/es/pdf"/></copy>
122 <copy todir="cdrom/Documentation/Russian"><fileset dir="documentation/manuals/build/ru/pdf"/></copy>
123 <copy todir="cdrom/Documentation/Arabic"><fileset dir="documentation/manuals/build/ar/pdf"/></copy>
124 </target>
125
126 <target name="get-documented-examples">
127 <!-- create Document Examples folder -->
128 <delete dir="cdrom/Documented Examples"/>
129 <copy toDir="cdrom"><fileset dir="${cdrk2.home}/resources/Documented Examples"/></copy>
130
131 <!-- download and insert the documented examples -->
132 <mkdir dir="archives"/>
133 <get src="${software.archive.documented-examples}" dest="archives/documented-examples.tar.gz"/>
134 <untar src="archives/documented-examples.tar.gz" dest="cdrom/Documented Examples" compression="gzip" overwrite="true"/>
135 </target>
136
137
138 <target name="generate-gli-chapter">
139 <path id="documentation.compile.classpath">
140 <fileset dir="documentation">
141 <include name="**/*.jar"/>
142 </fileset>
143 <pathelement path="documentation/gli/classes"/>
144 <pathelement path="documentation/shared"/>
145 <pathelement path="documentation/manuals"/>
146 </path>
147 <java classname="ApplyXSLT" classpathref="documentation.compile.classpath" output="documentation/manuals/xml-source/${language}/help-${language}.xml">
148 <arg value="documentation/manuals/processing/gen-gli-help-to-manual-chapter.xsl" />
149 <arg value="documentation/gli/help/${language}/help.xml" />
150 <arg value="compiled" />
151 </java>
152 <copy file="documentation/manuals/xml-source/${language}/help-${language}.xml" todir="documentation/manuals"/>
153 </target>
154
155 <target name="insert-readmes">
156 <copy todir="cdrom"><fileset dir="${rk.home}/greenstone2/docs"/></copy>
157 <antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${basedir}/cdrom"/></antcall>
158 </target>
159
160 <target name="insert-software">
161 <antcall target="insert-software-linux"/>
162 <antcall target="insert-software-windows"/>
163 <antcall target="insert-software-mac"/>
164 </target>
165
166 <target name="insert-software-linux">
167 <mkdir dir="cdrom"/>
168 <mkdir dir="archives"/>
169 <get src="${software.archive.linux}" dest="archives/linux.tar.gz"/>
170 <exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/linux.tar.gz"/></exec>
171 <!--<exec executable="chmod" dir="cdrom"><arg value="+x"/><arg value="Greenstone-${version}-linux"/></exec>-->
172 </target>
173
174 <target name="insert-software-windows">
175 <mkdir dir="cdrom"/>
176 <mkdir dir="archives"/>
177 <get src="${software.archive.windows}" dest="archives/windows.tar.gz"/>
178 <untar src="archives/windows.tar.gz" dest="cdrom" compression="gzip" overwrite="true"/>
179 </target>
180
181 <target name="insert-software-mac">
182 <mkdir dir="cdrom"/>
183 <mkdir dir="archives"/>
184 <get src="${software.archive.mac}" dest="archives/mac.tar.gz"/>
185 <untar src="archives/mac.tar.gz" dest="cdrom" compression="gzip" overwrite="true"/>
186 </target>
187
188 <target name="create-image">
189
190 <mkdir dir="products"/>
191
192 <exec executable="mkisofs">
193 <arg value="-input-charset"/>
194 <arg value="utf-8"/>
195 <arg value="-o"/>
196 <arg value="products/Greenstone-${version}-cdrom.iso"/>
197 <arg value="-J"/>
198 <arg value="-R"/>
199 <arg value="-D"/>
200 <arg value="cdrom"/>
201 </exec>
202
203 <exec executable="/bin/bash" dir="products">
204 <arg value="-c"/>
205 <arg value="cat Greenstone-${version}-cdrom.iso | gzip > Greenstone-${version}-cdrom.iso.gz"/>
206 </exec>
207
208 <!--
209 <exec executable="/bin/bash" dir="products">
210 <arg value="-c"/>
211 <arg value="zip Greenstone-${version}-cdrom.zip Greenstone-${version}-cdrom.iso"/>
212 </exec>
213 -->
214
215 </target>
216
217</project>
Note: See TracBrowser for help on using the repository browser.