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

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

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

File size: 23.5 KB
RevLine 
[16173]1<?xml version="1.0" encoding="utf-8" ?>
2<project name="rk-init">
3
[20600]4 <!-- CHECK PRE-CONDITIONS -->
5 <target name="init">
[16173]6
[20600]7 <!-- load in static properties from build.properties -->
8 <property file="${rk.name}-build.properties" />
[16199]9
[20600]10 <!-- CONSTANTS (overridable in build.properties) -->
[16173]11
[20600]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" />
[16199]18
[20600]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"/>
[16173]21
[20600]22 <!-- create a localised basedir property -->
23 <path id="basedir.path"><pathelement location="${basedir}"/></path>
24 <property name="basedir.local" refid="basedir.path"/>
[16199]25
[20600]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>
[17344]32
[20600]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 -->
[17518]41
[20600]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 -->
[17467]47
[20600]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"/>
[16173]52
[20600]53 <!-- CLASSPATH -->
54 <path id="project.classpath">
[16173]55
[20600]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>
[16173]76
[20600]77 </path>
[16173]78
[20600]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"/>
[17344]90
[20600]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 -->
[19006]119
[16173]120 <!-- version number -->
121 <if>
122 <bool>
123 <not><isset property="version"/></not>
124 </bool>
[17898]125 <fail>Version number not set.
126Check that the file '${rk.name}-build.properties' exists and defines property 'version'.</fail>
[16173]127 </if>
128 <property name="app.version" value="${version}"/>
129
[20337]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
[16681]174 <!-- show important properties -->
175 <echo level="info">Version (version): ${version}</echo>
176 <echo level="info">Branch Path (branch.path): ${branch.path}</echo>
[19152]177 <echo level="info">Date (date): ${date}</echo>
[16681]178 <echo level="info">Current Month (current.month): ${current.month}</echo>
179 <echo level="info">Current Year (current.year): ${current.year}</echo>
[20337]180 <echo level="info">Operating System (rk.os): ${rk.os}</echo>
181 <echo level="info">Operating System Suffix (os.suffix): ${os.suffix}</echo>
[16173]182
183 </target>
184
[17346]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
[17589]196 <target name="compile-binary-installer">
197
[19935]198 <copy file="installer/antinstall-config.xml" tofile="installer/antinstall-config-binary.xml" overwrite="true"/>
[19627]199 <dcff file="installer/antinstall-config-binary.xml" startTag=".*&lt;!-- start cdrom --&gt;.*" endTag=".*&lt;!-- end cdrom --&gt;.*" />
[19510]200
[19935]201 <copy file="installer/build.xml" tofile="installer/build-binary.xml" overwrite="true"/>
[19627]202 <dcff file="installer/build-binary.xml" startTag=".*&lt;!-- start cdrom --&gt;.*" endTag=".*&lt;!-- end cdrom --&gt;.*" />
[19510]203
[19627]204 <installer file="installer/Greenstone-${version}-${os.suffix}.jar"
[17589]205 compress="true"
206 extractType="NonExtractor"
[19627]207 installConfig="installer/antinstall-config-binary.xml"
208 buildFile="installer/build-binary.xml"
[19006]209 antInstallLib="${rk.home}/core/ant-installer/lib"
210 antLib="${rk.home}/core/ant/lib"
[17589]211 validateConfig="true"
212 icons="bluecurve">
213
[19627]214 <zipfileset dir="installer/classes" includes="**/*" />
[19935]215 <zipfileset dir="components" includes="*.lzma"/>
[17589]216
217 </installer>
218
219 </target>
220
[19510]221 <target name="compile-cdrom-installer">
222
[19627]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;.*" />
[19510]225
[19644]226 <copy file="installer/build.xml" tofile="installer/build-cdrom.xml"/>
[19627]227 <dcff file="installer/build-cdrom.xml" startTag=".*&lt;!-- start web --&gt;.*" endTag=".*&lt;!-- end web --&gt;.*" />
[19510]228
[19627]229 <installer file="installer/cdrom.jar"
[19510]230 compress="true"
231 extractType="NonExtractor"
[19627]232 installConfig="installer/antinstall-config-cdrom.xml"
233 buildFile="installer/build-cdrom.xml"
[19510]234 antInstallLib="${rk.home}/core/ant-installer/lib"
235 antLib="${rk.home}/core/ant/lib"
236 validateConfig="true"
237 icons="bluecurve">
[19627]238 <zipfileset dir="installer/classes" includes="**/*" />
[19510]239 </installer>
240
241 </target>
242
[17704]243 <target name="copy-main-installer-files">
244
245 <mkdir dir="${basedir}/installer/classes"/>
246
247 <!-- the language bundle -->
[17775]248 <native2ascii
249 implementation="sun"
[17781]250 encoding="UTF-8"
[19006]251 src="${rk.home}/core/language-strings"
[17775]252 dest="${basedir}/installer/classes/resources"/>
[17704]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
[19935]296 <!-- make the installer descriptors relevant to the current os -->
[20048]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;" />
[19935]299
[17704]300 <!-- put the concrete values of things in the config -->
[17932]301 <rsr>
302 <fileset dir="${basedir}/installer" includes="*.xml"/>
[17704]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 -->
[17932]314 <rsr>
315 <fileset dir="${basedir}/installer/classes/resources" includes="*.properties"/>
[17704]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
[17898]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
[19006]337 srcdir="${rk.home}/core/uninstaller"
[17898]338 destdir="${basedir}/compiled/uninstaller/build" />
339
340 <!-- copy language bundle into place -->
341 <native2ascii
342 implementation="sun"
[19006]343 src="${rk.home}/core/language-strings"
[17898]344 dest="${basedir}/compiled/uninstaller/build/resources"/>
345
346 <!-- jar it all up -->
347 <jar
[18929]348 destfile="${basedir}/compiled/uninst.jar"
[19006]349 manifest="${rk.home}/core/uninstaller/manifest.mf"
[17898]350 basedir="${basedir}/compiled/uninstaller/build" />
351
352 </target>
353
[18929]354 <!-- copy the uninstaller script from the rk to web distribution -->
[17898]355 <target name="insert-uninstaller">
[20112]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>
[20190]363 <copy file="${rk.home}/core/uninstaller/Uninstall.bat" todir="distributions/web"/>
[20112]364
365 <!-- else fail -->
366 <else>
367 <fail>this target does not support the current os</fail>
368
369 </else></if></else></if>
[17898]370 </target>
371
[17977]372 <!-- unzip windows perl into bin/windows of the given gsdl or gs2build -->
373 <target name="insert-windows-perl">
[19901]374 <mkdir dir="${todir}"/>
375 <delete dir="${todir}/perl"/>
376 <unzip src="${rk.home}/windows/perl.zip" dest="${todir}"/>
[17977]377 </target>
378
[20060]379 <target name="copy-compiled-to-dist">
[19472]380
[19935]381 <!-- windows -->
382 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
[20060]383 <delete dir="distributions/web"/>
384 <mkdir dir="distributions"/>
385 <copy todir="distributions/web">
386 <fileset dir="compiled" includes="**/*"/>
[19935]387 </copy>
[19472]388
[20060]389 <!-- linux, mac -->
[19935]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"/>
[20331]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>
[19472]398
[19935]399 <!-- else fail -->
400 <else>
401 <fail>this target does not support the current os</fail>
[19472]402
[19935]403 </else></if></else></if>
[19472]404
405 </target>
406
[20205]407 <target name="gsdl-set-version-numbers">
[19472]408
[20213]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>
[20205]415
[20214]416 <if><bool><available file="${gsdl.basedir}/etc/VERSION"/></bool>
[20213]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>
[20205]422
[20214]423 <if><bool><available file="${gsdl.basedir}/lib/java/server.properties"/></bool>
[20213]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>
[20205]429
[20214]430 <if><bool><available file="${gsdl.basedir}/lib/java/log4j.properties.in"/></bool>
[20213]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>
[20205]436
437 <antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${gsdl.basedir}"/></antcall>
438
439 </target>
440
[20213]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
[20532]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>
[20213]495
[20532]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"/>
[20543]525
[20532]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>
[20543]532
[20532]533 </if></else></if>
534
535 </target>
536
537
[16173]538</project>
Note: See TracBrowser for help on using the repository browser.