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