source: other-projects/expeditee-release-kits/kits/rke/ant-scripts/create-installer.xml@ 28695

Last change on this file since 28695 was 28695, checked in by ak19, 10 years ago

Expeditee team (Jeremy, jts21). Preliminary versions of the release-kits files for generating an installer containing the executable expeditee jar file. The installer is still tattoed with Greenstone and fails, but will leave a working jar behind on the file system.

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