source: main/trunk/release-kits/shared/core/ant-scripts/create-installer.xml@ 24438

Last change on this file since 24438 was 24438, checked in by ak19, 13 years ago

Changes to release-kit to get the admin page to appear in the GS3 installer. Needed to add in a typedef reference in GS3 for the GS custom addusertask of ant that Oran wrote. Encryption of password requires lib\Crypt.class to be generated from crypt.jar. The other changes were copied from how the GS2 admin page works.

File size: 11.1 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="create-installer">
3
4 <target name="create-installer" depends="init">
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="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"/>
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 <!-- make the installer descriptors relevant to the current os -->
108 <dcff file="installer/antinstall-config.xml" startTag="&lt;!--\s*if\s*(?!.*${rk.os})[^ ]+\s*--&gt;" endTag="&lt;!--\s*/if\s*--&gt;" />
109 <dcff file="installer/build.xml" startTag="&lt;!--\s*if\s*(?!.*${rk.os})[^ ]+\s*--&gt;" endTag="&lt;!--\s*/if\s*--&gt;" />
110
111 <!-- EXT -->
112 <if><bool><not><equals arg1="${amp.enabled}" arg2="true"/></not></bool>
113
114 <dcff file="installer/antinstall-config.xml" startTag="&lt;!-- start amp --&gt;" endTag="&lt;!-- end amp --&gt;" />
115 <dcff file="installer/build.xml" startTag="&lt;!-- start amp --&gt;" endTag="&lt;!-- end amp --&gt;" />
116 </if>
117 <!-- /EXT -->
118 <!-- put the concrete values of things in the config -->
119 <rsr>
120 <fileset dir="${basedir}/installer" includes="*.xml"/>
121 <job pattern="@version@" replacement="${version}${version-extra}"/>
122 <job pattern="@component.size.core@" replacement="${component.size.core}"/>
123 <job pattern="@component.size.tomcat@" replacement="${component.size.tomcat}"/>
124 <job pattern="@component.size.imagemagick@" replacement="${component.size.imagemagick}"/>
125 <job pattern="@component.size.ghostscript@" replacement="${component.size.ghostscript}"/>
126 <job pattern="@component.size.httpd@" replacement="${component.size.httpd}"/>
127 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
128 <job pattern="@java.extracted@" replacement="${java.extracted}"/>
129 </rsr>
130
131 <!-- If this is a FLAX installer then we need to change a few things -->
132 <if><bool><equals arg1="${forward.install.flax}" arg2="true"/></bool>
133 <dcff file="installer/build.xml" startTag="&lt;!-- NO FLAX START --&gt;" endTag="&lt;!-- NO FLAX END --&gt;" />
134 <dcff file="installer/antinstall-config.xml" startTag="&lt;!-- NO FLAX START --&gt;" endTag="&lt;!-- NO FLAX END --&gt;" />
135 <else>
136 <dcff file="installer/build.xml" startTag="&lt;!-- FLAX START --&gt;" endTag="&lt;!-- FLAX END --&gt;" />
137 <dcff file="installer/antinstall-config.xml" startTag="&lt;!-- FLAX START --&gt;" endTag="&lt;!-- FLAX END --&gt;" />
138 </else>
139 </if>
140
141 <!-- If we don't want GLI/GEMS -->
142 <if><bool><equals arg1="${with.gli.and.gems}" arg2="false" /></bool>
143 <dcff file="installer/build.xml" startTag="&lt;!-- GLI START --&gt;" endTag="&lt;!-- GLI END --&gt;" />
144 </if>
145
146 <!-- EXT -->
147 <if><bool><equals arg1="${amp.enabled}" arg2="true"/></bool>
148 <rsr>
149 <fileset dir="${basedir}/installer" includes="*.xml"/>
150 <job pattern="@component.size.amp@" replacement="${component.size.amp}"/>
151 </rsr>
152 </if>
153 <!-- /EXT -->
154
155 <!-- put the concrete values of things in the text -->
156 <rsr>
157 <fileset dir="${basedir}/installer/classes/resources" includes="*.properties"/>
158 <job pattern="@version@" replacement="${version}${version-extra}"/>
159 <job pattern="@version.major@" replacement="${version.major}"/>
160 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
161 <job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
162 <job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
163 <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
164 <job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
165 <job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
166 </rsr>
167
168 <!-- now ready to run "compile-*-installer" targets -->
169
170 <antcall target="compile-binary-installer"/>
171
172 </target>
173
174 <target name="compile-binary-installer">
175
176 <!-- strip out lines for the cdrom installer -->
177 <copy file="installer/antinstall-config.xml" tofile="installer/antinstall-config-binary.xml" overwrite="true"/>
178 <dcff file="installer/antinstall-config-binary.xml" startTag=".*&lt;!-- start cdrom --&gt;.*" endTag=".*&lt;!-- end cdrom --&gt;.*" />
179 <copy file="installer/build.xml" tofile="installer/build-binary.xml" overwrite="true"/>
180 <dcff file="installer/build-binary.xml" startTag=".*&lt;!-- start cdrom --&gt;.*" endTag=".*&lt;!-- end cdrom --&gt;.*" />
181
182 <!-- create insaller jar with ant-installer's ant task -->
183 <installer file="installer/Greenstone-${version}${version-extra}-${os.suffix}.jar"
184 compress="true"
185 extractType="NonExtractor"
186 installConfig="installer/antinstall-config-binary.xml"
187 buildFile="installer/build-binary.xml"
188 antInstallLib="${rk.home}/shared/core/ant-installer/lib"
189 antLib="${ant.home}/lib"
190 validateConfig="true"
191 icons="bluecurve">
192
193 <zipfileset dir="installer/classes" includes="**/*" />
194 <zipfileset dir="components" includes="*.lzma"/>
195 </installer>
196
197 </target>
198
199 <target name="compile-cdrom-installer">
200
201 <!-- strip out lines for the binary(web) installer -->
202 <copy file="installer/antinstall-config.xml" tofile="installer/antinstall-config-cdrom.xml"/>
203 <dcff file="installer/antinstall-config-cdrom.xml" startTag=".*&lt;!-- start web --&gt;.*" endTag=".*&lt;!-- end web --&gt;.*" />
204 <copy file="installer/build.xml" tofile="installer/build-cdrom.xml"/>
205 <dcff file="installer/build-cdrom.xml" startTag=".*&lt;!-- start web --&gt;.*" endTag=".*&lt;!-- end web --&gt;.*" />
206
207 <installer file="installer/cdrom.jar"
208 compress="true"
209 extractType="NonExtractor"
210 installConfig="installer/antinstall-config-cdrom.xml"
211 buildFile="installer/build-cdrom.xml"
212 antInstallLib="${rk.home}/shared/core/ant-installer/lib"
213 antLib="${ant.home}/lib"
214 validateConfig="true"
215 icons="bluecurve">
216
217 <zipfileset dir="installer/classes" includes="**/*" />
218 </installer>
219
220 </target>
221
222</project>
Note: See TracBrowser for help on using the repository browser.