source: release-kits/shared/core/ant-scripts/init.xml@ 20600

Last change on this file since 20600 was 20600, checked in by oranfry, 13 years ago

moved all instructions within targets in init.xml, so it can be 'imported' without anything being executed

File size: 23.5 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="rk-init">
3
4 <!-- CHECK PRE-CONDITIONS -->
5 <target name="init">
6
7 <!-- load in static properties from build.properties -->
8 <property file="${rk.name}-build.properties" />
9
10 <!-- CONSTANTS (overridable in build.properties) -->
11
12 <!-- svn root -->
13 <property name="svn.root" value="http://svn.greenstone.org" />
14
15 <!-- default revision and branch path -->
16 <property name="branch.path" value="trunk" />
17 <property name="branch.revision" value="HEAD" />
18
19 <!-- the minimum version of java which the installer should be run with (this gets used in search4j) -->
20 <property name="java.min.version" value="1.4.0_00"/>
21
22 <!-- create a localised basedir property -->
23 <path id="basedir.path"><pathelement location="${basedir}"/></path>
24 <property name="basedir.local" refid="basedir.path"/>
25
26 <!-- current date and time -->
27 <tstamp>
28 <format property="current.month" pattern="MMM"/>
29 <format property="current.year" pattern="yyyy"/>
30 <format property="date" pattern="yyyy.MM.dd"/>
31 </tstamp>
32
33 <!-- BUNDLED JAVA INFO -->
34 <!-- the bundled javas are kept in shared/linux/wrapper and shared/windows/wrapper in the repository -->
35 <!-- change this info when the bundled version changes -->
36 <!-- linux -->
37 <property name="linux-java.installer" value="jre_bin"/>
38 <property name="bundled.version.linux-java" value="1.6.0_05"/> <!-- set this to the version number of java in the above archive -->
39 <property name="linux-java.extracted" value="jre"/> <!-- set this to the name of the top level directory in the above archive -->
40 <property name="component.bytesize.linux-java" value="101245987"/> <!-- set this to the size of the extract archive -->
41
42 <!-- windows -->
43 <property name="windows-java.installer" value="jre.exe"/>
44 <property name="bundled.version.windows-java" value="1.6.0_07"/> <!-- set this to the version number of java in the above archive -->
45 <property name="windows-java.extracted" value="jre"/> <!-- set this to the name of the top level directory in the above archive -->
46 <property name="component.bytesize.windows-java" value="75000000"/> <!-- set this to the size of the extract archive -->
47
48 <!-- version numbers of other bundled things -->
49 <property name="bundled.version.imagemagick" value="6.4.3"/>
50 <property name="bundled.version.ghostscript" value="8.63"/>
51 <property name="bundled.version.tomcat" value="6.0.20"/>
52
53 <!-- CLASSPATH -->
54 <path id="project.classpath">
55
56 <!-- our classes -->
57 <fileset dir="${rk.home}/core">
58 <include name="ant-tasks/antelope/AntelopeTasks_3.4.2.jar"/>
59 <include name="ant-tasks/orangevolt/roxes-win32forjava-1.1.1.jar"/>
60 <include name="ant-tasks/orangevolt/orangevolt-ant-tasks-1.3.8.jar"/>
61 <include name="ant-tasks/svnant/lib/ganymed.jar"/>
62 <include name="ant-tasks/svnant/lib/svnClientAdapter.jar"/>
63 <include name="ant-tasks/svnant/lib/svnant.jar"/>
64 <include name="ant-tasks/svnant/lib/svnjavahl.jar"/>
65 <include name="ant-tasks/svnant/lib/svnkit.jar"/>
66 <include name="ant-tasks/greenstone/anttasks.jar"/>
67 <include name="ant-tasks/7z-ant/7z.jar"/>
68 <include name="lib/crypt.jar"/>
69 <include name="lib/serializer.jar"/>
70 <include name="lib/xalan.jar"/>
71 <include name="lib/xercesImpl.jar"/>
72 <include name="lib/xml-apis.jar"/>
73 <include name="ant-installer/lib/ant-installer-ext.jar"/>
74 <include name="ant-installer/lib/ant-installer.jar"/>
75 </fileset>
76
77 </path>
78
79 <!-- SELF DEFINED TASKS AND TYPES -->
80 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
81 <taskdef name="try" classname="ise.antelope.tasks.TryTask" classpathref="project.classpath"/>
82 <taskdef name="math" classname="ise.antelope.tasks.MathTask" classpathref="project.classpath"/>
83 <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>
84 <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
85 <taskdef name="installer" classname="org.tp23.antinstaller.taskdefs.Installer" classpathref="project.classpath"/>
86 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
87 <typedef name="dcff" classname="org.greenstone.anttasks.DeleteChunkFromFile" classpathref="project.classpath"/>
88 <typedef name="rsplit" classname="org.greenstone.anttasks.SplitResource" classpathref="project.classpath"/>
89 <typedef name="get-property-value" classname="org.greenstone.anttasks.GetPropertyValue" classpathref="project.classpath"/>
90
91 <!-- DATES IN DIFFERENT LANGUAGES -->
92 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="ar.Dates.${current.month}" outputProperty="month.ar"/>
93 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="ca.Dates.${current.month}" outputProperty="month.ca"/>
94 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="el.Dates.${current.month}" outputProperty="month.el"/>
95 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="es.Dates.${current.month}" outputProperty="month.es"/>
96 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="fr.Dates.${current.month}" outputProperty="month.fr"/>
97 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="lv.Dates.${current.month}" outputProperty="month.lv"/>
98 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="mr.Dates.${current.month}" outputProperty="month.mr"/>
99 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="ro.Dates.${current.month}" outputProperty="month.ro"/>
100 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="ru.Dates.${current.month}" outputProperty="month.ru"/>
101 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="vi.Dates.${current.month}" outputProperty="month.vi"/>
102 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="zh.Dates.${current.month}" outputProperty="month.zh"/>
103 <get-property-value propertiesFile="${rk.home}/core/lib/dates.properties" propertyName="default.Dates.${current.month}" outputProperty="month.default"/>
104 <!--
105 <echo level="info">Current Date</echo>
106 <echo level="info">ar: ${month.ar} ${current.year}</echo>
107 <echo level="info">ca: ${month.el} ${current.year}</echo>
108 <echo level="info">el: ${month.el} ${current.year}</echo>
109 <echo level="info">es: ${month.es} ${current.year}</echo>
110 <echo level="info">fr: ${month.fr} ${current.year}</echo>
111 <echo level="info">lv: ${month.lv} ${current.year}</echo>
112 <echo level="info">mr: ${month.mr} ${current.year}</echo>
113 <echo level="info">ro: ${month.ro} ${current.year}</echo>
114 <echo level="info">ru: ${month.ru} ${current.year}</echo>
115 <echo level="info">vi: ${month.vi} ${current.year}</echo>
116 <echo level="info">zh: ${month.zh} ${current.year}</echo>
117 <echo level="info">default: (${month.default} ${current.year})</echo>
118 -->
119
120 <!-- version number -->
121 <if>
122 <bool>
123 <not><isset property="version"/></not>
124 </bool>
125 <fail>Version number not set.
126Check that the file '${rk.name}-build.properties' exists and defines property 'version'.</fail>
127 </if>
128 <property name="app.version" value="${version}"/>
129
130 <!-- work out rk.os -->
131 <if>
132 <bool>
133 <or>
134 <equals arg1="${rk.os}" arg2="linux"/>
135 <equals arg1="${rk.os}" arg2="mac"/>
136 <equals arg1="${rk.os}" arg2="windows"/>
137 </or>
138 </bool>
139 <echo>Using user-specified value for rk.os: '${rk.os}'</echo>
140
141 <else><if>
142 <bool><equals arg1="${os.name}" arg2="Linux"/></bool>
143 <property name="rk.os" value="linux"/>
144
145 <else><if>
146 <bool><equals arg1="${os.name}" arg2="Mac OS X"/></bool>
147 <property name="rk.os" value="mac"/>
148
149 <else><if>
150 <bool>
151 <or>
152 <equals arg1="${os.name}" arg2="Windows 95"/>
153 <equals arg1="${os.name}" arg2="Windows 98"/>
154 <equals arg1="${os.name}" arg2="Windows 2000"/>
155 <equals arg1="${os.name}" arg2="Windows XP"/>
156 <equals arg1="${os.name}" arg2="Windows NT"/>
157 <equals arg1="${os.name}" arg2="Windows ME"/>
158 <equals arg1="${os.name}" arg2="Windows Vista"/>
159 </or>
160 </bool>
161 <property name="rk.os" value="windows"/>
162
163 <else>
164 <fail>Can't work out what to set rk.os to. Please report this to greenstone_team@cs.waikato.ac.nz . In the mean time, manually set rk.os to 'windows', 'mac', or 'linux' by reinvoking the release kit with, for example, '-Drk.os=windows'</fail>
165
166 </else></if></else></if></else></if></else></if>
167
168 <!-- set os.suffix -->
169 <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
170 <property name="os.suffix" value="MacOS-intel"/>
171 </if>
172 <property name="os.suffix" value="${rk.os}"/>
173
174 <!-- show important properties -->
175 <echo level="info">Version (version): ${version}</echo>
176 <echo level="info">Branch Path (branch.path): ${branch.path}</echo>
177 <echo level="info">Date (date): ${date}</echo>
178 <echo level="info">Current Month (current.month): ${current.month}</echo>
179 <echo level="info">Current Year (current.year): ${current.year}</echo>
180 <echo level="info">Operating System (rk.os): ${rk.os}</echo>
181 <echo level="info">Operating System Suffix (os.suffix): ${os.suffix}</echo>
182
183 </target>
184
185 <target name="strip-svn-dirs">
186 <delete includeemptydirs="true">
187 <fileset dir="${dir}" defaultexcludes="false">
188 <include name="**/.svn/**" />
189 <include name="**/.svn/" />
190 <include name=".svn/**" />
191 <include name=".svn/" />
192 </fileset>
193 </delete>
194 </target>
195
196 <target name="compile-binary-installer">
197
198 <copy file="installer/antinstall-config.xml" tofile="installer/antinstall-config-binary.xml" overwrite="true"/>
199 <dcff file="installer/antinstall-config-binary.xml" startTag=".*&lt;!-- start cdrom --&gt;.*" endTag=".*&lt;!-- end cdrom --&gt;.*" />
200
201 <copy file="installer/build.xml" tofile="installer/build-binary.xml" overwrite="true"/>
202 <dcff file="installer/build-binary.xml" startTag=".*&lt;!-- start cdrom --&gt;.*" endTag=".*&lt;!-- end cdrom --&gt;.*" />
203
204 <installer file="installer/Greenstone-${version}-${os.suffix}.jar"
205 compress="true"
206 extractType="NonExtractor"
207 installConfig="installer/antinstall-config-binary.xml"
208 buildFile="installer/build-binary.xml"
209 antInstallLib="${rk.home}/core/ant-installer/lib"
210 antLib="${rk.home}/core/ant/lib"
211 validateConfig="true"
212 icons="bluecurve">
213
214 <zipfileset dir="installer/classes" includes="**/*" />
215 <zipfileset dir="components" includes="*.lzma"/>
216
217 </installer>
218
219 </target>
220
221 <target name="compile-cdrom-installer">
222
223 <copy file="installer/antinstall-config.xml" tofile="installer/antinstall-config-cdrom.xml"/>
224 <dcff file="installer/antinstall-config-cdrom.xml" startTag=".*&lt;!-- start web --&gt;.*" endTag=".*&lt;!-- end web --&gt;.*" />
225
226 <copy file="installer/build.xml" tofile="installer/build-cdrom.xml"/>
227 <dcff file="installer/build-cdrom.xml" startTag=".*&lt;!-- start web --&gt;.*" endTag=".*&lt;!-- end web --&gt;.*" />
228
229 <installer file="installer/cdrom.jar"
230 compress="true"
231 extractType="NonExtractor"
232 installConfig="installer/antinstall-config-cdrom.xml"
233 buildFile="installer/build-cdrom.xml"
234 antInstallLib="${rk.home}/core/ant-installer/lib"
235 antLib="${rk.home}/core/ant/lib"
236 validateConfig="true"
237 icons="bluecurve">
238 <zipfileset dir="installer/classes" includes="**/*" />
239 </installer>
240
241 </target>
242
243 <target name="copy-main-installer-files">
244
245 <mkdir dir="${basedir}/installer/classes"/>
246
247 <!-- the language bundle -->
248 <native2ascii
249 implementation="sun"
250 encoding="UTF-8"
251 src="${rk.home}/core/language-strings"
252 dest="${basedir}/installer/classes/resources"/>
253
254 <!-- os- and major version-specific files -->
255 <copy todir="${basedir}/installer/classes" overwrite="true">
256 <fileset dir="${rk.home}/linux/installer-classes" erroronmissingdir="false"/>
257 <fileset dir="${rk.home}/windows/installer-classes" erroronmissingdir="false"/>
258 <fileset dir="${rk.home}/greenstone3/installer-classes" erroronmissingdir="false"/>
259 <fileset dir="${rk.home}/greenstone2/installer-classes" erroronmissingdir="false"/>
260 </copy>
261
262 </target>
263
264 <target name="make-installer-files-concrete">
265
266 <!-- calculate the size of components -->
267 <echo>Calculating the size of some components</echo>
268
269 <!-- core -->
270 <length property="component.bytesize.core-without-jre" mode="all"><fileset file="${basedir}/components/core.comp"/></length>
271 <if><bool><equals arg1="${java.os}" arg2="windows"/></bool>
272 <math result="component.bytesize.core" operand1="${component.bytesize.core-without-jre}" operation="+" operand2="${component.bytesize.windows-java}" datatype="int"/>
273 <else><if><bool><equals arg1="${java.os}" arg2="linux"/></bool>
274 <math result="component.bytesize.core" operand1="${component.bytesize.core-without-jre}" operation="+" operand2="${component.bytesize.linux-java}" datatype="int"/>
275 <else>
276 <property name="component.bytesize.core" value="${component.bytesize.core-without-jre}"/>
277 </else></if></else></if>
278 <math result="component.megabytesize.core" operand1="${component.bytesize.core}" operation="/" operand2="1048576" datatype="int"/>
279 <property name="component.size.core" value="${component.megabytesize.core} MB"/>
280
281 <!-- imagemagick -->
282 <length property="component.bytesize.imagemagick" mode="all"><fileset file="${basedir}/components/imagemagick.comp"/></length>
283 <math result="component.megabytesize.imagemagick" operand1="${component.bytesize.imagemagick}" operation="/" operand2="1048576" datatype="int"/>
284 <property name="component.size.imagemagick" value="${component.megabytesize.imagemagick} MB"/>
285
286 <!-- ghostscript -->
287 <length property="component.bytesize.ghostscript" mode="all"><fileset file="${basedir}/components/ghostscript.comp"/></length>
288 <math result="component.megabytesize.ghostscript" operand1="${component.bytesize.ghostscript}" operation="/" operand2="1048576" datatype="int"/>
289 <property name="component.size.ghostscript" value="${component.megabytesize.ghostscript} MB"/>
290
291 <!-- tomcat -->
292 <length property="component.bytesize.tomcat" mode="all"><fileset file="${basedir}/components/tomcat.comp"/></length>
293 <math result="component.megabytesize.tomcat" operand1="${component.bytesize.tomcat}" operation="/" operand2="1048576" datatype="int"/>
294 <property name="component.size.tomcat" value="${component.megabytesize.tomcat} MB"/>
295
296 <!-- make the installer descriptors relevant to the current os -->
297 <dcff file="installer/antinstall-config.xml" startTag="&lt;!--\s*if\s*(?!.*${rk.os})[^ ]+\s*--&gt;" endTag="&lt;!--\s*/if\s*--&gt;" />
298 <dcff file="installer/build.xml" startTag="&lt;!--\s*if\s*(?!.*${rk.os})[^ ]+\s*--&gt;" endTag="&lt;!--\s*/if\s*--&gt;" />
299
300 <!-- put the concrete values of things in the config -->
301 <rsr>
302 <fileset dir="${basedir}/installer" includes="*.xml"/>
303 <job pattern="@version@" replacement="${version}"/>
304 <job pattern="@component.size.core@" replacement="${component.size.core}"/>
305 <job pattern="@component.size.tomcat@" replacement="${component.size.tomcat}"/>
306 <job pattern="@component.size.imagemagick@" replacement="${component.size.imagemagick}"/>
307 <job pattern="@component.size.ghostscript@" replacement="${component.size.ghostscript}"/>
308 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
309 <job pattern="@windows-java.extracted@" replacement="${windows-java.extracted}"/>
310 <job pattern="@linux-java.extracted@" replacement="${linux-java.extracted}"/>
311 </rsr>
312
313 <!-- put the concrete values of things in the text -->
314 <rsr>
315 <fileset dir="${basedir}/installer/classes/resources" includes="*.properties"/>
316 <job pattern="@version@" replacement="${version}"/>
317 <job pattern="@version.major@" replacement="${version.major}"/>
318 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
319 <job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
320 <job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
321 <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
322 <job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
323 <job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
324 </rsr>
325
326 </target>
327
328 <!-- shared target to compile the uninstaller -->
329 <target name="compile-uninstaller">
330 <echo>Compiling Uninstaller</echo>
331
332 <!-- create working build directory -->
333 <mkdir dir="${basedir}/compiled/uninstaller/build/resources" />
334
335 <!-- copile to build -->
336 <javac
337 srcdir="${rk.home}/core/uninstaller"
338 destdir="${basedir}/compiled/uninstaller/build" />
339
340 <!-- copy language bundle into place -->
341 <native2ascii
342 implementation="sun"
343 src="${rk.home}/core/language-strings"
344 dest="${basedir}/compiled/uninstaller/build/resources"/>
345
346 <!-- jar it all up -->
347 <jar
348 destfile="${basedir}/compiled/uninst.jar"
349 manifest="${rk.home}/core/uninstaller/manifest.mf"
350 basedir="${basedir}/compiled/uninstaller/build" />
351
352 </target>
353
354 <!-- copy the uninstaller script from the rk to web distribution -->
355 <target name="insert-uninstaller">
356
357 <!-- linux and mac -->
358 <if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
359 <copy file="${rk.home}/core/uninstaller/Uninstall.sh" todir="distributions/web"/>
360
361 <!-- windows -->
362 <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
363 <copy file="${rk.home}/core/uninstaller/Uninstall.bat" todir="distributions/web"/>
364
365 <!-- else fail -->
366 <else>
367 <fail>this target does not support the current os</fail>
368
369 </else></if></else></if>
370 </target>
371
372 <!-- unzip windows perl into bin/windows of the given gsdl or gs2build -->
373 <target name="insert-windows-perl">
374 <mkdir dir="${todir}"/>
375 <delete dir="${todir}/perl"/>
376 <unzip src="${rk.home}/windows/perl.zip" dest="${todir}"/>
377 </target>
378
379 <target name="copy-compiled-to-dist">
380
381 <!-- windows -->
382 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
383 <delete dir="distributions/web"/>
384 <mkdir dir="distributions"/>
385 <copy todir="distributions/web">
386 <fileset dir="compiled" includes="**/*"/>
387 </copy>
388
389 <!-- linux, mac -->
390 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
391 <delete dir="distributions/web"/>
392 <mkdir dir="distributions"/>
393 <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
394 <exec executable="cp" failonerror="true"><arg line="-R compiled distributions/web"/></exec>
395 <else>
396 <exec executable="cp" failonerror="true"><arg line="-r compiled distributions/web"/></exec>
397 </else></if>
398
399 <!-- else fail -->
400 <else>
401 <fail>this target does not support the current os</fail>
402
403 </else></if></else></if>
404
405 </target>
406
407 <target name="gsdl-set-version-numbers">
408
409 <if><bool><available file="${gsdl.basedir}/common-src/src/lib/gsdlconf.h"/></bool>
410 <echo level="info">Setting version in common-src/src/lib/gsdlconf.h</echo>
411 <rsr file="${gsdl.basedir}/common-src/src/lib/gsdlconf.h" pattern="(#define GSDL_VERSION) &quot;.*&quot;" replacement="$1 &quot;${version}&quot;" />
412 <else>
413 <echo message="skipping gsdlconf.h"/>
414 </else></if>
415
416 <if><bool><available file="${gsdl.basedir}/etc/VERSION"/></bool>
417 <echo level="info">Setting version in etc/VERSION</echo>
418 <rsr file="${gsdl.basedir}/etc/VERSION" pattern="(gsdl version: ).*" replacement="$1${version}" />
419 <else>
420 <echo message="skipping VERSION"/>
421 </else></if>
422
423 <if><bool><available file="${gsdl.basedir}/lib/java/server.properties"/></bool>
424 <echo level="info">Setting version in server.properties</echo>
425 <rsr file="${gsdl.basedir}/lib/java/server.properties" pattern="^(Server2Control.Version[:=]).*" replacement="$1${version}" />
426 <else>
427 <echo message="skipping server.properties"/>
428 </else></if>
429
430 <if><bool><available file="${gsdl.basedir}/lib/java/log4j.properties.in"/></bool>
431 <echo level="info">Sneakily changing some log4j stuff</echo>
432 <rsr file="${gsdl.basedir}/lib/java/log4j.properties.in" pattern="^(log4j.category.org.greenstone.server[:=].*)INFO(.*)" replacement="$1WARN$2" />
433 <else>
434 <echo message="skipping log4j.properties.in"/>
435 </else></if>
436
437 <antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${gsdl.basedir}"/></antcall>
438
439 </target>
440
441 <target name="gsdl-set-dates-in-readmes">
442 <echo level="info">Changing date and version in the docs</echo>
443
444 <!-- en -->
445 <if><bool><available file="${gsdl.basedir}/READMEen.txt"/></bool>
446 <rsr file="${gsdl.basedir}/READMEen.txt">
447 <job pattern="^(Date\s*)(.*)" replacement="$1${month.default} ${current.year}" />
448 <job pattern="^(Version\s*)(.*)" replacement="$1${version}" />
449 </rsr>
450 </if>
451
452 <!-- ar -->
453 <if><bool><available file="${gsdl.basedir}/READMEar.txt"/></bool>
454 <rsr file="${gsdl.basedir}/READMEar.txt">
455 <job pattern="(التاريخ : \s*)(.*)" replacement="$1${month.ar} ${current.year}"/>
456 <job pattern="(النسخه : \s*)(.*)" replacement="$1${version}"/>
457 </rsr>
458 </if>
459
460 <!-- es -->
461 <if><bool><available file="${gsdl.basedir}/READMEes.txt"/></bool>
462 <rsr file="${gsdl.basedir}/READMEes.txt">
463 <job pattern="^(Fecha\s*)(.*)" replacement="$1${month.es} de ${current.year}"/>
464 <job pattern="^(Versi.?n\s*)(.*)" replacement="$1${version}"/>
465 </rsr>
466 </if>
467
468 <!-- fr -->
469 <if><bool><available file="${gsdl.basedir}/READMEfr.txt"/></bool>
470 <rsr file="${gsdl.basedir}/READMEfr.txt">
471 <job pattern="^(Date\s*)(.*)" replacement="$1${month.fr} ${current.year}"/>
472 <job pattern="^(Version\s*)(.*)" replacement="$1${version}"/>
473 </rsr>
474 </if>
475
476 <!-- ru -->
477 <if><bool><available file="${gsdl.basedir}/READMEru.txt"/></bool>
478 <rsr file="${gsdl.basedir}/READMEru.txt">
479 <job pattern="^(Дата\s*)(.*)" replacement="$1${month.ru} ${current.year}"/>
480 <job pattern="^(ВерсОя\s*)(.*)" replacement="$1${version}"/>
481 </rsr>
482 </if>
483
484 </target>
485
486 <!-- prepare the component named in ${component} -->
487 <target name="prepare-component">
488 <mkdir dir="components"/>
489 <zip destfile="components/${component}.comp" compress="false">
490 <zipfileset dir="distributions/web">
491 <patternset refid="greenstone${version.major}.${component}.component"/>
492 </zipfileset>
493 </zip>
494 </target>
495
496 <!-- compress the component named in ${component} -->
497 <target name="compress-component">
498 <!-- windows -->
499 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
500 <exec executable="${rk.home}/windows/7za/7za.exe" dir="components"><arg line="a -t7z -mx=9 ${component}.lzma ${component}.comp"/></exec>
501
502 <!-- linux, mac -->
503 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
504 <sevenzip task="encode" input="components/${component}.comp" output="components/${component}.lzma" dictionnary="26"/>
505
506 <!-- else warn -->
507 <else>
508 <fail>this target does not support this os (was a new release-kit os added?)</fail>
509
510 </else></if></else></if>
511 </target>
512
513
514 <target name="create-minimal-distribution">
515
516 <property name="dist.name" value="Greenstone-${version}-${os.suffix}-minimal"/>
517
518 <!-- unzip the core component to a temporary space -->
519 <mkdir dir="minimal-dist/${dist.name}"/>
520 <unzip src="components/core.comp" dest="minimal-dist/${dist.name}"/>
521
522 <!-- under windows, create zip-->
523 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
524 <zip destfile="products/${dist.name}.zip" basedir="minimal-dist"/>
525
526 <!-- under unix, create tar.gz -->
527 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
528 <exec dir="." executable="tar">
529 <arg value="-czf"/><arg value="products/${dist.name}.tar.gz"/>
530 <arg value="minimal-dist"/>
531 </exec>
532
533 </if></else></if>
534
535 </target>
536
537
538</project>
Note: See TracBrowser for help on using the repository browser.