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

Last change on this file since 21884 was 21884, checked in by ak19, 14 years ago

The lib/Crypt.class file of shared/core/lib/crypt.jar needs to be included in the final antinstaller.jar file (Greenstone-version-something.jar) for GS2/rk2 so that the admin pwd can be encrypted at the end of the install phase. Else you get an Install Failed message and the Admin pages don't recognise the chosen admin pwd since it was never successfully encrypted.

File size: 8.6 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 <!-- Include lib/crypt.class but only for releasekit2 (rk2) -->
35 <if><bool><equals arg1="${rk.name}" arg2="rk2"/></bool>
36 <unjar src="${rk.home}/shared/core/lib/crypt.jar" dest="${basedir}/installer/classes">
37 <patternset><include name="**/*.class"/></patternset>
38 </unjar>
39 </if>
40
41 <!-- (windows only) -->
42 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
43 <!-- insert 7za.exe tool -->
44 <copy todir="installer/classes" overwrite="true" file="${rk.home}/shared/windows/7za/7za.exe"/>
45
46 <!-- insert roxes and orangevolt for windows tricks in ant -->
47 <unjar src="${rk.home}/shared/core/ant-tasks/orangevolt/roxes-win32forjava-1.1.1.jar" dest="installer/classes"/>
48 <unjar src="${rk.home}/shared/core/ant-tasks/orangevolt/orangevolt-ant-tasks-1.3.8.jar" dest="installer/classes"/>
49
50 <!-- (linux and mac only) -->
51 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
52 <!-- insert 7zip ant task -->
53 <unjar src="${rk.home}/shared/core/ant-tasks/7z-ant/7z.jar" dest="installer/classes"/>
54
55 </if></else></if>
56
57 <!-- clean up meta directory -->
58 <delete dir="installer/classes/META-INF"/>
59
60 <!-- calculate the size of: core -->
61 <length property="component.bytesize.core-without-jre" mode="all"><fileset file="${basedir}/components/core.comp"/></length>
62 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
63 <math result="component.bytesize.core" operand1="${component.bytesize.core-without-jre}" operation="+" operand2="${component.bytesize.windows-java}" datatype="int"/>
64 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
65 <math result="component.bytesize.core" operand1="${component.bytesize.core-without-jre}" operation="+" operand2="${component.bytesize.linux-java}" datatype="int"/>
66 <else>
67 <property name="component.bytesize.core" value="${component.bytesize.core-without-jre}"/>
68 </else></if></else></if>
69 <math result="component.megabytesize.core" operand1="${component.bytesize.core}" operation="/" operand2="1048576" datatype="int"/>
70 <property name="component.size.core" value="${component.megabytesize.core} MB"/>
71
72 <!-- calculate the size of: imagemagick -->
73 <length property="component.bytesize.imagemagick" mode="all"><fileset file="${basedir}/components/imagemagick.comp"/></length>
74 <math result="component.megabytesize.imagemagick" operand1="${component.bytesize.imagemagick}" operation="/" operand2="1048576" datatype="int"/>
75 <property name="component.size.imagemagick" value="${component.megabytesize.imagemagick} MB"/>
76
77 <!-- calculate the size of: ghostscript -->
78 <length property="component.bytesize.ghostscript" mode="all"><fileset file="${basedir}/components/ghostscript.comp"/></length>
79 <math result="component.megabytesize.ghostscript" operand1="${component.bytesize.ghostscript}" operation="/" operand2="1048576" datatype="int"/>
80 <property name="component.size.ghostscript" value="${component.megabytesize.ghostscript} MB"/>
81
82 <!-- calculate the size of: tomcat -->
83 <length property="component.bytesize.tomcat" mode="all"><fileset file="${basedir}/components/tomcat.comp"/></length>
84 <math result="component.megabytesize.tomcat" operand1="${component.bytesize.tomcat}" operation="/" operand2="1048576" datatype="int"/>
85 <property name="component.size.tomcat" value="${component.megabytesize.tomcat} MB"/>
86
87 <!-- make the installer descriptors relevant to the current os -->
88 <dcff file="installer/antinstall-config.xml" startTag="&lt;!--\s*if\s*(?!.*${rk.os})[^ ]+\s*--&gt;" endTag="&lt;!--\s*/if\s*--&gt;" />
89 <dcff file="installer/build.xml" startTag="&lt;!--\s*if\s*(?!.*${rk.os})[^ ]+\s*--&gt;" endTag="&lt;!--\s*/if\s*--&gt;" />
90
91 <!-- put the concrete values of things in the config -->
92 <rsr>
93 <fileset dir="${basedir}/installer" includes="*.xml"/>
94 <job pattern="@version@" replacement="${version}"/>
95 <job pattern="@component.size.core@" replacement="${component.size.core}"/>
96 <job pattern="@component.size.tomcat@" replacement="${component.size.tomcat}"/>
97 <job pattern="@component.size.imagemagick@" replacement="${component.size.imagemagick}"/>
98 <job pattern="@component.size.ghostscript@" replacement="${component.size.ghostscript}"/>
99 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
100 <job pattern="@java.extracted@" replacement="${java.extracted}"/>
101 </rsr>
102
103 <!-- put the concrete values of things in the text -->
104 <rsr>
105 <fileset dir="${basedir}/installer/classes/resources" includes="*.properties"/>
106 <job pattern="@version@" replacement="${version}"/>
107 <job pattern="@version.major@" replacement="${version.major}"/>
108 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
109 <job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
110 <job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
111 <job pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
112 <job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
113 <job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
114 </rsr>
115
116 <!-- now ready to run "compile-*-installer" targets -->
117
118 <antcall target="compile-binary-installer"/>
119
120 </target>
121
122 <target name="compile-binary-installer">
123
124 <!-- strip out lines for the cdrom installer -->
125 <copy file="installer/antinstall-config.xml" tofile="installer/antinstall-config-binary.xml" overwrite="true"/>
126 <dcff file="installer/antinstall-config-binary.xml" startTag=".*&lt;!-- start cdrom --&gt;.*" endTag=".*&lt;!-- end cdrom --&gt;.*" />
127 <copy file="installer/build.xml" tofile="installer/build-binary.xml" overwrite="true"/>
128 <dcff file="installer/build-binary.xml" startTag=".*&lt;!-- start cdrom --&gt;.*" endTag=".*&lt;!-- end cdrom --&gt;.*" />
129
130 <!-- create insaller jar with ant-installer's ant task -->
131 <installer file="installer/Greenstone-${version}-${os.suffix}.jar"
132 compress="true"
133 extractType="NonExtractor"
134 installConfig="installer/antinstall-config-binary.xml"
135 buildFile="installer/build-binary.xml"
136 antInstallLib="${rk.home}/shared/core/ant-installer/lib"
137 antLib="${ant.home}/lib"
138 validateConfig="true"
139 icons="bluecurve">
140
141 <zipfileset dir="installer/classes" includes="**/*" />
142 <zipfileset dir="components" includes="*.lzma"/>
143 </installer>
144
145 </target>
146
147 <target name="compile-cdrom-installer">
148
149 <!-- strip out lines for the binary(web) installer -->
150 <copy file="installer/antinstall-config.xml" tofile="installer/antinstall-config-cdrom.xml"/>
151 <dcff file="installer/antinstall-config-cdrom.xml" startTag=".*&lt;!-- start web --&gt;.*" endTag=".*&lt;!-- end web --&gt;.*" />
152 <copy file="installer/build.xml" tofile="installer/build-cdrom.xml"/>
153 <dcff file="installer/build-cdrom.xml" startTag=".*&lt;!-- start web --&gt;.*" endTag=".*&lt;!-- end web --&gt;.*" />
154
155 <installer file="installer/cdrom.jar"
156 compress="true"
157 extractType="NonExtractor"
158 installConfig="installer/antinstall-config-cdrom.xml"
159 buildFile="installer/build-cdrom.xml"
160 antInstallLib="${rk.home}/shared/core/ant-installer/lib"
161 antLib="${ant.home}/lib"
162 validateConfig="true"
163 icons="bluecurve">
164
165 <zipfileset dir="installer/classes" includes="**/*" />
166 </installer>
167
168 </target>
169
170</project>
Note: See TracBrowser for help on using the repository browser.