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

Last change on this file since 21634 was 21634, checked in by oranfry, 12 years ago

fixes

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