source: main/trunk/release-kits/shared/core/ant-scripts/init.xml@ 21611

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

moving things around

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