[21623] | 1 | <?xml version="1.0" encoding="utf-8" ?>
|
---|
| 2 | <project name="create-installer">
|
---|
| 3 |
|
---|
[21634] | 4 | <target name="create-installer" depends="init">
|
---|
[21623] | 5 |
|
---|
| 6 | <!-- create installer directory -->
|
---|
| 7 | <mkdir dir="installer/classes"/>
|
---|
| 8 |
|
---|
| 9 | <!-- insert the installer descriptors -->
|
---|
[21634] | 10 | <copy todir="installer" overwrite="true">
|
---|
| 11 | <fileset dir="${rk.home}/kits/${rk.name}/installer" includes="antinstall-config.xml,build.xml"/>
|
---|
[21623] | 12 | </copy>
|
---|
| 13 |
|
---|
| 14 | <!-- insert the language bundle -->
|
---|
| 15 | <native2ascii
|
---|
| 16 | implementation="sun"
|
---|
| 17 | encoding="UTF-8"
|
---|
| 18 | src="${rk.home}/shared/core/language-strings"
|
---|
| 19 | dest="${basedir}/installer/classes/resources"/>
|
---|
| 20 |
|
---|
| 21 | <!-- insert core, rk-specific and os-specific installer classes -->
|
---|
| 22 | <copy todir="${basedir}/installer/classes" overwrite="true">
|
---|
| 23 | <fileset dir="${rk.home}/shared/core/installer-classes" erroronmissingdir="false"/>
|
---|
| 24 | <fileset dir="${rk.home}/kits/${rk.name}/installer-classes" erroronmissingdir="false"/>
|
---|
| 25 | <fileset dir="${rk.home}/shared/${rk.os}/installer-classes" erroronmissingdir="false"/>
|
---|
| 26 | </copy>
|
---|
| 27 |
|
---|
| 28 | <!-- insert the licence -->
|
---|
| 29 | <copy file="compiled/LICENSE.txt" todir="${basedir}/installer/classes" overwrite="true"/>
|
---|
| 30 |
|
---|
| 31 | <!-- insert greenstone's ant tasks -->
|
---|
| 32 | <unjar src="${rk.home}/shared/core/ant-tasks/greenstone/anttasks.jar" dest="installer/classes"/>
|
---|
[22132] | 33 |
|
---|
| 34 | <!-- insert antelope tasks -->
|
---|
| 35 | <unjar src="${rk.home}/shared/core/ant-tasks/antelope/AntelopeTasks_3.4.2.jar" dest="installer/classes"/>
|
---|
[21623] | 36 |
|
---|
[22132] | 37 | <!-- Include lib/crypt.class but only for releasekit2 (rk2) -->
|
---|
| 38 | <if><bool><equals arg1="${rk.name}" arg2="rk2"/></bool>
|
---|
| 39 | <unjar src="${rk.home}/shared/core/lib/crypt.jar" dest="${basedir}/installer/classes">
|
---|
| 40 | <patternset><include name="**/*.class"/></patternset>
|
---|
| 41 | </unjar>
|
---|
| 42 | </if>
|
---|
[21884] | 43 |
|
---|
[21623] | 44 | <!-- (windows only) -->
|
---|
| 45 | <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
| 46 | <!-- insert 7za.exe tool -->
|
---|
| 47 | <copy todir="installer/classes" overwrite="true" file="${rk.home}/shared/windows/7za/7za.exe"/>
|
---|
| 48 |
|
---|
| 49 | <!-- insert roxes and orangevolt for windows tricks in ant -->
|
---|
| 50 | <unjar src="${rk.home}/shared/core/ant-tasks/orangevolt/roxes-win32forjava-1.1.1.jar" dest="installer/classes"/>
|
---|
| 51 | <unjar src="${rk.home}/shared/core/ant-tasks/orangevolt/orangevolt-ant-tasks-1.3.8.jar" dest="installer/classes"/>
|
---|
| 52 |
|
---|
| 53 | <!-- (linux and mac only) -->
|
---|
| 54 | <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
|
---|
| 55 | <!-- insert 7zip ant task -->
|
---|
| 56 | <unjar src="${rk.home}/shared/core/ant-tasks/7z-ant/7z.jar" dest="installer/classes"/>
|
---|
| 57 |
|
---|
| 58 | </if></else></if>
|
---|
| 59 |
|
---|
| 60 | <!-- clean up meta directory -->
|
---|
| 61 | <delete dir="installer/classes/META-INF"/>
|
---|
| 62 |
|
---|
| 63 | <!-- calculate the size of: core -->
|
---|
| 64 | <length property="component.bytesize.core-without-jre" mode="all"><fileset file="${basedir}/components/core.comp"/></length>
|
---|
| 65 | <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
|
---|
| 66 | <math result="component.bytesize.core" operand1="${component.bytesize.core-without-jre}" operation="+" operand2="${component.bytesize.windows-java}" datatype="int"/>
|
---|
| 67 | <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
|
---|
| 68 | <math result="component.bytesize.core" operand1="${component.bytesize.core-without-jre}" operation="+" operand2="${component.bytesize.linux-java}" datatype="int"/>
|
---|
| 69 | <else>
|
---|
| 70 | <property name="component.bytesize.core" value="${component.bytesize.core-without-jre}"/>
|
---|
| 71 | </else></if></else></if>
|
---|
| 72 | <math result="component.megabytesize.core" operand1="${component.bytesize.core}" operation="/" operand2="1048576" datatype="int"/>
|
---|
| 73 | <property name="component.size.core" value="${component.megabytesize.core} MB"/>
|
---|
| 74 |
|
---|
| 75 | <!-- calculate the size of: imagemagick -->
|
---|
| 76 | <length property="component.bytesize.imagemagick" mode="all"><fileset file="${basedir}/components/imagemagick.comp"/></length>
|
---|
| 77 | <math result="component.megabytesize.imagemagick" operand1="${component.bytesize.imagemagick}" operation="/" operand2="1048576" datatype="int"/>
|
---|
| 78 | <property name="component.size.imagemagick" value="${component.megabytesize.imagemagick} MB"/>
|
---|
| 79 |
|
---|
[22354] | 80 | <!-- calculate the size of: ghostscript -->
|
---|
| 81 | <length property="component.bytesize.ghostscript" mode="all"><fileset file="${basedir}/components/ghostscript.comp"/></length>
|
---|
| 82 | <math result="component.megabytesize.ghostscript" operand1="${component.bytesize.ghostscript}" operation="/" operand2="1048576" datatype="int"/>
|
---|
| 83 | <property name="component.size.ghostscript" value="${component.megabytesize.ghostscript} MB"/>
|
---|
| 84 |
|
---|
[22325] | 85 | <!-- calculate the size of: apache httpd -->
|
---|
| 86 | <length property="component.bytesize.httpd" mode="all"><fileset file="${basedir}/components/apachehttpd.comp"/></length>
|
---|
| 87 | <math result="component.megabytesize.httpd" operand1="${component.bytesize.httpd}" operation="/" operand2="1048576" datatype="int"/>
|
---|
| 88 | <property name="component.size.httpd" value="${component.megabytesize.httpd} MB"/>
|
---|
| 89 |
|
---|
[21623] | 90 | <!-- calculate the size of: tomcat -->
|
---|
| 91 | <length property="component.bytesize.tomcat" mode="all"><fileset file="${basedir}/components/tomcat.comp"/></length>
|
---|
| 92 | <math result="component.megabytesize.tomcat" operand1="${component.bytesize.tomcat}" operation="/" operand2="1048576" datatype="int"/>
|
---|
| 93 | <property name="component.size.tomcat" value="${component.megabytesize.tomcat} MB"/>
|
---|
| 94 |
|
---|
[22325] | 95 | <!-- EXT -->
|
---|
| 96 | <!-- calculate the size of: amp (and put it into the components directory) -->
|
---|
| 97 | <if><bool><and><equals arg1="${amp.enabled}" arg2="true"/><not><available file="${rk.home}/ext/amp.lzma"/></not></and></bool>
|
---|
| 98 | <fail>amp.lzma file not found in the release kit ext directory</fail>
|
---|
| 99 | </if>
|
---|
| 100 |
|
---|
| 101 | <if><bool><and><equals arg1="${amp.enabled}" arg2="true"/></and></bool>
|
---|
| 102 | <echo>Copying amp.lzma to compontents directory</echo>
|
---|
| 103 | <copy file="${rk.home}/ext/amp.lzma" todir="${basedir}/components"/>
|
---|
| 104 | <property name="component.size.amp" value="257 MB"/>
|
---|
| 105 | </if>
|
---|
| 106 | <!-- /EXT -->
|
---|
| 107 |
|
---|
[21623] | 108 | <!-- make the installer descriptors relevant to the current os -->
|
---|
| 109 | <dcff file="installer/antinstall-config.xml" startTag="<!--\s*if\s*(?!.*${rk.os})[^ ]+\s*-->" endTag="<!--\s*/if\s*-->" />
|
---|
| 110 | <dcff file="installer/build.xml" startTag="<!--\s*if\s*(?!.*${rk.os})[^ ]+\s*-->" endTag="<!--\s*/if\s*-->" />
|
---|
| 111 |
|
---|
[22325] | 112 | <!-- EXT -->
|
---|
| 113 | <if><bool><not><equals arg1="${amp.enabled}" arg2="true"/></not></bool>
|
---|
| 114 |
|
---|
| 115 | <dcff file="installer/antinstall-config.xml" startTag="<!-- start amp -->" endTag="<!-- end amp -->" />
|
---|
| 116 | <dcff file="installer/build.xml" startTag="<!-- start amp -->" endTag="<!-- end amp -->" />
|
---|
| 117 | </if>
|
---|
| 118 | <!-- /EXT -->
|
---|
[21623] | 119 | <!-- put the concrete values of things in the config -->
|
---|
| 120 | <rsr>
|
---|
| 121 | <fileset dir="${basedir}/installer" includes="*.xml"/>
|
---|
[23493] | 122 | <job pattern="@version@" replacement="${version}${version-extra}"/>
|
---|
[21623] | 123 | <job pattern="@component.size.core@" replacement="${component.size.core}"/>
|
---|
| 124 | <job pattern="@component.size.tomcat@" replacement="${component.size.tomcat}"/>
|
---|
| 125 | <job pattern="@component.size.imagemagick@" replacement="${component.size.imagemagick}"/>
|
---|
| 126 | <job pattern="@component.size.ghostscript@" replacement="${component.size.ghostscript}"/>
|
---|
[22325] | 127 | <job pattern="@component.size.httpd@" replacement="${component.size.httpd}"/>
|
---|
[21623] | 128 | <job pattern="@java.min.version@" replacement="${java.min.version}"/>
|
---|
| 129 | <job pattern="@java.extracted@" replacement="${java.extracted}"/>
|
---|
| 130 | </rsr>
|
---|
| 131 |
|
---|
[23811] | 132 | <!-- If this is a FLAX installer then we need to change a few things -->
|
---|
| 133 | <if><bool><equals arg1="${forward.install.flax}" arg2="true"/></bool>
|
---|
| 134 | <dcff file="installer/build.xml" startTag="<!-- NO FLAX START -->" endTag="<!-- NO FLAX END -->" />
|
---|
[23816] | 135 | <dcff file="installer/antinstall-config.xml" startTag="<!-- NO FLAX START -->" endTag="<!-- NO FLAX END -->" />
|
---|
[23811] | 136 | <else>
|
---|
| 137 | <dcff file="installer/build.xml" startTag="<!-- FLAX START -->" endTag="<!-- FLAX END -->" />
|
---|
[23816] | 138 | <dcff file="installer/antinstall-config.xml" startTag="<!-- FLAX START -->" endTag="<!-- FLAX END -->" />
|
---|
[23811] | 139 | </else>
|
---|
| 140 | </if>
|
---|
| 141 |
|
---|
[23816] | 142 | <!-- If we don't want GLI/GEMS -->
|
---|
| 143 | <if><bool><equals arg1="${with.gli.and.gems}" arg2="false" /></bool>
|
---|
| 144 | <dcff file="installer/build.xml" startTag="<!-- GLI START -->" endTag="<!-- GLI END -->" />
|
---|
| 145 | </if>
|
---|
| 146 |
|
---|
[22325] | 147 | <!-- EXT -->
|
---|
| 148 | <if><bool><equals arg1="${amp.enabled}" arg2="true"/></bool>
|
---|
| 149 | <rsr>
|
---|
| 150 | <fileset dir="${basedir}/installer" includes="*.xml"/>
|
---|
| 151 | <job pattern="@component.size.amp@" replacement="${component.size.amp}"/>
|
---|
| 152 | </rsr>
|
---|
| 153 | </if>
|
---|
| 154 | <!-- /EXT -->
|
---|
| 155 |
|
---|
[21623] | 156 | <!-- put the concrete values of things in the text -->
|
---|
| 157 | <rsr>
|
---|
| 158 | <fileset dir="${basedir}/installer/classes/resources" includes="*.properties"/>
|
---|
[23493] | 159 | <job pattern="@version@" replacement="${version}${version-extra}"/>
|
---|
[21623] | 160 | <job pattern="@version.major@" replacement="${version.major}"/>
|
---|
| 161 | <job pattern="@java.min.version@" replacement="${java.min.version}"/>
|
---|
| 162 | <job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
|
---|
| 163 | <job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
|
---|
| 164 | <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
|
---|
| 165 | <job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
|
---|
| 166 | <job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
|
---|
| 167 | </rsr>
|
---|
| 168 |
|
---|
| 169 | <!-- now ready to run "compile-*-installer" targets -->
|
---|
| 170 |
|
---|
| 171 | <antcall target="compile-binary-installer"/>
|
---|
| 172 |
|
---|
| 173 | </target>
|
---|
| 174 |
|
---|
| 175 | <target name="compile-binary-installer">
|
---|
| 176 |
|
---|
| 177 | <!-- strip out lines for the cdrom installer -->
|
---|
| 178 | <copy file="installer/antinstall-config.xml" tofile="installer/antinstall-config-binary.xml" overwrite="true"/>
|
---|
| 179 | <dcff file="installer/antinstall-config-binary.xml" startTag=".*<!-- start cdrom -->.*" endTag=".*<!-- end cdrom -->.*" />
|
---|
| 180 | <copy file="installer/build.xml" tofile="installer/build-binary.xml" overwrite="true"/>
|
---|
| 181 | <dcff file="installer/build-binary.xml" startTag=".*<!-- start cdrom -->.*" endTag=".*<!-- end cdrom -->.*" />
|
---|
| 182 |
|
---|
| 183 | <!-- create insaller jar with ant-installer's ant task -->
|
---|
[23493] | 184 | <installer file="installer/Greenstone-${version}${version-extra}-${os.suffix}.jar"
|
---|
[21623] | 185 | compress="true"
|
---|
| 186 | extractType="NonExtractor"
|
---|
| 187 | installConfig="installer/antinstall-config-binary.xml"
|
---|
| 188 | buildFile="installer/build-binary.xml"
|
---|
| 189 | antInstallLib="${rk.home}/shared/core/ant-installer/lib"
|
---|
| 190 | antLib="${ant.home}/lib"
|
---|
| 191 | validateConfig="true"
|
---|
| 192 | icons="bluecurve">
|
---|
| 193 |
|
---|
| 194 | <zipfileset dir="installer/classes" includes="**/*" />
|
---|
| 195 | <zipfileset dir="components" includes="*.lzma"/>
|
---|
| 196 | </installer>
|
---|
| 197 |
|
---|
| 198 | </target>
|
---|
| 199 |
|
---|
| 200 | <target name="compile-cdrom-installer">
|
---|
| 201 |
|
---|
| 202 | <!-- strip out lines for the binary(web) installer -->
|
---|
| 203 | <copy file="installer/antinstall-config.xml" tofile="installer/antinstall-config-cdrom.xml"/>
|
---|
| 204 | <dcff file="installer/antinstall-config-cdrom.xml" startTag=".*<!-- start web -->.*" endTag=".*<!-- end web -->.*" />
|
---|
| 205 | <copy file="installer/build.xml" tofile="installer/build-cdrom.xml"/>
|
---|
| 206 | <dcff file="installer/build-cdrom.xml" startTag=".*<!-- start web -->.*" endTag=".*<!-- end web -->.*" />
|
---|
| 207 |
|
---|
| 208 | <installer file="installer/cdrom.jar"
|
---|
| 209 | compress="true"
|
---|
| 210 | extractType="NonExtractor"
|
---|
| 211 | installConfig="installer/antinstall-config-cdrom.xml"
|
---|
| 212 | buildFile="installer/build-cdrom.xml"
|
---|
| 213 | antInstallLib="${rk.home}/shared/core/ant-installer/lib"
|
---|
| 214 | antLib="${ant.home}/lib"
|
---|
| 215 | validateConfig="true"
|
---|
| 216 | icons="bluecurve">
|
---|
| 217 |
|
---|
| 218 | <zipfileset dir="installer/classes" includes="**/*" />
|
---|
| 219 | </installer>
|
---|
| 220 |
|
---|
| 221 | </target>
|
---|
| 222 |
|
---|
| 223 | </project>
|
---|