source: main/trunk/release-kits/kits/rk2/installer/build.xml@ 23574

Last change on this file since 23574 was 23574, checked in by sjm84, 13 years ago

The release kits will now use the minimal versions of the gnome-lib

File size: 14.3 KB
Line 
1<?xml version="1.0"?>
2<!--
3This is the build.xml run by AntInstaller for the installer
4-->
5
6<project name="Installation">
7
8 <!-- this is required to pick up the properties generated during the install pages -->
9 <property file="${basedir}/ant.install.properties"/>
10
11 <!-- set some properties to keep track of the OS -->
12 <!-- if windows -->
13 <property name="rk.os" value="windows"/>
14 <property name="shell.name" value="windows"/>
15 <!-- /if -->
16 <!-- if linux -->
17 <property name="rk.os" value="linux"/>
18 <property name="shell.name" value="linux"/>
19 <!-- /if -->
20 <!-- if mac -->
21 <property name="rk.os" value="mac"/>
22 <property name="shell.name" value="darwin"/>
23 <!-- /if -->
24
25 <!-- classpath -->
26 <path id="project.classpath">
27 <pathelement path="${antinstaller.jar}"/>
28 </path>
29
30 <!-- custom tasks -->
31 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
32 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
33 <typedef name="adduser" classname="org.greenstone.anttasks.AddGreenstoneUserToDatabase" classpathref="project.classpath"/>
34 <!-- if windows -->
35 <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
36 <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
37 <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
38 <!-- /if -->
39 <!-- if linux|mac -->
40 <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
41 <!-- /if -->
42
43 <!-- determine if a bundled java exists -->
44 <condition property="bundled.java.exists">
45 <or>
46 <available file="../@java.extracted@/bin/java"/>
47 <available file="../@java.extracted@/bin/java.exe"/>
48 </or>
49 </condition>
50
51 <!-- determine if there is an existing installation in the installDir-->
52 <available file="${installDir}\etc\installation.properties" property="is.overinstall"/>
53
54 <!-- create a local installDir String -->
55 <path id="installDir.path"><pathelement location="${installDir}"/></path>
56 <property name="installDir.local" refid="installDir.path"/>
57
58 <!-- if windows -->
59 <!-- load windows properties -->
60 <winprops/>
61 <!-- /if -->
62
63 <!-- load the properties of the previous installation if this is an overinstall -->
64 <target name="Looking For Previous Installation" if="is.overinstall">
65 <property file="${installDir}\etc\installation.properties"/>
66 <delete dir="${installed.startmenu.path}" failonerror="false"/>
67 </target>
68
69 <!-- copy jre -->
70 <target name="Initialising" if="bundled.java.exists">
71 <mkdir dir="${installDir}/packages"/>
72 <copy todir="${installDir}/packages/jre" failonerror="false">
73 <fileset dir="../@java.extracted@"/>
74 </copy>
75 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
76 </target>
77
78 <!-- core system -->
79 <target name="Installing Core System">
80
81 <!-- if windows -->
82 <!-- figure out the start menu path -->
83 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
84 <path id="startmenu.path.path" path="${startmenu.path}"/>
85 <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
86
87 <!-- extract 7za tool -->
88 <unzip src="${antinstaller.jar}" dest="${basedir}">
89 <patternset><include name="7za.exe"/></patternset>
90 </unzip>
91 <!-- /if -->
92
93 <!-- start web -->
94<!-- <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
95-->
96 <get src="http://svn.greenstone.org/caveat-emptor/Greenstone-2.84-candidate-linux-core.lzma" dest="${basedir}"/>
97 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/><!-- /if -->
98 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec><!-- /if -->
99 <delete file="core.lzma"/>
100 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
101 <delete file="core.comp"/>
102 <!-- end web -->
103
104 <!-- start cdrom -->
105 <copy todir="${installDir}">
106 <fileset dir="${orig.dir}/Software/core/all"/>
107 <fileset dir="${orig.dir}/Software/core/${rk.os}"/><!-- /if -->
108 </copy>
109 <!-- if windows -->
110 <copy todir="${installDir}/packages/jre" failonerror="false">
111 <fileset dir="${orig.dir}/Java/Windows/jre"/>
112 </copy>
113 <!-- /if -->
114 <!-- end cdrom -->
115
116 <echo>Setting Binaries to Executable</echo>
117 <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
118 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
119 <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
120 <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
121 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
122 <!-- if linux|mac -->
123 <chmod dir="${installDir}/bin/${shell.name}" includes="**/*" perm="775"/>
124 <!-- /if -->
125
126 <echo>Filling in concrete values in config files</echo>
127 <copy file="${installDir}/cgi-bin/gsdlsite.cfg.in" tofile="${installDir}/cgi-bin/gsdlsite.cfg"/>
128 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="&quot;?\*\*GSDLHOME\*\*&quot;?" replacement="&quot;${installDir.local}&quot;"/>
129
130 <echo>Correcting perl shebangs in perl scripts</echo>
131 <!-- if linux|mac -->
132 <exec executable="which" outputproperty="perl.executable"><arg value="perl"/></exec>
133 <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
134 <!-- /if -->
135 <!-- if windows -->
136 <property name="perl.executable" value="${installDir.local}\bin\windows\perl\bin\perl.exe"/>
137 <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
138 <!-- /if -->
139
140 <echo>Creating the english dictionary</echo>
141 <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
142
143 <!-- if linux|mac -->
144 <echo>Set the installation locale in config files</echo>
145 <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
146 <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
147 <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
148 <!-- /if -->
149 <rsr
150 file="${installDir}/gli/classes/xml/config.xml"
151 pattern="(&lt;Argument name=&quot;general.locale&quot;&gt;).*(&lt;/Argument&gt;)"
152 replacement="$1${language}$2"/>
153
154 <echo file="${installDir}/etc/main.cfg" append="true"
155 >cgiarg shortname=l argdefault=${language}</echo>
156
157 <echo message="Creating installation properties file"/>
158 <!-- if linux|mac -->
159 <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
160 <!-- /if -->
161 <!-- if windows -->
162 <echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
163 <!-- /if -->
164
165 <!-- if mac -->
166 <rsr file="${installDir}/gli.app/Contents/document.wflow" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
167 <rsr file="${installDir}/gs2-server.app/Contents/document.wflow" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
168 <rsr file="${installDir}/gems.app/Contents/document.wflow" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
169 <rsr file="${installDir}/client-gli.app/Contents/document.wflow" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
170 <!-- /if -->
171 </target>
172
173 <!-- Apache HTTPD -->
174 <target name="Installing Apache Web Server">
175 <echo>Installing the Apache Web Server</echo>
176
177 <!-- start web -->
178 <unzip src="${antinstaller.jar}" dest="${basedir}">
179 <patternset>
180 <include name="apachehttpd.lzma"/>
181 </patternset>
182 </unzip>
183
184 <!-- if linux|mac -->
185 <sevenzip task="decode" input="${basedir}/apachehttpd.lzma" output="${basedir}/apachehttpd.comp"/>
186 <!-- /if -->
187 <!-- if windows -->
188 <exec dir="${basedir}" executable="${basedir}/7za.exe">
189 <arg line="x apachehttpd.lzma"/>
190 </exec>
191 <!-- /if -->
192 <unzip src="${basedir}/apachehttpd.comp" dest="${installDir}"/>
193 <delete file="apachehttpd.comp"/>
194 <!-- end web -->
195
196 <!-- start cdrom -->
197 <copy todir="${installDir}">
198 <fileset dir="${orig.dir}/Software/apache-httpd"/>
199 <fileset dir="${orig.dir}/Software/apache-httpd/**/*"/>
200 </copy>
201 <!-- end cdrom -->
202
203 <!-- if linux|mac -->
204 <chmod dir="${installDir}/apache-httpd/${shell.name}/bin" includes="*" perm="775"/>
205 <chmod dir="${installDir}/apache-httpd/${shell.name}" includes="*.sh" perm="775"/>
206 <echo>Setting up apache web server</echo>
207 <exec dir="${installDir}" executable="${installDir}/apache-httpd/${shell.name}/install-bindist.sh">
208 <arg value="${installDir}/apache-httpd/${shell.name}"/>
209 </exec>
210 <!-- /if -->
211 </target>
212
213 <!-- ImageMagick -->
214 <target name="Installing ImageMagick">
215 <echo>Installing ImageMagick</echo>
216 <!-- start web -->
217 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
218 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/><!-- /if -->
219 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec><!-- /if -->
220 <delete file="imagemagick.lzma"/>
221 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}"/>
222 <delete file="imagemagick.comp"/>
223 <!-- end web -->
224
225 <!-- start cdrom -->
226 <copy todir="${installDir}">
227 <fileset dir="${orig.dir}/Software/imagemagick/${rk.os}/**/*"/>
228 </copy>
229 <!-- end cdrom -->
230
231 <chmod dir="${installDir}/bin/${shell.name}/imagemagick/bin" includes="*" perm="775"/>
232
233 </target>
234
235 <!-- Ghostscript -->
236 <target name="Installing Ghostscript" depends="">
237 <echo message="Installing Ghostscript"/>
238 <!-- start web -->
239 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
240 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/><!-- /if -->
241 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec><!-- /if -->
242 <delete file="ghostscript.lzma"/>
243 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}" />
244 <delete file="ghostscript.comp"/>
245 <!-- end web -->
246
247 <!-- start cdrom -->
248 <copy todir="${installDir}">
249 <fileset dir="${orig.dir}/Software/ghostscript/${rk.os}/**/*"/>
250 </copy>
251 <!-- end cdrom -->
252
253 <chmod dir="${installDir}/bin/${shell.name}/ghostscript/bin" includes="*" perm="775"/>
254 </target>
255
256 <!-- Start menu shortcuts -->
257 <target name="Installing Start Menu Shortcuts">
258
259 <mkdir dir="${startmenu.path}\Documentation"/>
260
261 <!-- Server shortcut -->
262 <if><bool><available file="${installDir}/web/images/server.ico"/></bool>
263 <property name="servericon" value="${installDir}\web\images\server.ico"/>
264 <else>
265 <property name="servericon" value="${installDir}\web\images\serverico.ico"/>
266 </else>
267 </if>
268
269 <shortcut
270 file="${startmenu.path}\Greenstone Server.lnk"
271 execute="${installDir}\gs2-server.bat"
272 workingDirectory="${installDir}"
273 iconFile="${servericon}"
274 iconIndex="0" />
275
276 <!-- Librarian shortcut -->
277 <if><bool><available file="${installDir}/web/images/librarian.ico"/></bool>
278 <property name="libraryicon" value="${installDir}\web\images\librarian.ico"/>
279 <else>
280 <property name="libraryicon" value="${installDir}\web\images\icon.ico"/>
281 </else>
282 </if>
283
284 <shortcut
285 file="${startmenu.path}\Librarian Interface (GLI).lnk"
286 execute="${installDir}\gli\gli.bat"
287 workingDirectory="${installDir}\gli"
288 iconFile="${libraryicon}"
289 iconIndex="0" />
290
291 <!-- Remote Server shortcut -->
292 <if><bool><available file="${installDir}/web/images/clientgli.ico"/></bool>
293 <property name="clientgliicon" value="${installDir}\web\images\clientgli.ico"/>
294 <else>
295 <property name="clientgliicon" value="${installDir}\web\images\icon.ico"/>
296 </else>
297 </if>
298
299 <shortcut
300 file="${startmenu.path}\Remote Librarian Interface (Client GLI).lnk"
301 execute="${installDir}\gli\client-gli.bat"
302 workingDirectory="${installDir}\gli"
303 iconFile="${clientgliicon}"
304 iconIndex="0" />
305
306 <!-- GEMS shortcut -->
307 <if><bool><available file="${installDir}/web/images/metadata.ico"/></bool>
308 <property name="gemsicon" value="${installDir}\web\images\metadata.ico"/>
309 <else>
310 <property name="gemsicon" value="${installDir}\web\images\gems.ico"/>
311 </else>
312 </if>
313
314 <shortcut
315 file="${startmenu.path}\Metadata Set Editor (GEMS).lnk"
316 execute="${installDir}\gli\gems.bat"
317 workingDirectory="${installDir}\gli"
318 iconFile="${gemsicon}"
319 iconIndex="0" />
320
321 <!-- Uninstall shortcut -->
322 <if><bool><available file="${installDir}/web/images/newuninstall.ico"/></bool>
323 <property name="uninstallicon" value="${installDir}\web\images\newuninstall.ico"/>
324 <else>
325 <property name="uninstallicon" value="${installDir}\web\images\uninstall.ico"/>
326 </else>
327 </if>
328
329 <shortcut
330 file="${startmenu.path}\Uninstall.lnk"
331 execute="${installDir}\uninstall\Uninstall.bat"
332 workingDirectory="${installDir}\uninstall"
333 iconFile="${uninstallicon}"
334 iconIndex="0" />
335
336 <!-- Misc shortcuts -->
337 <shortcut
338 file="${startmenu.path}\Documentation\READMEen.lnk"
339 execute="${installDir}\READMEen.txt" />
340
341 <shortcut
342 file="${startmenu.path}\Documentation\Greenstone Wiki.url"
343 url="http://wiki.greenstone.org" />
344
345 <shortcut
346 file="${startmenu.path}\Documentation\Greenstone Website.url"
347 url="http://www.greenstone.org" />
348
349 </target>
350
351 <target name="Configuring Administration Pages" if="enable.admin.pages">
352 <echo>Enabling Admin Pages</echo>
353 <rsr file="${installDir}/etc/main.cfg" pattern="^\s*status\s+.*" replacement="status enabled"/>
354 <echo>Creating admin and demo users</echo>
355 <adduser txt2db="${installDir}/bin/${shell.name}/txt2db"
356 usersDb="${installDir}/etc/users.gdb"
357 username="admin"
358 password="${admin.password}"
359 groups="administrator,colbuilder,all-collections-editor"
360 comment="created at install time"/>
361 <adduser
362 txt2db="${installDir}/bin/${shell.name}/txt2db"
363 usersDb="${installDir}/etc/users.gdb"
364 username="demo"
365 password="demo"
366 groups="demo"
367 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
368 </target>
369
370 <target name="Installing Documented Examples">
371 <copy todir="${installDir}/collect">
372 <fileset dir="${orig.dir}/Documented Examples" includes="documented-examples/**/*"/>
373 </copy>
374 </target>
375
376</project>
Note: See TracBrowser for help on using the repository browser.