source: main/trunk/release-kits/kits/rk2/ant-scripts/create-cdrom-components.xml@ 24119

Last change on this file since 24119 was 24119, checked in by sjm84, 10 years ago

Making sure the uninstaller is included in the windows CD installation

File size: 8.1 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="rk2-create-cdrom-components" default="create-cdrom-components">
3
4 <!--
5 cd components
6 produce components for cdrom distributions, to be picked up and used by cdrk2 release kit
7 split components into linux only files (linux) and general files (all)
8 -->
9
10 <target name="create-cdrom-components" depends="init,gs2-init">
11 <antcall target="compile-cdrom-installer"/> <!-- from init -->
12
13 <!-- clean up -->
14 <delete dir="cdrom"/>
15
16 <!-- setup directory structure -->
17 <mkdir dir="cdrom/build"/>
18 <mkdir dir="cdrom/dist/Software"/>
19 <mkdir dir="cdrom/dist/Java/Jars"/>
20
21 <!-- create core component -->
22 <mkdir dir="cdrom/dist/Software/core/all"/>
23 <mkdir dir="cdrom/dist/Software/core/${rk.os}"/>
24
25 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
26 <mkdir dir="cdrom/dist/Software/core/full-windows"/>
27 </if>
28
29 <!-- core linux -->
30 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
31 <unzip src="components/core.comp" dest="cdrom/dist/Software/core/all" overwrite="true"/>
32 <move todir="cdrom/dist/Software/core/linux" overwrite="true">
33 <fileset dir="cdrom/dist/Software/core/all">
34 <include name="bin/linux"/>
35 <include name="bin/linux/**/*"/>
36 <include name="bin/windows"/>
37 <include name="bin/windows/**/*"/>
38 <include name="cgi-bin/library.cgi"/>
39 <include name="cgi-bin/oaiserver.cgi"/>
40 <include name="*.sh"/>
41 <include name="*.csh"/>
42 <include name="*.bash"/>
43 </fileset>
44 </move>
45 <!-- delete the apache manual to save space -->
46 <delete dir="cdrom/dist/Software/core/linux/apache-httpd/linux/manual"/>
47
48 <!-- core windows -->
49 <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
50 <unzip src="components/core.comp" dest="cdrom/dist/Software/core/windows" overwrite="true">
51 <patternset>
52 <include name="bin/windows"/>
53 <include name="bin/windows/**/*"/>
54 <include name="server.exe"/>
55 <include name="cgi-bin/library.cgi"/>
56 <include name="cgi-bin/oaiserver.cgi"/>
57 <include name="*.bat"/>
58 <include name="gli/*.bat"/>
59 <include name="uninstall/*.bat"/>
60 <include name="uninstall/*.uninstall"/>
61 </patternset>
62 </unzip>
63
64 <unzip src="components/core.comp" dest="cdrom/dist/Software/core/full-windows" overwrite="true"/>
65
66 <!-- core mac -->
67 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
68 <unzip src="components/core.comp" dest="cdrom/dist/Software/core/mac" overwrite="true">
69 <patternset>
70 <include name="bin/darwin"/>
71 <include name="bin/darwin/**/*"/>
72 <include name="bin/windows"/>
73 <include name="bin/windows/**/*"/>
74 <include name="cgi-bin/library.cgi"/>
75 <include name="cgi-bin/oaiserver.cgi"/>
76 <include name="*.sh"/>
77 <include name="*.csh"/>
78 <include name="*.bash"/>
79 </patternset>
80 </unzip>
81 <!-- delete the httpd manual to save space -->
82 <delete dir="cdrom/dist/Software/core/mac/apache-httpd/darwin/manual"/>
83
84 </if></else></if></else></if>
85
86 <!-- imagemagick -->
87 <mkdir dir="cdrom/dist/Software/imagemagick/${rk.os}"/>
88 <unzip src="components/imagemagick.comp" dest="cdrom/dist/Software/imagemagick/${rk.os}" overwrite="true"/>
89
90 <!-- ghostscript: windows and mac only -->
91 <if><bool><or><equals arg1="${rk.os}" arg2="windows"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
92 <mkdir dir="cdrom/dist/Software/ghostscript/${rk.os}"/>
93 <unzip src="components/ghostscript.comp" dest="cdrom/dist/Software/ghostscript/${rk.os}" overwrite="true"/>
94 </if>
95
96 <!-- apache httpd -->
97 <unzip src="components/apachehttpd.comp" dest="cdrom/dist/Software" overwrite="true"/>
98
99 <!-- jre linux -->
100 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
101 <mkdir dir="cdrom/dist/Java/Linux"/>
102 <exec executable="cp">
103 <arg value="${rk.home}/shared/linux/jre_bin${extension_x64}"/>
104 <arg value="cdrom/dist/Java/Linux"/>
105 </exec>
106 <!--
107 don't extract to save space
108 <exec dir="cdrom/dist/Java/Linux" executable="${rk.home}/shared/linux/jre_bin"/>
109 <exec dir="cdrom/dist/Java/Linux" executable="tar"><arg value="-xf"/><arg value="jre.tar"/></exec>
110 <delete file="cdrom/dist/Java/Linux/jre.tar"/>
111 -->
112
113 <!-- jre windows -->
114 <else><if><bool><or><equals arg1="${rk.os}" arg2="windows"/></or></bool>
115 <mkdir dir="cdrom/dist/Java/Windows"/>
116 <exec dir="cdrom/dist/Java/Windows" executable="${rk.home}/shared/windows/wrapper/jre.exe"/>
117
118 </if></else></if>
119
120 <!-- jar installer: windows and linux only -->
121 <if><bool><or><equals arg1="${rk.os}" arg2="windows"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
122 <copy file="installer/cdrom.jar" tofile="cdrom/dist/Java/Jars/${rk.os}.jar"/>
123 </if>
124
125 <!-- compile cdrom wrapper -->
126 <!-- (windows) -->
127 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
128 <copy todir="cdrom/build" overwrite="true">
129 <fileset dir="${rk.home}/shared/windows/wrapper"/>
130 <fileset dir="${rk.home}/shared/core/icon" includes="icon.ico"/>
131 <fileset dir="${rk.home}/shared/core/search4j" includes="libsearch4j.cpp,libsearch4j.h"/>
132 </copy>
133 <exec executable="rc" dir="cdrom/build">
134 <arg line="wrapper.rc"/>
135 </exec>
136 <exec executable="cl" dir="cdrom/build">
137 <arg line="/c -GX -DCDROM wrapper.cpp"/>
138 </exec>
139 <exec executable="link" dir="cdrom/build">
140 <arg line="/OUT:../dist/Greenstone-${version}${version-extra}-windows.exe gdi32.lib advapi32.lib shell32.lib user32.lib wrapper.obj wrapper.RES"/>
141 </exec>
142
143 <!-- (linux) -->
144 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
145 <copy file="${rk.home}/shared/linux/wrapper.cpp" todir="cdrom/build" overwrite="true"/>
146
147 <echo level="info">compile the cdrom wrapper</echo>
148 <exec executable="g++" dir="cdrom/build">
149 <arg line="-Wall -static -static-libgcc -c -DCDROM -o wrapper.o wrapper.cpp"/>
150 </exec>
151
152 <echo level="info">link the compiled code</echo>
153 <exec executable="g++" dir="cdrom/build">
154 <arg line="-static -static-libgcc -o ../dist/Greenstone-${version}${version-extra}-linux wrapper.o"/>
155 </exec>
156
157 <!-- (mac) -->
158 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
159
160 <mkdir dir="wrapped-installer/cdrom"/>
161 <!-- create app for cdrom installer -->
162 <copy todir="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app"><fileset dir="${rk.home}/shared/mac/Wrapper.app"/></copy>
163 <copy todir="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/Resources" file="${rk.home}/shared/core/icon/icon.icns"/>
164 <chmod file="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/MacOS/JavaApplicationStub" perm="+x"/>
165
166 <!-- copy bundled files -->
167 <copy todir="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/Resources/Java" file="${basedir}/installer/cdrom.jar"/>
168
169 <!-- substitute in real values -->
170 <rsr file="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/Info.plist" pattern="@jar@" replacement="cdrom.jar"/>
171 <rsr file="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/Info.plist" pattern="@version@" replacement="${version}"/>
172
173 </if></else></if></else></if>
174
175
176 <!-- create cdrom components -archive -->
177 <mkdir dir="products"/>
178 <!-- (windows) -->
179 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
180 <tar destfile="products/cdrom-components-${version}${version-extra}-windows.tar.gz" compression="gzip">
181 <tarfileset dir="cdrom/dist">
182 <include name="**/*"/>
183 <exclude name="**/full-windows"/>
184 <exclude name="**/full-windows/**/*"/>
185 </tarfileset>
186 </tar>
187 <tar destfile="products/cdrom-components-${version}${version-extra}-full-windows.tar.gz" compression="gzip">
188 <tarfileset dir="cdrom/dist">
189 <include name="**/*"/>
190 <exclude name="**/Software/core/windows"/>
191 <exclude name="**/Software/core/windows/**/*"/>
192 </tarfileset>
193 </tar>
194
195 <!-- (linux and mac) -->
196 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
197 <exec dir="cdrom/dist" executable="bash">
198 <arg value="-c"/>
199 <arg value="tar -czf ../../products/cdrom-components-${version}${version-extra}-${rk.os}${extension-x64}.tar.gz *"/>
200 </exec>
201 </if></else></if>
202 </target>
203
204</project>
Note: See TracBrowser for help on using the repository browser.