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

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

Adding a few more 64-bit release kit changes

File size: 8.0 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 </patternset>
60 </unzip>
61
62 <unzip src="components/core.comp" dest="cdrom/dist/Software/core/full-windows" overwrite="true"/>
63
64 <!-- core mac -->
65 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
66 <unzip src="components/core.comp" dest="cdrom/dist/Software/core/mac" overwrite="true">
67 <patternset>
68 <include name="bin/darwin"/>
69 <include name="bin/darwin/**/*"/>
70 <include name="bin/windows"/>
71 <include name="bin/windows/**/*"/>
72 <include name="cgi-bin/library.cgi"/>
73 <include name="cgi-bin/oaiserver.cgi"/>
74 <include name="*.sh"/>
75 <include name="*.csh"/>
76 <include name="*.bash"/>
77 </patternset>
78 </unzip>
79 <!-- delete the httpd manual to save space -->
80 <delete dir="cdrom/dist/Software/core/mac/apache-httpd/darwin/manual"/>
81
82 </if></else></if></else></if>
83
84 <!-- imagemagick -->
85 <mkdir dir="cdrom/dist/Software/imagemagick/${rk.os}"/>
86 <unzip src="components/imagemagick.comp" dest="cdrom/dist/Software/imagemagick/${rk.os}" overwrite="true"/>
87
88 <!-- ghostscript: windows and mac only -->
89 <if><bool><or><equals arg1="${rk.os}" arg2="windows"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
90 <mkdir dir="cdrom/dist/Software/ghostscript/${rk.os}"/>
91 <unzip src="components/ghostscript.comp" dest="cdrom/dist/Software/ghostscript/${rk.os}" overwrite="true"/>
92 </if>
93
94 <!-- apache httpd -->
95 <unzip src="components/apachehttpd.comp" dest="cdrom/dist/Software" overwrite="true"/>
96
97 <!-- jre linux -->
98 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
99 <mkdir dir="cdrom/dist/Java/Linux"/>
100 <exec executable="cp">
101 <arg value="${rk.home}/shared/linux/jre_bin${extension_x64}"/>
102 <arg value="cdrom/dist/Java/Linux"/>
103 </exec>
104 <!--
105 don't extract to save space
106 <exec dir="cdrom/dist/Java/Linux" executable="${rk.home}/shared/linux/jre_bin"/>
107 <exec dir="cdrom/dist/Java/Linux" executable="tar"><arg value="-xf"/><arg value="jre.tar"/></exec>
108 <delete file="cdrom/dist/Java/Linux/jre.tar"/>
109 -->
110
111 <!-- jre windows -->
112 <else><if><bool><or><equals arg1="${rk.os}" arg2="windows"/></or></bool>
113 <mkdir dir="cdrom/dist/Java/Windows"/>
114 <exec dir="cdrom/dist/Java/Windows" executable="${rk.home}/shared/windows/wrapper/jre.exe"/>
115
116 </if></else></if>
117
118 <!-- jar installer: windows and linux only -->
119 <if><bool><or><equals arg1="${rk.os}" arg2="windows"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
120 <copy file="installer/cdrom.jar" tofile="cdrom/dist/Java/Jars/${rk.os}.jar"/>
121 </if>
122
123 <!-- compile cdrom wrapper -->
124 <!-- (windows) -->
125 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
126 <copy todir="cdrom/build" overwrite="true">
127 <fileset dir="${rk.home}/shared/windows/wrapper"/>
128 <fileset dir="${rk.home}/shared/core/icon" includes="icon.ico"/>
129 <fileset dir="${rk.home}/shared/core/search4j" includes="libsearch4j.cpp,libsearch4j.h"/>
130 </copy>
131 <exec executable="rc" dir="cdrom/build">
132 <arg line="wrapper.rc"/>
133 </exec>
134 <exec executable="cl" dir="cdrom/build">
135 <arg line="/c -GX -DCDROM wrapper.cpp"/>
136 </exec>
137 <exec executable="link" dir="cdrom/build">
138 <arg line="/OUT:../dist/Greenstone-${version}${version-extra}-windows.exe gdi32.lib advapi32.lib shell32.lib user32.lib wrapper.obj wrapper.RES"/>
139 </exec>
140
141 <!-- (linux) -->
142 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
143 <copy file="${rk.home}/shared/linux/wrapper.cpp" todir="cdrom/build" overwrite="true"/>
144
145 <echo level="info">compile the cdrom wrapper</echo>
146 <exec executable="g++" dir="cdrom/build">
147 <arg line="-Wall -static -static-libgcc -c -DCDROM -o wrapper.o wrapper.cpp"/>
148 </exec>
149
150 <echo level="info">link the compiled code</echo>
151 <exec executable="g++" dir="cdrom/build">
152 <arg line="-static -static-libgcc -o ../dist/Greenstone-${version}${version-extra}-linux wrapper.o"/>
153 </exec>
154
155 <!-- (mac) -->
156 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
157
158 <mkdir dir="wrapped-installer/cdrom"/>
159 <!-- create app for cdrom installer -->
160 <copy todir="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app"><fileset dir="${rk.home}/shared/mac/Wrapper.app"/></copy>
161 <copy todir="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/Resources" file="${rk.home}/shared/core/icon/icon.icns"/>
162 <chmod file="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/MacOS/JavaApplicationStub" perm="+x"/>
163
164 <!-- copy bundled files -->
165 <copy todir="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/Resources/Java" file="${basedir}/installer/cdrom.jar"/>
166
167 <!-- substitute in real values -->
168 <rsr file="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/Info.plist" pattern="@jar@" replacement="cdrom.jar"/>
169 <rsr file="cdrom/dist/Greenstone-${version}${version-extra}-MacOS.app/Contents/Info.plist" pattern="@version@" replacement="${version}"/>
170
171 </if></else></if></else></if>
172
173
174 <!-- create cdrom components -archive -->
175 <mkdir dir="products"/>
176 <!-- (windows) -->
177 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
178 <tar destfile="products/cdrom-components-${version}${version-extra}-windows.tar.gz" compression="gzip">
179 <tarfileset dir="cdrom/dist">
180 <include name="**/*"/>
181 <exclude name="**/full-windows"/>
182 <exclude name="**/full-windows/**/*"/>
183 </tarfileset>
184 </tar>
185 <tar destfile="products/cdrom-components-${version}${version-extra}-full-windows.tar.gz" compression="gzip">
186 <tarfileset dir="cdrom/dist">
187 <include name="**/*"/>
188 <exclude name="**/Software/core/windows"/>
189 <exclude name="**/Software/core/windows/**/*"/>
190 </tarfileset>
191 </tar>
192
193 <!-- (linux and mac) -->
194 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
195 <exec dir="cdrom/dist" executable="bash">
196 <arg value="-c"/>
197 <arg value="tar -czf ../../products/cdrom-components-${version}${version-extra}-${rk.os}${extension-x64}.tar.gz *"/>
198 </exec>
199 </if></else></if>
200 </target>
201
202</project>
Note: See TracBrowser for help on using the repository browser.