source: main/trunk/release-kits/kits/rk3/installer/build.xml@ 24180

Last change on this file since 24180 was 24180, checked in by xiao, 13 years ago

copy flax.aux.server property into global.properties

File size: 14.4 KB
Line 
1<?xml version="1.0"?>
2<!--
3This is the build.xml run by AntInstaller for the installer
4-->
5<project name="Installation">
6
7 <!-- this is required to pick up the properties generated during the install pages -->
8 <property file="${basedir}/ant.install.properties"/>
9
10 <!-- custom tasks -->
11 <path id="project.classpath"><pathelement path="${antinstaller.jar}"/></path>
12
13 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
14 <!-- if linux|mac -->
15 <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
16 <!-- /if -->
17 <!-- if windows -->
18 <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
19 <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
20 <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
21 <!-- /if -->
22
23 <!-- create a local and strictly unix installDir String -->
24 <path id="installDir.path"><pathelement location="${installDir}"/></path>
25 <property name="installDir.local" refid="installDir.path"/>
26 <pathconvert targetos="unix" property="installDir.unix" refid="installDir.path"/>
27
28 <!-- if windows -->
29 <!-- load windows properties -->
30 <winprops/>
31 <!-- /if -->
32
33 <!-- work out whether a jre is bundled with this installer -->
34 <available file="../jre/bin" property="bundled.java.exists"/>
35
36 <!-- determine if there is an existing installation in the installDir-->
37 <available file="${installDir}\installation.properties" property="is.overinstall"/>
38
39 <!-- target to copy the bundled jre into place -->
40 <target name="Initialising" if="bundled.java.exists">
41 <mkdir dir="${installDir}"/>
42 <copy todir="${installDir}/packages/jre" failonerror="false">
43 <fileset dir="../jre"/>
44 </copy>
45 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
46 </target>
47
48 <!-- target to load in the messages left by the last installation -->
49 <target name="Looking For Previous Installation" if="is.overinstall">
50 <property file="${installDir}\installation.properties"/>
51 <delete dir="${installed.startmenu.path}" failonerror="false"/>
52 </target>
53
54 <target name="Installing Core System">
55
56 <!-- rip out build.xml to the temp dir so we can fake and <antcall> with <ant> -->
57 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="build.xml"/></patternset></unzip>
58
59
60 <!-- if windows -->
61 <echo>Figuring out the start menu path</echo>
62 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
63 <path id="startmenu.path.path" path="${startmenu.path}"/>
64 <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
65
66 <echo>Extracting 7za tool</echo>
67 <unzip src="${antinstaller.jar}" dest="${basedir}">
68 <patternset><include name="7za.exe"/></patternset>
69 </unzip>
70 <!-- /if -->
71
72 <echo>Extracting core component</echo>
73 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
74 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec><!-- /if -->
75 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/><!-- /if -->
76 <delete file="core.lzma"/>
77 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
78 <delete file="core.comp"/>
79
80 <echo>Setting binaries to executable</echo>
81 <chmod dir="${installDir}" includes="*.sh" perm="775"/>
82 <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
83 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
84 <!-- if linux -->
85 <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
86 <!-- /if -->
87 <!-- if mac -->
88 <chmod dir="${installDir}/gs2build/bin/darwin" includes="*" perm="775"/>
89 <!-- /if -->
90 <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
91 <!-- GLI START -->
92 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
93 <!-- GLI END -->
94
95 <!--<chmod file="${installDir}/packages/ant/bin/ant" perm="775"/>-->
96 <!--
97 source is not included for now
98 <chmod dir="${installDir}/gs2build" includes="**/configure" perm="775"/>
99 <chmod dir="${installDir}/gs2build/common-src/packages/gdbm/gdbm-1.8.3" includes="mkinstalldirs" perm="775"/>
100 <chmod file="${installDir}/src/packages/javagdbm/configure" perm="775"/>
101 -->
102
103 <echo>Setting tomcat ports</echo>
104 <rsr file="${installDir}/build.properties">
105 <job pattern="^(tomcat\.server[=:]).*" replacement="$1${tomcat.server}" />
106 <job pattern="^(tomcat\.port[=:]).*" replacement="$1${tomcat.port}" />
107 <job pattern="^(tomcat\.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
108 </rsr>
109
110 <echo>Setting up global properties</echo>
111 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
112 <rsr file="${installDir}/web/WEB-INF/classes/global.properties">
113 <job pattern="^(gsdl3\.home[:=]).*" replacement="$1${installDir.unix}/web" />
114 <job pattern="^(tomcat.server[:=]).*" replacement="$1${tomcat.server}" />
115 <job pattern="^(tomcat\.port[:=]).*" replacement="$1${tomcat.port}" />
116 </rsr>
117 <!-- FLAX START -->
118 <echo>Copying flax.aux.server property from build.properties to global.properties</echo>
119 <concat destfile="${installDir}/web/WEB-INF/classes/global.properties" append="true" fixlastline="yes">flax.aux.server=${flax.aux.server}</concat>
120 <!-- FLAX END -->
121
122 <echo>Setting up log4j properties</echo>
123 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
124 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.unix}/web" />
125
126 <!-- if windows -->
127 <echo message="Setting GSDLHOME in gs2build\setup.bat"/>
128 <!-- No quotes around GSDLHOME filepath in setup.bat. since the set operations of batchfiles don't want spaces in their assignments, and where quotes are needed in setup.bat, setup.bat handles this itself -->
129 <rsr file="${installDir}/gs2build/setup.bat" pattern="&quot;?\*\*GSDLHOME\*\*&quot;?" replacement="${installDir.local}\gs2build" />
130 <!-- /if -->
131
132 <!-- GLI START -->
133 <echo>Creating the english dictionary</echo>
134 <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
135 <!-- GLI END -->
136
137 <echo>Creating usage.txt</echo>
138 <echo file="${installDir}/gs2build/etc/usage.txt"></echo>
139
140 <echo>Creating installation properties file</echo>
141 <echo file="${installDir}\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
142
143 <echo>Finished</echo>
144
145 </target>
146
147 <target name="Installing ImageMagick">
148
149 <echo>Installing ImageMagick</echo>
150 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
151 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec><!-- /if -->
152 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/><!-- /if -->
153 <delete file="imagemagick.lzma"/>
154 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}"/>
155 <delete file="imagemagick.comp"/>
156
157 <echo>Setting binaries to executable</echo>
158 <!-- if linux -->
159 <chmod dir="${installDir}/gs2build/bin/linux/imagemagick/bin" includes="*" perm="775"/>
160 <!-- /if -->
161 <!-- if mac -->
162 <chmod dir="${installDir}/gs2build/bin/darwin/imagemagick/bin" includes="*" perm="775"/>
163 <!-- /if -->
164
165 </target>
166
167 <!-- NO FLAX START -->
168
169 <target name="Installing Ghostscript">
170
171 <echo>Installing Ghostscript</echo>
172 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
173 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec><!-- /if -->
174 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/><!-- /if -->
175 <delete file="ghostscript.lzma"/>
176 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}"/>
177 <delete file="ghostscript.comp"/>
178
179 <echo>Setting binaries to executable</echo>
180 <!-- if linux -->
181 <chmod dir="${installDir}/gs2build/bin/linux/ghostscript/bin" includes="*" perm="775"/>
182 <!-- /if -->
183 <!-- if mac -->
184 <chmod dir="${installDir}/gs2build/bin/darwin/ghostscript/bin" includes="*" perm="775"/>
185 <!-- /if -->
186
187 </target>
188
189 <!-- NO FLAX END -->
190
191 <!-- start amp -->
192
193 <target name="Installing AMP">
194 <echo>Installing Apache, MySQL and PHP</echo>
195 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="amp.lzma"/></patternset></unzip>
196 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x amp.lzma"/></exec><!-- /if -->
197 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/amp.lzma" output="${basedir}/amp.comp"/><!-- /if -->
198 <delete file="amp.lzma"/>
199 <unzip src="${basedir}/amp.comp" dest="${installDir}/ext/amp"/>
200 <delete file="amp.comp"/>
201
202 <!-- if linux|mac -->
203 <echo>Setting binaries to executable</echo>
204 <chmod dir="${installDir}/ext/amp" includes="*" perm="775"/>
205 <!-- /if -->
206 </target>
207
208 <!-- end amp -->
209
210 <target name="Installing Tomcat">
211
212 <echo>Installing Tomcat (packages/tomcat)</echo>
213 <mkdir dir="packages"/>
214 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="tomcat.lzma"/></patternset></unzip>
215 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x tomcat.lzma"/></exec><!-- /if -->
216 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/tomcat.lzma" output="${basedir}/tomcat.comp"/><!-- /if -->
217 <delete file="tomcat.lzma"/>
218 <unzip src="${basedir}/tomcat.comp" dest="${installDir}"/>
219 <delete file="tomcat.comp"/>
220
221
222 <echo>Changing tomcat ports tomcat's server.xml</echo>
223 <copy file="${installDir}/resources/tomcat/server_tomcat6.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
224 <rsr file="${installDir}/packages/tomcat/conf/server.xml">
225 <job pattern="@port@" replacement="${tomcat.port}"/>
226 <job pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}"/>
227 </rsr>
228
229 <!-- FLAX START -->
230 <echo>Copying over FlaxWebService.wsdl and changing tomcat server/ports</echo>
231 <copy file="${installDir}/flax-resources/FlaxWebService.wsdl" tofile="${installDir}/web/FlaxWebService.wsdl" overwrite="true"/>
232 <rsr file="${installDir}/web/FlaxWebService.wsdl">
233 <job pattern="@flaxpublicserver@" replacement="${tomcat.server}"/>
234 <job pattern="@flaxpublicport@" replacement="${tomcat.port}"/>
235 </rsr>
236 <!-- FLAX END -->
237
238 <echo>Copying greenstone3.xml to tomcat directory</echo>
239 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
240 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}${file.separator}web" />
241 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@privilegedattribute@" replacement="privileged='true'" />
242 <echo>Set binaries to executable</echo>
243 <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
244
245 </target>
246
247 <target name="Installing Start Menu Shortcuts">
248
249 <echo>Installing Start Menu Shortcuts</echo>
250
251 <!-- NO FLAX START -->
252
253 <mkdir dir="${startmenu.path}\Documentation"/>
254
255 <shortcut
256 file="${startmenu.path}\Greenstone3 Server.lnk"
257 execute="${installDir}\gs3-server.bat"
258 workingDirectory="${installDir}"
259 iconFile="${installDir}\resources\images\server.ico"
260 iconIndex="0" />
261
262 <shortcut
263 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
264 execute="${installDir}\gli\gli.bat"
265 workingDirectory="${installDir}\gli"
266 iconFile="${installDir}\resources\images\librarian.ico"
267 iconIndex="0" />
268
269 <shortcut
270 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
271 execute="${installDir}\gli\gems.bat"
272 workingDirectory="${installDir}\gli"
273 iconFile="${installDir}\resources\images\metadata.ico"
274 iconIndex="0" />
275
276 <shortcut
277 file="${startmenu.path}\Uninstall.lnk"
278 execute="${installDir}\uninstall\Uninstall.bat"
279 workingDirectory="${installDir}"
280 iconFile="${installDir}\resources\images\uninstall.ico"
281 iconIndex="0" />
282
283 <shortcut
284 file="${startmenu.path}\Documentation\README.lnk"
285 execute="${installDir}\README.txt" />
286
287 <shortcut
288 file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
289 execute="${installDir}\documentation\manual\manual.pdf" />
290
291 <shortcut
292 file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
293 execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
294
295 <shortcut
296 file="${startmenu.path}\Documentation\Greenstone Wiki.url"
297 url="http://wiki.greenstone.org" />
298
299 <shortcut
300 file="${startmenu.path}\Documentation\Greenstone Website.url"
301 url="http://www.greenstone.org" />
302
303 <!-- NO FLAX END -->
304
305 <!-- FLAX START -->
306
307 <shortcut
308 file="${startmenu.path}\Start FLAX Server.lnk"
309 execute="${installDir}\gs3-server.bat"
310 workingDirectory="${installDir}"
311 iconFile="${installDir}\resources\images\server.ico"
312 iconIndex="0" />
313
314 <shortcut
315 file="${startmenu.path}\Uninstall.lnk"
316 execute="${installDir}\uninstall\Uninstall.bat"
317 workingDirectory="${installDir}"
318 iconFile="${installDir}\resources\images\uninstall.ico"
319 iconIndex="0" />
320
321 <!-- FLAX END -->
322 </target>
323
324 <!-- util target to extract the given component -->
325 <!-- pass in ${component.name} as a param -->
326 <!-- unused at this time as causes display errors in installer gui!
327 <target name="extract-component">
328 <!- - extract the component into place - ->
329 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="${component.name}.lzma"/></patternset></unzip>
330 <!- - if windows - ->
331 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ${component.name}.lzma"/></exec>
332 <!- - /if - ->
333 <!- - if linux|mac - ->
334 <sevenzip task="decode" input="${basedir}/${component.name}.lzma" output="${basedir}/${component.name}.comp"/>
335 <!- - /if - ->
336 <delete file="${component.name}.lzma"/>
337 <unzip src="${basedir}/${component.name}.comp" dest="${installDir}"/>
338 <delete file="${component.name}.comp"/>
339 </target>
340 -->
341
342</project>
Note: See TracBrowser for help on using the repository browser.