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

Last change on this file since 21394 was 21394, checked in by oranfry, 15 years ago

moving specific stuff out of general area

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