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

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

moved targets for preparing and compressing components to the fully shared area from greenstone3 shared area, and create a target to create the minimal distribution

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