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

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

fixes to rk2 for linux and mac

File size: 7.5 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 <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 <unzip src="components/core.comp" dest="cdrom/dist/Software/core/all" overwrite="true"/>
35 <move todir="cdrom/dist/Software/core/linux" overwrite="true">
36 <fileset dir="cdrom/dist/Software/core/all">
37 <include name="bin/linux"/>
38 <include name="bin/linux/**/*"/>
39 <include name="bin/windows"/>
40 <include name="bin/windows/**/*"/>
41 <include name="cgi-bin/library.cgi"/>
42 <include name="cgi-bin/oaiserver.cgi"/>
43 <include name="apache-httpd/**/*"/>
44 <include name="*.sh"/>
45 <include name="*.csh"/>
46 <include name="*.bash"/>
47 </fileset>
48 </move>
49 <!-- delete the apache manual to save space -->
50 <delete dir="cdrom/dist/Software/core/linux/apache-httpd/linux/manual"/>
51
52 <!-- core windows -->
53 <else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
54 <unzip src="components/core.comp" dest="cdrom/dist/Software/core/windows" overwrite="true">
55 <patternset>
56 <include name="bin/windows"/>
57 <include name="server.exe"/>
58 <include name="bin/windows/**/*"/>
59 <include name="cgi-bin/library.cgi"/>
60 <include name="cgi-bin/oaiserver.cgi"/>
61 <include name="*.bat"/>
62 <include name="gli/*.bat"/>
63 </patternset>
64 </unzip>
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="apache-httpd"/>
77 <include name="apache-httpd/**/*"/>
78 <include name="*.sh"/>
79 <include name="*.csh"/>
80 <include name="*.bash"/>
81 </patternset>
82 </unzip>
83 <!-- delete the httpd manual to save space -->
84 <delete dir="cdrom/dist/Software/core/mac/apache-httpd/darwin/manual"/>
85
86 </if></else></if></else></if>
87
88 <!-- imagemagick -->
89 <mkdir dir="cdrom/dist/Software/imagemagick/${rk.os}"/>
90 <unzip src="components/imagemagick.comp" dest="cdrom/dist/Software/imagemagick/${rk.os}" overwrite="true"/>
91
92 <!-- ghostscript: windows and mac only -->
93 <if><bool><or><equals arg1="${rk.os}" arg2="windows"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
94 <mkdir dir="cdrom/dist/Software/ghostscript/${rk.os}"/>
95 <unzip src="components/ghostscript.comp" dest="cdrom/dist/Software/ghostscript/${rk.os}" overwrite="true"/>
96 </if>
97
98 <!-- jre linux -->
99 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
100 <mkdir dir="cdrom/dist/Java/Linux"/>
101 <exec executable="cp">
102 <arg value="${rk.home}/shared/linux/jre_bin"/>
103 <arg value="cdrom/dist/Java/Linux"/>
104 </exec>
105 <!--
106 don't extract to save space
107 <exec dir="cdrom/dist/Java/Linux" executable="${rk.home}/shared/linux/jre_bin"/>
108 <exec dir="cdrom/dist/Java/Linux" executable="tar"><arg value="-xf"/><arg value="jre.tar"/></exec>
109 <delete file="cdrom/dist/Java/Linux/jre.tar"/>
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 </target>
124
125 <target name="compile-cdrom-wrapper">
126
127 <!-- windows -->
128 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
129 <copy todir="cdrom/build" overwrite="true">
130 <fileset dir="${rk.home}/shared/windows/wrapper"/>
131 <fileset dir="${rk.home}/shared/greenstone2/wrapper" includes="*.bmp"/>
132 <fileset dir="${rk.home}/shared/greenstone2/icon" includes="icon.ico"/>
133 <fileset dir="${rk.home}/shared/core/search4j" includes="libsearch4j.cpp,libsearch4j.h"/>
134 </copy>
135 <exec executable="rc" dir="cdrom/build">
136 <arg line="wrapper.rc"/>
137 </exec>
138 <exec executable="cl" dir="cdrom/build">
139 <arg line="/c -GX -DCDROM wrapper.cpp"/>
140 </exec>
141 <exec executable="link" dir="cdrom/build">
142 <arg line="/OUT:../dist/Greenstone-${version}-windows.exe gdi32.lib advapi32.lib shell32.lib user32.lib wrapper.obj wrapper.RES"/>
143 </exec>
144
145 <!-- linux -->
146 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
147 <copy file="${rk.home}/shared/linux/wrapper.cpp" todir="cdrom/build" overwrite="true"/>
148
149 <echo level="info">compile the cdrom wrapper</echo>
150 <exec executable="g++" dir="cdrom/build">
151 <arg line="-Wall -static -static-libgcc -c -DCDROM -o wrapper.o wrapper.cpp"/>
152 </exec>
153
154 <echo level="info">link the compiled code</echo>
155 <exec executable="g++" dir="cdrom/build">
156 <arg line="-static -static-libgcc -o ../dist/Greenstone-${version}-linux wrapper.o"/>
157 </exec>
158
159 <!-- mac -->
160 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
161
162 <mkdir dir="wrapped-installer/cdrom"/>
163 <!-- create app for cdrom installer -->
164 <copy todir="cdrom/dist/Greenstone-${version}-MacOS.app"><fileset dir="${rk.home}/shared/mac/Wrapper.app"/></copy>
165 <copy todir="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/Resources" file="${rk.home}/shared/greenstone2/icon/icon.icns"/>
166 <chmod file="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/MacOS/JavaApplicationStub" perm="+x"/>
167
168 <!-- copy bundled files -->
169 <copy todir="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/Resources/Java" file="${basedir}/installer/cdrom.jar"/>
170
171 <!-- substitute in real values -->
172 <rsr file="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/Info.plist" pattern="@jar@" replacement="cdrom.jar"/>
173 <rsr file="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/Info.plist" pattern="@version@" replacement="${version}"/>
174
175 </if></else></if></else></if>
176
177 </target>
178
179
180
181 <target name="create-cdrom-components-archive">
182 <mkdir dir="products"/>
183 <!-- windows -->
184 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
185 <tar destfile="products/cdrom-components-${version}-windows.tar.gz" compression="gzip">
186 <tarfileset dir="cdrom/dist"><include name="**/*"/></tarfileset>
187 </tar>
188
189 <!-- linux and mac -->
190 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
191 <exec dir="cdrom/dist" executable="bash">
192 <arg value="-c"/>
193 <arg value="tar -czf ../../products/cdrom-components-${version}-linux.tar.gz *"/>
194 </exec>
195 </if></else></if>
196 </target>
197
198
199</project>
Note: See TracBrowser for help on using the repository browser.