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

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

Make the cgi folder (containing gliserver.pl and other pl files) executable. The GS286 binary's cgi-bin folder similarly had executable permissions on its pl files.

File size: 17.0 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 <chmod dir="${installDir}/web/WEB-INF/cgi/" includes="*.pl" perm="775"/>
102 <!-- if linux -->
103 <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
104 <chmod dir="${installDir}/gs2build/bin/linux/wv/bin" includes="*" perm="775"/>
105 <chmod dir="${installDir}/bin/linux" includes="*" perm="775"/>
106 <!-- /if -->
107 <!-- if mac -->
108 <chmod dir="${installDir}/gs2build/bin/darwin" includes="**/*" excludes="ghostscript/** imagemagick/**" perm="775"/>
109 <chmod dir="${installDir}/bin/darwin" includes="*" perm="775"/>
110 <!-- /if -->
111 <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
112 <!-- GLI START -->
113 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
114 <!-- GLI END -->
115
116 <chmod file="${installDir}/packages/ant/bin/ant" perm="775"/>
117 <!--
118 source is not included for now
119 <chmod dir="${installDir}/gs2build" includes="**/configure" perm="775"/>
120 <chmod dir="${installDir}/gs2build/common-src/packages/gdbm/gdbm-1.8.3" includes="mkinstalldirs" perm="775"/>
121 <chmod file="${installDir}/src/packages/javagdbm/configure" perm="775"/>
122 -->
123
124
125 <echo>Correcting perl shebangs in perl scripts</echo>
126 <ant dir="${installDir}" antfile="build.xml" target="set-perl-shebangs" inheritAll="false" />
127
128
129 <echo>Setting tomcat ports</echo>
130 <property name="tomcat.server" value="localhost"/>
131 <property name="tomcat.port" value="8383"/>
132 <property name="tomcat.shutdown.port" value="8305"/>
133 <rsr file="${installDir}/build.properties">
134 <job pattern="^(tomcat\.server[=:]).*" replacement="$1${tomcat.server}" />
135 <job pattern="^(tomcat\.port[=:]).*" replacement="$1${tomcat.port}" />
136 <job pattern="^(tomcat\.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
137 </rsr>
138
139 <echo>Setting up global properties</echo>
140 <copy file="${installDir}/resources/web/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
141 <rsr file="${installDir}/web/WEB-INF/classes/global.properties">
142 <job pattern="^(gsdl3\.home[:=]).*" replacement="$1${installDir.unix}/web" />
143 <job pattern="^(tomcat.server[:=]).*" replacement="$1${tomcat.server}" />
144 <job pattern="^(tomcat\.port[:=]).*" replacement="$1${tomcat.port}" />
145 </rsr>
146
147 <echo>Setting up log4j properties</echo>
148 <copy file="${installDir}/resources/web/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
149 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.unix}/web" />
150
151 <!-- if windows -->
152 <echo message="Setting GSDLHOME in gs2build\setup.bat"/>
153 <!-- 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 -->
154 <rsr file="${installDir}/gs2build/setup.bat" pattern="&quot;?\*\*GSDLHOME\*\*&quot;?" replacement="${installDir.local}\gs2build" />
155 <!-- /if -->
156
157 <!-- if mac -->
158 <echo>Installing Mac Shortcuts</echo>
159 <ant dir="${installDir}" antfile="build.xml" target="gen-mac-shortcuts" inheritAll="false" />
160 <!-- need to give executable permissions to the Mac shortcuts -->
161 <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-->
162 <chmod file="${installDir}/gli.app/Contents/MacOS/gli" perm="775"/>
163 <chmod file="${installDir}/client-gli.app/Contents/MacOS/client-gli" perm="775"/>
164 <chmod file="${installDir}/gems.app/Contents/MacOS/gems" perm="775"/>
165
166 <!--<chmod dir="${installDir}" includes="*.app" perm="755"/>
167 <chmod dir="${installDir}" includes="*.app/**/*" perm="755"/>-->
168
169 <!-- /if -->
170
171 <!-- GLI START -->
172 <echo>Creating the english dictionary</echo>
173 <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
174 <!-- GLI END -->
175
176 <echo>Creating usage.txt</echo>
177 <echo file="${installDir}/gs2build/etc/usage.txt"></echo>
178
179 <echo>Creating installation properties file</echo>
180 <echo file="${installDir}\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
181
182 <echo>Finished</echo>
183
184 </target>
185
186 <target name="Installing ImageMagick">
187
188 <echo>Installing ImageMagick</echo>
189 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
190 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec><!-- /if -->
191 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/><!-- /if -->
192 <delete file="imagemagick.lzma"/>
193 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}"/>
194 <delete file="imagemagick.comp"/>
195
196 <echo>Setting binaries to executable</echo>
197 <!-- if linux -->
198 <chmod dir="${installDir}/gs2build/bin/linux/imagemagick/bin" includes="*" perm="775"/>
199 <!-- /if -->
200 <!-- if mac -->
201 <chmod dir="${installDir}/gs2build/bin/darwin/imagemagick/bin" includes="*" perm="775"/>
202 <!-- /if -->
203
204 </target>
205
206 <!-- NO FLAX START -->
207
208 <target name="Installing Ghostscript">
209
210 <echo>Installing Ghostscript</echo>
211 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
212 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec><!-- /if -->
213 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/><!-- /if -->
214 <delete file="ghostscript.lzma"/>
215 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}"/>
216 <delete file="ghostscript.comp"/>
217
218 <echo>Setting binaries to executable</echo>
219 <!-- if linux -->
220 <chmod dir="${installDir}/gs2build/bin/linux/ghostscript/bin" includes="*" perm="775"/>
221 <!-- /if -->
222 <!-- if mac -->
223 <chmod dir="${installDir}/gs2build/bin/darwin/ghostscript/bin" includes="*" perm="775"/>
224 <!-- /if -->
225
226 </target>
227
228 <!-- NO FLAX END -->
229
230 <!-- start amp -->
231
232 <target name="Installing AMP">
233 <echo>Installing Apache, MySQL and PHP</echo>
234 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="amp.lzma"/></patternset></unzip>
235 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x amp.lzma"/></exec><!-- /if -->
236 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/amp.lzma" output="${basedir}/amp.comp"/><!-- /if -->
237 <delete file="amp.lzma"/>
238 <unzip src="${basedir}/amp.comp" dest="${installDir}/ext/amp"/>
239 <delete file="amp.comp"/>
240
241 <!-- if linux|mac -->
242 <echo>Setting binaries to executable</echo>
243 <chmod dir="${installDir}/ext/amp" includes="*" perm="775"/>
244 <!-- /if -->
245 </target>
246
247 <!-- end amp -->
248
249 <target name="Installing Tomcat">
250
251 <echo>Installing Tomcat (packages/tomcat)</echo>
252 <mkdir dir="packages"/>
253 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="tomcat.lzma"/></patternset></unzip>
254 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x tomcat.lzma"/></exec><!-- /if -->
255 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/tomcat.lzma" output="${basedir}/tomcat.comp"/><!-- /if -->
256 <delete file="tomcat.lzma"/>
257 <unzip src="${basedir}/tomcat.comp" dest="${installDir}"/>
258 <delete file="tomcat.comp"/>
259
260
261 <echo>Changing tomcat ports tomcat's server.xml</echo>
262 <copy file="${installDir}/resources/tomcat/server_tomcat7.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
263 <rsr file="${installDir}/packages/tomcat/conf/server.xml">
264 <job pattern="@port@" replacement="${tomcat.port}"/>
265 <job pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}"/>
266 </rsr>
267
268 <echo>Copying greenstone3.xml to tomcat directory</echo>
269 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
270 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}${file.separator}web" />
271 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@privilegedattribute@" replacement="privileged='true'" />
272
273 <!-- FLAX START -->
274 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="localsite" replacement="flax" />
275 <!-- FLAX END -->
276
277 <echo>Set binaries to executable</echo>
278 <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
279
280 </target>
281
282 <target name="Installing Start Menu Shortcuts">
283
284 <echo>Installing Start Menu Shortcuts</echo>
285
286 <!-- NO FLAX START -->
287
288 <mkdir dir="${startmenu.path}\Documentation"/>
289
290 <shortcut
291 file="${startmenu.path}\Greenstone3 Server.lnk"
292 execute="${installDir}\gs3-server.bat"
293 workingDirectory="${installDir}"
294 iconFile="${installDir}\resources\images\server.ico"
295 iconIndex="0" />
296
297 <shortcut
298 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
299 execute="${installDir}\gli\gli.bat"
300 workingDirectory="${installDir}\gli"
301 iconFile="${installDir}\resources\images\librarian.ico"
302 iconIndex="0" />
303
304 <shortcut
305 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
306 execute="${installDir}\gli\gems.bat"
307 workingDirectory="${installDir}\gli"
308 iconFile="${installDir}\resources\images\metadata.ico"
309 iconIndex="0" />
310
311 <shortcut
312 file="${startmenu.path}\Uninstall.lnk"
313 execute="${installDir}\uninstall\Uninstall.bat"
314 workingDirectory="${installDir}"
315 iconFile="${installDir}\resources\images\uninstall.ico"
316 iconIndex="0" />
317
318 <shortcut
319 file="${startmenu.path}\Documentation\README.lnk"
320 execute="${installDir}\README.txt" />
321
322 <shortcut
323 file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
324 execute="${installDir}\documentation\manual\manual.pdf" />
325
326 <shortcut
327 file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
328 execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
329
330 <shortcut
331 file="${startmenu.path}\Documentation\Greenstone Wiki.url"
332 url="http://wiki.greenstone.org" />
333
334 <shortcut
335 file="${startmenu.path}\Documentation\Greenstone Website.url"
336 url="http://www.greenstone.org" />
337
338 <!-- NO FLAX END -->
339
340 <!-- FLAX START -->
341
342 <shortcut
343 file="${startmenu.path}\Start FLAX Server.lnk"
344 execute="${installDir}\gs3-server.bat"
345 workingDirectory="${installDir}"
346 iconFile="${installDir}\resources\images\server.ico"
347 iconIndex="0" />
348
349 <shortcut
350 file="${startmenu.path}\Uninstall.lnk"
351 execute="${installDir}\uninstall\Uninstall.bat"
352 workingDirectory="${installDir}"
353 iconFile="${installDir}\resources\images\uninstall.ico"
354 iconIndex="0" />
355
356 <!-- FLAX END -->
357 </target>
358
359 <target name="Configuring Administration Pages" if="set.admin.pwd">
360 <echo>Enabling Admin Pages</echo>
361 <rsr file="${installDir}/web/sites/localsite/siteConfig.xml" pattern="&lt;!--&lt;serviceRack name='Authentication'/&gt;--&gt;" replacement="&lt;serviceRack name='Authentication'/&gt;"/>
362 <echo>Creating admin user</echo>
363 <!--<echo>Creating admin and demo users</echo>-->
364 <ant dir="${installDir}" antfile="build.xml" target="config-admin" inheritAll="false">
365 <property name="admin.password" value="${admin.password}"/>
366 </ant>
367 <!--<adduser txt2db="org.greenstone.gsdl3.util.ChangePwdUsersDB"
368 usersDb="${installDir}/web/sites/localsite/etc/usersDB"
369 username="admin"
370 password="${admin.password}"
371 groups="administrator,colbuilder,all-collections-editor"
372 comment="created at install time"
373 email=""/>
374 <adduser
375 txt2db="org.greenstone.gsdl3.util.ChangePwdUsersDB"
376 usersDb="${installDir}/web/sites/localsite/etc/usersDB"
377 username="demo"
378 password="demo"
379 groups="demo"
380 comment="Dummy 'demo' user with password 'demo' for authen-e collection"
381 email=""/>-->
382 </target>
383
384 <!-- util target to extract the given component -->
385 <!-- pass in ${component.name} as a param -->
386 <!-- unused at this time as causes display errors in installer gui!
387 <target name="extract-component">
388 <!- - extract the component into place - ->
389 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="${component.name}.lzma"/></patternset></unzip>
390 <!- - if windows - ->
391 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ${component.name}.lzma"/></exec>
392 <!- - /if - ->
393 <!- - if linux|mac - ->
394 <sevenzip task="decode" input="${basedir}/${component.name}.lzma" output="${basedir}/${component.name}.comp"/>
395 <!- - /if - ->
396 <delete file="${component.name}.lzma"/>
397 <unzip src="${basedir}/${component.name}.comp" dest="${installDir}"/>
398 <delete file="${component.name}.comp"/>
399 </target>
400 -->
401
402</project>
Note: See TracBrowser for help on using the repository browser.