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

Last change on this file since 29296 was 29296, checked in by ak19, 10 years ago

Realised that the release-kit needed to be modified if the ext/solr/bin/script perl scripts are to be executable in the GS3 binary. Previously had committed the permissions to svn via the svnexecutable property, but this did not propagate into the binary, whereas the installer already has code to chmod the scripts in gs2build/bin/script and other places.

File size: 16.8 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 <!--<typedef name="adduser" classname="org.greenstone.anttasks.AddGreenstone3UserToDatabase" classpathref="project.classpath"/>-->
15 <!-- if linux|mac -->
16 <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
17 <!-- /if -->
18 <!-- if windows -->
19 <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
20 <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
21 <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
22 <!-- /if -->
23
24 <!-- set some properties to keep track of the OS -->
25 <!-- if windows -->
26 <property name="rk.os" value="windows"/>
27 <property name="shell.name" value="windows"/>
28 <!-- /if -->
29 <!-- if linux -->
30 <property name="rk.os" value="linux"/>
31 <property name="shell.name" value="linux"/>
32 <!-- /if -->
33 <!-- if mac -->
34 <property name="rk.os" value="mac"/>
35 <property name="shell.name" value="darwin"/>
36 <!-- /if -->
37
38
39 <!-- create a local and strictly unix installDir String -->
40 <path id="installDir.path"><pathelement location="${installDir}"/></path>
41 <property name="installDir.local" refid="installDir.path"/>
42 <pathconvert targetos="unix" property="installDir.unix" refid="installDir.path"/>
43
44 <!-- if windows -->
45 <!-- load windows properties -->
46 <winprops/>
47 <!-- /if -->
48
49 <!-- work out whether a jre is bundled with this installer -->
50 <available file="../jre/bin" property="bundled.java.exists"/>
51
52 <!-- determine if there is an existing installation in the installDir-->
53 <available file="${installDir}\installation.properties" property="is.overinstall"/>
54
55 <!-- target to copy the bundled jre into place -->
56 <target name="Initialising" if="bundled.java.exists">
57 <mkdir dir="${installDir}"/>
58 <copy todir="${installDir}/packages/jre" failonerror="false">
59 <fileset dir="../jre"/>
60 </copy>
61 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
62 </target>
63
64 <!-- target to load in the messages left by the last installation -->
65 <target name="Looking For Previous Installation" if="is.overinstall">
66 <property file="${installDir}\installation.properties"/>
67 <delete dir="${installed.startmenu.path}" failonerror="false"/>
68 </target>
69
70 <target name="Installing Core System">
71
72 <!-- rip out build.xml to the temp dir so we can fake and <antcall> with <ant> -->
73 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="build.xml"/></patternset></unzip>
74
75
76 <!-- if windows -->
77 <echo>Figuring out the start menu path</echo>
78 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
79 <path id="startmenu.path.path" path="${startmenu.path}"/>
80 <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
81
82 <echo>Extracting 7za tool</echo>
83 <unzip src="${antinstaller.jar}" dest="${basedir}">
84 <patternset><include name="7za.exe"/></patternset>
85 </unzip>
86 <!-- /if -->
87
88 <echo>Extracting core component</echo>
89 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
90 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec><!-- /if -->
91 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/><!-- /if -->
92 <delete file="core.lzma"/>
93 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
94 <delete file="core.comp"/>
95
96 <echo>Setting binaries to executable</echo>
97 <chmod dir="${installDir}" includes="*.sh" perm="775"/>
98 <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
99 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
100 <chmod dir="${installDir}/ext/solr/bin/script" includes="*" perm="775"/>
101 <!-- if linux -->
102 <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
103 <chmod dir="${installDir}/gs2build/bin/linux/wv/bin" includes="*" perm="775"/>
104 <!-- /if -->
105 <!-- if mac -->
106 <chmod dir="${installDir}/gs2build/bin/darwin" includes="**/*" excludes="ghostscript/** imagemagick/**" perm="775"/>
107 <!-- /if -->
108 <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
109 <!-- GLI START -->
110 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
111 <!-- GLI END -->
112
113 <chmod file="${installDir}/packages/ant/bin/ant" perm="775"/>
114 <!--
115 source is not included for now
116 <chmod dir="${installDir}/gs2build" includes="**/configure" perm="775"/>
117 <chmod dir="${installDir}/gs2build/common-src/packages/gdbm/gdbm-1.8.3" includes="mkinstalldirs" perm="775"/>
118 <chmod file="${installDir}/src/packages/javagdbm/configure" perm="775"/>
119 -->
120
121
122 <echo>Correcting perl shebangs in perl scripts</echo>
123 <ant dir="${installDir}" antfile="build.xml" target="set-perl-shebangs" inheritAll="false" />
124
125
126 <echo>Setting tomcat ports</echo>
127 <property name="tomcat.server" value="localhost"/>
128 <property name="tomcat.port" value="8383"/>
129 <property name="tomcat.shutdown.port" value="8305"/>
130 <rsr file="${installDir}/build.properties">
131 <job pattern="^(tomcat\.server[=:]).*" replacement="$1${tomcat.server}" />
132 <job pattern="^(tomcat\.port[=:]).*" replacement="$1${tomcat.port}" />
133 <job pattern="^(tomcat\.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
134 </rsr>
135
136 <echo>Setting up global properties</echo>
137 <copy file="${installDir}/resources/web/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
138 <rsr file="${installDir}/web/WEB-INF/classes/global.properties">
139 <job pattern="^(gsdl3\.home[:=]).*" replacement="$1${installDir.unix}/web" />
140 <job pattern="^(tomcat.server[:=]).*" replacement="$1${tomcat.server}" />
141 <job pattern="^(tomcat\.port[:=]).*" replacement="$1${tomcat.port}" />
142 </rsr>
143
144 <echo>Setting up log4j properties</echo>
145 <copy file="${installDir}/resources/web/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
146 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.unix}/web" />
147
148 <!-- if windows -->
149 <echo message="Setting GSDLHOME in gs2build\setup.bat"/>
150 <!-- 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 -->
151 <rsr file="${installDir}/gs2build/setup.bat" pattern="&quot;?\*\*GSDLHOME\*\*&quot;?" replacement="${installDir.local}\gs2build" />
152 <!-- /if -->
153
154 <!-- if mac -->
155 <echo>Installing Mac Shortcuts</echo>
156 <ant dir="${installDir}" antfile="build.xml" target="gen-mac-shortcuts" inheritAll="false" />
157 <!-- need to give executable permissions to the Mac shortcuts -->
158 <chmod file="${installDir}/gs3-server.app/Contents/MacOS/gs2-server" perm="775"/><!--called gs2-server, since the gs3-server.app is a copy of the one generated for gs2-->
159 <chmod file="${installDir}/gli.app/Contents/MacOS/gli" perm="775"/>
160 <chmod file="${installDir}/client-gli.app/Contents/MacOS/client-gli" perm="775"/>
161 <chmod file="${installDir}/gems.app/Contents/MacOS/gems" perm="775"/>
162
163 <!--<chmod dir="${installDir}" includes="*.app" perm="755"/>
164 <chmod dir="${installDir}" includes="*.app/**/*" perm="755"/>-->
165
166 <!-- /if -->
167
168 <!-- GLI START -->
169 <echo>Creating the english dictionary</echo>
170 <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
171 <!-- GLI END -->
172
173 <echo>Creating usage.txt</echo>
174 <echo file="${installDir}/gs2build/etc/usage.txt"></echo>
175
176 <echo>Creating installation properties file</echo>
177 <echo file="${installDir}\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
178
179 <echo>Finished</echo>
180
181 </target>
182
183 <target name="Installing ImageMagick">
184
185 <echo>Installing ImageMagick</echo>
186 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
187 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec><!-- /if -->
188 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/><!-- /if -->
189 <delete file="imagemagick.lzma"/>
190 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}"/>
191 <delete file="imagemagick.comp"/>
192
193 <echo>Setting binaries to executable</echo>
194 <!-- if linux -->
195 <chmod dir="${installDir}/gs2build/bin/linux/imagemagick/bin" includes="*" perm="775"/>
196 <!-- /if -->
197 <!-- if mac -->
198 <chmod dir="${installDir}/gs2build/bin/darwin/imagemagick/bin" includes="*" perm="775"/>
199 <!-- /if -->
200
201 </target>
202
203 <!-- NO FLAX START -->
204
205 <target name="Installing Ghostscript">
206
207 <echo>Installing Ghostscript</echo>
208 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
209 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec><!-- /if -->
210 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/><!-- /if -->
211 <delete file="ghostscript.lzma"/>
212 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}"/>
213 <delete file="ghostscript.comp"/>
214
215 <echo>Setting binaries to executable</echo>
216 <!-- if linux -->
217 <chmod dir="${installDir}/gs2build/bin/linux/ghostscript/bin" includes="*" perm="775"/>
218 <!-- /if -->
219 <!-- if mac -->
220 <chmod dir="${installDir}/gs2build/bin/darwin/ghostscript/bin" includes="*" perm="775"/>
221 <!-- /if -->
222
223 </target>
224
225 <!-- NO FLAX END -->
226
227 <!-- start amp -->
228
229 <target name="Installing AMP">
230 <echo>Installing Apache, MySQL and PHP</echo>
231 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="amp.lzma"/></patternset></unzip>
232 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x amp.lzma"/></exec><!-- /if -->
233 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/amp.lzma" output="${basedir}/amp.comp"/><!-- /if -->
234 <delete file="amp.lzma"/>
235 <unzip src="${basedir}/amp.comp" dest="${installDir}/ext/amp"/>
236 <delete file="amp.comp"/>
237
238 <!-- if linux|mac -->
239 <echo>Setting binaries to executable</echo>
240 <chmod dir="${installDir}/ext/amp" includes="*" perm="775"/>
241 <!-- /if -->
242 </target>
243
244 <!-- end amp -->
245
246 <target name="Installing Tomcat">
247
248 <echo>Installing Tomcat (packages/tomcat)</echo>
249 <mkdir dir="packages"/>
250 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="tomcat.lzma"/></patternset></unzip>
251 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x tomcat.lzma"/></exec><!-- /if -->
252 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/tomcat.lzma" output="${basedir}/tomcat.comp"/><!-- /if -->
253 <delete file="tomcat.lzma"/>
254 <unzip src="${basedir}/tomcat.comp" dest="${installDir}"/>
255 <delete file="tomcat.comp"/>
256
257
258 <echo>Changing tomcat ports tomcat's server.xml</echo>
259 <copy file="${installDir}/resources/tomcat/server_tomcat7.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
260 <rsr file="${installDir}/packages/tomcat/conf/server.xml">
261 <job pattern="@port@" replacement="${tomcat.port}"/>
262 <job pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}"/>
263 </rsr>
264
265 <echo>Copying greenstone3.xml to tomcat directory</echo>
266 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
267 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}${file.separator}web" />
268 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@privilegedattribute@" replacement="privileged='true'" />
269
270 <!-- FLAX START -->
271 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="localsite" replacement="flax" />
272 <!-- FLAX END -->
273
274 <echo>Set binaries to executable</echo>
275 <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
276
277 </target>
278
279 <target name="Installing Start Menu Shortcuts">
280
281 <echo>Installing Start Menu Shortcuts</echo>
282
283 <!-- NO FLAX START -->
284
285 <mkdir dir="${startmenu.path}\Documentation"/>
286
287 <shortcut
288 file="${startmenu.path}\Greenstone3 Server.lnk"
289 execute="${installDir}\gs3-server.bat"
290 workingDirectory="${installDir}"
291 iconFile="${installDir}\resources\images\server.ico"
292 iconIndex="0" />
293
294 <shortcut
295 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
296 execute="${installDir}\gli\gli.bat"
297 workingDirectory="${installDir}\gli"
298 iconFile="${installDir}\resources\images\librarian.ico"
299 iconIndex="0" />
300
301 <shortcut
302 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
303 execute="${installDir}\gli\gems.bat"
304 workingDirectory="${installDir}\gli"
305 iconFile="${installDir}\resources\images\metadata.ico"
306 iconIndex="0" />
307
308 <shortcut
309 file="${startmenu.path}\Uninstall.lnk"
310 execute="${installDir}\uninstall\Uninstall.bat"
311 workingDirectory="${installDir}"
312 iconFile="${installDir}\resources\images\uninstall.ico"
313 iconIndex="0" />
314
315 <shortcut
316 file="${startmenu.path}\Documentation\README.lnk"
317 execute="${installDir}\README.txt" />
318
319 <shortcut
320 file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
321 execute="${installDir}\documentation\manual\manual.pdf" />
322
323 <shortcut
324 file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
325 execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
326
327 <shortcut
328 file="${startmenu.path}\Documentation\Greenstone Wiki.url"
329 url="http://wiki.greenstone.org" />
330
331 <shortcut
332 file="${startmenu.path}\Documentation\Greenstone Website.url"
333 url="http://www.greenstone.org" />
334
335 <!-- NO FLAX END -->
336
337 <!-- FLAX START -->
338
339 <shortcut
340 file="${startmenu.path}\Start FLAX Server.lnk"
341 execute="${installDir}\gs3-server.bat"
342 workingDirectory="${installDir}"
343 iconFile="${installDir}\resources\images\server.ico"
344 iconIndex="0" />
345
346 <shortcut
347 file="${startmenu.path}\Uninstall.lnk"
348 execute="${installDir}\uninstall\Uninstall.bat"
349 workingDirectory="${installDir}"
350 iconFile="${installDir}\resources\images\uninstall.ico"
351 iconIndex="0" />
352
353 <!-- FLAX END -->
354 </target>
355
356 <target name="Configuring Administration Pages" if="set.admin.pwd">
357 <echo>Enabling Admin Pages</echo>
358 <rsr file="${installDir}/web/sites/localsite/siteConfig.xml" pattern="&lt;!--&lt;serviceRack name='Authentication'/&gt;--&gt;" replacement="&lt;serviceRack name='Authentication'/&gt;"/>
359 <echo>Creating admin user</echo>
360 <!--<echo>Creating admin and demo users</echo>-->
361 <ant dir="${installDir}" antfile="build.xml" target="config-admin" inheritAll="false">
362 <property name="admin.password" value="${admin.password}"/>
363 </ant>
364 <!--<adduser txt2db="org.greenstone.gsdl3.util.ChangePwdUsersDB"
365 usersDb="${installDir}/web/sites/localsite/etc/usersDB"
366 username="admin"
367 password="${admin.password}"
368 groups="administrator,colbuilder,all-collections-editor"
369 comment="created at install time"
370 email=""/>
371 <adduser
372 txt2db="org.greenstone.gsdl3.util.ChangePwdUsersDB"
373 usersDb="${installDir}/web/sites/localsite/etc/usersDB"
374 username="demo"
375 password="demo"
376 groups="demo"
377 comment="Dummy 'demo' user with password 'demo' for authen-e collection"
378 email=""/>-->
379 </target>
380
381 <!-- util target to extract the given component -->
382 <!-- pass in ${component.name} as a param -->
383 <!-- unused at this time as causes display errors in installer gui!
384 <target name="extract-component">
385 <!- - extract the component into place - ->
386 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="${component.name}.lzma"/></patternset></unzip>
387 <!- - if windows - ->
388 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ${component.name}.lzma"/></exec>
389 <!- - /if - ->
390 <!- - if linux|mac - ->
391 <sevenzip task="decode" input="${basedir}/${component.name}.lzma" output="${basedir}/${component.name}.comp"/>
392 <!- - /if - ->
393 <delete file="${component.name}.lzma"/>
394 <unzip src="${basedir}/${component.name}.comp" dest="${installDir}"/>
395 <delete file="${component.name}.comp"/>
396 </target>
397 -->
398
399</project>
Note: See TracBrowser for help on using the repository browser.