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