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

Last change on this file since 20937 was 20937, checked in by oranfry, 14 years ago

collaped properties linux-java.extracted and windows-java.extracted into java.extracted

File size: 23.3 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 <property name="java.extracted" value="jre"/> <!-- set this to the name of the top level directory in the above archive -->
37
38 <!-- linux -->
39 <property name="linux-java.installer" value="jre_bin"/>
40 <property name="bundled.version.linux-java" value="1.6.0_05"/> <!-- set this to the version number of java in the above archive -->
41 <property name="component.bytesize.linux-java" value="101245987"/> <!-- set this to the size of the extract archive -->
42
43 <!-- windows -->
44 <property name="windows-java.installer" value="jre.exe"/>
45 <property name="bundled.version.windows-java" value="1.6.0_07"/> <!-- set this to the version number of java 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 [email protected] . 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="@java.extracted@" replacement="${java.extracted}"/>
310 </rsr>
311
312 <!-- put the concrete values of things in the text -->
313 <rsr>
314 <fileset dir="${basedir}/installer/classes/resources" includes="*.properties"/>
315 <job pattern="@version@" replacement="${version}"/>
316 <job pattern="@version.major@" replacement="${version.major}"/>
317 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
318 <job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
319 <job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
320 <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
321 <job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
322 <job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
323 </rsr>
324
325 </target>
326
327 <!-- shared target to compile the uninstaller -->
328 <target name="compile-uninstaller">
329 <echo>Compiling Uninstaller</echo>
330
331 <!-- create working build directory -->
332 <mkdir dir="${basedir}/compiled/uninstaller/build/resources" />
333
334 <!-- copile to build -->
335 <javac
336 srcdir="${rk.home}/core/uninstaller"
337 destdir="${basedir}/compiled/uninstaller/build" />
338
339 <!-- copy language bundle into place -->
340 <native2ascii
341 implementation="sun"
342 src="${rk.home}/core/language-strings"
343 dest="${basedir}/compiled/uninstaller/build/resources"/>
344
345 <!-- jar it all up -->
346 <jar
347 destfile="${basedir}/compiled/uninst.jar"
348 manifest="${rk.home}/core/uninstaller/manifest.mf"
349 basedir="${basedir}/compiled/uninstaller/build" />
350
351 </target>
352
353 <!-- copy the uninstaller script from the rk to web distribution -->
354 <target name="insert-uninstaller">
355
356 <!-- linux and mac -->
357 <if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
358 <copy file="${rk.home}/core/uninstaller/Uninstall.sh" todir="distributions/web"/>
359
360 <!-- windows -->
361 <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
362 <copy file="${rk.home}/core/uninstaller/Uninstall.bat" todir="distributions/web"/>
363
364 <!-- else fail -->
365 <else>
366 <fail>this target does not support the current os</fail>
367
368 </else></if></else></if>
369 </target>
370
371 <!-- unzip windows perl into bin/windows of the given gsdl or gs2build -->
372 <target name="insert-windows-perl">
373 <mkdir dir="${todir}"/>
374 <delete dir="${todir}/perl"/>
375 <unzip src="${rk.home}/windows/perl.zip" dest="${todir}"/>
376 </target>
377
378 <target name="copy-compiled-to-dist">
379
380 <!-- windows -->
381 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
382 <delete dir="distributions/web"/>
383 <mkdir dir="distributions"/>
384 <copy todir="distributions/web">
385 <fileset dir="compiled" includes="**/*"/>
386 </copy>
387
388 <!-- linux, mac -->
389 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
390 <delete dir="distributions/web"/>
391 <mkdir dir="distributions"/>
392 <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
393 <exec executable="cp" failonerror="true"><arg line="-R compiled distributions/web"/></exec>
394 <else>
395 <exec executable="cp" failonerror="true"><arg line="-r compiled distributions/web"/></exec>
396 </else></if>
397
398 <!-- else fail -->
399 <else>
400 <fail>this target does not support the current os</fail>
401
402 </else></if></else></if>
403
404 </target>
405
406 <target name="gsdl-set-version-numbers">
407
408 <if><bool><available file="${gsdl.basedir}/common-src/src/lib/gsdlconf.h"/></bool>
409 <echo level="info">Setting version in common-src/src/lib/gsdlconf.h</echo>
410 <rsr file="${gsdl.basedir}/common-src/src/lib/gsdlconf.h" pattern="(#define GSDL_VERSION) &quot;.*&quot;" replacement="$1 &quot;${version}&quot;" />
411 <else>
412 <echo message="skipping gsdlconf.h"/>
413 </else></if>
414
415 <if><bool><available file="${gsdl.basedir}/etc/VERSION"/></bool>
416 <echo level="info">Setting version in etc/VERSION</echo>
417 <rsr file="${gsdl.basedir}/etc/VERSION" pattern="(gsdl version: ).*" replacement="$1${version}" />
418 <else>
419 <echo message="skipping VERSION"/>
420 </else></if>
421
422 <if><bool><available file="${gsdl.basedir}/lib/java/server.properties"/></bool>
423 <echo level="info">Setting version in server.properties</echo>
424 <rsr file="${gsdl.basedir}/lib/java/server.properties" pattern="^(Server2Control.Version[:=]).*" replacement="$1${version}" />
425 <else>
426 <echo message="skipping server.properties"/>
427 </else></if>
428
429 <if><bool><available file="${gsdl.basedir}/lib/java/log4j.properties.in"/></bool>
430 <echo level="info">Sneakily changing some log4j stuff</echo>
431 <rsr file="${gsdl.basedir}/lib/java/log4j.properties.in" pattern="^(log4j.category.org.greenstone.server[:=].*)INFO(.*)" replacement="$1WARN$2" />
432 <else>
433 <echo message="skipping log4j.properties.in"/>
434 </else></if>
435
436 <antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${gsdl.basedir}"/></antcall>
437
438 </target>
439
440 <target name="gsdl-set-dates-in-readmes">
441 <echo level="info">Changing date and version in the docs</echo>
442
443 <!-- en -->
444 <if><bool><available file="${gsdl.basedir}/READMEen.txt"/></bool>
445 <rsr file="${gsdl.basedir}/READMEen.txt">
446 <job pattern="^(Date\s*)(.*)" replacement="$1${month.default} ${current.year}" />
447 <job pattern="^(Version\s*)(.*)" replacement="$1${version}" />
448 </rsr>
449 </if>
450
451 <!-- ar -->
452 <if><bool><available file="${gsdl.basedir}/READMEar.txt"/></bool>
453 <rsr file="${gsdl.basedir}/READMEar.txt">
454 <job pattern="(التاريخ : \s*)(.*)" replacement="$1${month.ar} ${current.year}"/>
455 <job pattern="(النسخه : \s*)(.*)" replacement="$1${version}"/>
456 </rsr>
457 </if>
458
459 <!-- es -->
460 <if><bool><available file="${gsdl.basedir}/READMEes.txt"/></bool>
461 <rsr file="${gsdl.basedir}/READMEes.txt">
462 <job pattern="^(Fecha\s*)(.*)" replacement="$1${month.es} de ${current.year}"/>
463 <job pattern="^(Versi.?n\s*)(.*)" replacement="$1${version}"/>
464 </rsr>
465 </if>
466
467 <!-- fr -->
468 <if><bool><available file="${gsdl.basedir}/READMEfr.txt"/></bool>
469 <rsr file="${gsdl.basedir}/READMEfr.txt">
470 <job pattern="^(Date\s*)(.*)" replacement="$1${month.fr} ${current.year}"/>
471 <job pattern="^(Version\s*)(.*)" replacement="$1${version}"/>
472 </rsr>
473 </if>
474
475 <!-- ru -->
476 <if><bool><available file="${gsdl.basedir}/READMEru.txt"/></bool>
477 <rsr file="${gsdl.basedir}/READMEru.txt">
478 <job pattern="^(Дата\s*)(.*)" replacement="$1${month.ru} ${current.year}"/>
479 <job pattern="^(ВерсОя\s*)(.*)" replacement="$1${version}"/>
480 </rsr>
481 </if>
482
483 </target>
484
485 <!-- prepare the component named in ${component} -->
486 <target name="prepare-component">
487 <mkdir dir="components"/>
488 <zip destfile="components/${component}.comp" compress="false">
489 <zipfileset dir="distributions/web">
490 <patternset refid="greenstone${version.major}.${component}.component"/>
491 </zipfileset>
492 </zip>
493 </target>
494
495 <!-- compress the component named in ${component} -->
496 <target name="compress-component">
497 <!-- windows -->
498 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
499 <exec executable="${rk.home}/windows/7za/7za.exe" dir="components"><arg line="a -t7z -mx=9 ${component}.lzma ${component}.comp"/></exec>
500
501 <!-- linux, mac -->
502 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
503 <sevenzip task="encode" input="components/${component}.comp" output="components/${component}.lzma" dictionnary="26"/>
504
505 <!-- else warn -->
506 <else>
507 <fail>this target does not support this os (was a new release-kit os added?)</fail>
508
509 </else></if></else></if>
510 </target>
511
512
513 <target name="create-minimal-distribution">
514
515 <property name="dist.name" value="Greenstone-${version}-${os.suffix}-minimal"/>
516
517 <!-- unzip the core component to a temporary space -->
518 <mkdir dir="minimal-dist/${dist.name}"/>
519 <unzip src="components/core.comp" dest="minimal-dist/${dist.name}"/>
520
521 <!-- under windows, create zip-->
522 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
523 <zip destfile="products/${dist.name}.zip" basedir="minimal-dist"/>
524
525 <!-- under unix, create tar.gz -->
526 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
527 <exec dir="." executable="tar">
528 <arg value="-czf"/><arg value="products/${dist.name}.tar.gz"/>
529 <arg value="minimal-dist"/>
530 </exec>
531
532 </if></else></if>
533
534 </target>
535
536
537</project>
Note: See TracBrowser for help on using the repository browser.