source: other-projects/expeditee-release-kits/kits/rke/installer/build.xml@ 28721

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

Add scripts to find java and run expeditee, make installer copy scripts to installation directory, and chmod them to be executable

File size: 10.6 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
70 <!-- core system -->
71 <target name="Installing Core System">
72
73 <!-- if windows -->
74 <!-- figure out the start menu path -->
75 <getfreepath path="${win32.personal.programs_menu}\${projectname}" property="startmenu.path"/>
76 <path id="startmenu.path.path" path="${startmenu.path}"/>
77 <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
78
79 <!-- extract 7za tool -->
80 <unzip src="${antinstaller.jar}" dest="${basedir}">
81 <patternset><include name="7za.exe"/></patternset>
82 </unzip>
83 <!-- /if -->
84
85 <!-- start web -->
86 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
87 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/><!-- /if -->
88 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec><!-- /if -->
89 <delete file="core.lzma"/>
90 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
91 <delete file="core.comp"/>
92 <!-- end web -->
93
94 <echo>Setting Binaries to Executable</echo>
95 <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
96 <chmod dir="${installDir}/bin" includes="*" perm="755"/>
97 <!-- <chmod dir="${installDir}/bin" includes="*" perm="775"/>
98 <chmod dir="${installDir}/cgi-bin/${shell.name}" includes="*" perm="775"/>
99 <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
100 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/> -->
101 <!-- if linux|mac -->
102 <!-- <chmod dir="${installDir}/bin/${shell.name}" includes="**/*" perm="775"/> -->
103 <!-- /if -->
104
105 <!-- if linux|mac -->
106 <!--
107 <echo>Set the installation locale in config files</echo>
108 <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
109 <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
110 <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
111 -->
112 <!-- /if -->
113 <!--
114 <rsr
115 file="${installDir}/gli/classes/xml/config.xml"
116 pattern="(&lt;Argument name=&quot;general.locale&quot;&gt;).*(&lt;/Argument&gt;)"
117 replacement="$1${language}$2"/>
118
119 <echo file="${installDir}/etc/main.cfg" append="true"
120 >cgiarg shortname=l argdefault=${language}</echo>
121
122 <echo message="Creating installation properties file"/>
123 -->
124 <!-- if linux|mac -->
125 <!-- <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo> -->
126 <!-- /if -->
127 <!-- if windows -->
128 <!-- <echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo> -->
129 <!-- /if -->
130
131 <!-- if mac -->
132 <!--
133 <copy file="${installDir}/gli.app/Contents/document.wflow.in" tofile="${installDir}/gli.app/Contents/document.wflow"/>
134 <rsr file="${installDir}/gli.app/Contents/document.wflow" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
135
136 <copy file="${installDir}/gs2-server.app/Contents/document.wflow.in" tofile="${installDir}/gs2-server.app/Contents/document.wflow"/>
137 <rsr file="${installDir}/gs2-server.app/Contents/document.wflow" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
138
139 <copy file="${installDir}/gems.app/Contents/document.wflow.in" tofile="${installDir}/gems.app/Contents/document.wflow"/>
140 <rsr file="${installDir}/gems.app/Contents/document.wflow" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
141
142 <copy file="${installDir}/client-gli.app/Contents/document.wflow.in" tofile="${installDir}/client-gli.app/Contents/document.wflow"/>
143 <rsr file="${installDir}/client-gli.app/Contents/document.wflow" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
144
145 <chmod dir="${installDir}" includes="*.app" perm="755"/>
146 <chmod dir="${installDir}" includes="*.app/**/*" perm="755"/>
147 -->
148 <!-- /if -->
149 </target>
150
151 <!-- <target name="Initialising" if="bundled.java.exists"> -->
152 <!-- Java Runtime -->
153 <target name="Installing Java Runtime">
154 <echo>Installing the Java Runtime</echo>
155 <mkdir dir="${installDir}/packages"/>
156 <copy todir="${installDir}/packages/jre" failonerror="false">
157 <fileset dir="../@java.extracted@"/>
158 </copy>
159 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
160 </target>
161
162 <!-- Start menu shortcuts -->
163 <target name="Installing Start Menu Shortcuts">
164
165 <mkdir dir="${startmenu.path}\Documentation"/>
166
167 <!-- Server shortcut -->
168 <if><bool><available file="${installDir}/web/images/server.ico"/></bool>
169 <property name="servericon" value="${installDir}\web\images\server.ico"/>
170 <else>
171 <property name="servericon" value="${installDir}\web\images\serverico.ico"/>
172 </else>
173 </if>
174
175 <shortcut
176 file="${startmenu.path}\Greenstone Server.lnk"
177 execute="${installDir}\gs2-server.bat"
178 workingDirectory="${installDir}"
179 iconFile="${servericon}"
180 iconIndex="0" />
181
182 <!-- Librarian shortcut -->
183 <if><bool><available file="${installDir}/web/images/librarian.ico"/></bool>
184 <property name="libraryicon" value="${installDir}\web\images\librarian.ico"/>
185 <else>
186 <property name="libraryicon" value="${installDir}\web\images\icon.ico"/>
187 </else>
188 </if>
189
190 <shortcut
191 file="${startmenu.path}\Librarian Interface (GLI).lnk"
192 execute="${installDir}\gli\gli.bat"
193 workingDirectory="${installDir}\gli"
194 iconFile="${libraryicon}"
195 iconIndex="0" />
196
197 <!-- Remote Server shortcut -->
198 <if><bool><available file="${installDir}/web/images/clientgli.ico"/></bool>
199 <property name="clientgliicon" value="${installDir}\web\images\clientgli.ico"/>
200 <else>
201 <property name="clientgliicon" value="${installDir}\web\images\icon.ico"/>
202 </else>
203 </if>
204
205 <shortcut
206 file="${startmenu.path}\Remote Librarian Interface (Client GLI).lnk"
207 execute="${installDir}\gli\client-gli.bat"
208 workingDirectory="${installDir}\gli"
209 iconFile="${clientgliicon}"
210 iconIndex="0" />
211
212 <!-- GEMS shortcut -->
213 <if><bool><available file="${installDir}/web/images/metadata.ico"/></bool>
214 <property name="gemsicon" value="${installDir}\web\images\metadata.ico"/>
215 <else>
216 <property name="gemsicon" value="${installDir}\web\images\gems.ico"/>
217 </else>
218 </if>
219
220 <shortcut
221 file="${startmenu.path}\Metadata Set Editor (GEMS).lnk"
222 execute="${installDir}\gli\gems.bat"
223 workingDirectory="${installDir}\gli"
224 iconFile="${gemsicon}"
225 iconIndex="0" />
226
227 <!-- Uninstall shortcut -->
228 <if><bool><available file="${installDir}/web/images/newuninstall.ico"/></bool>
229 <property name="uninstallicon" value="${installDir}\web\images\newuninstall.ico"/>
230 <else>
231 <property name="uninstallicon" value="${installDir}\web\images\uninstall.ico"/>
232 </else>
233 </if>
234
235 <shortcut
236 file="${startmenu.path}\Uninstall.lnk"
237 execute="${installDir}\uninstall\Uninstall.bat"
238 workingDirectory="${installDir}\uninstall"
239 iconFile="${uninstallicon}"
240 iconIndex="0" />
241
242 <!-- Misc shortcuts -->
243 <shortcut
244 file="${startmenu.path}\Documentation\READMEen.lnk"
245 execute="${installDir}\READMEen.txt" />
246
247 <shortcut
248 file="${startmenu.path}\Documentation\Greenstone Wiki.url"
249 url="http://wiki.greenstone.org" />
250
251 <shortcut
252 file="${startmenu.path}\Documentation\Greenstone Website.url"
253 url="http://www.greenstone.org" />
254
255 </target>
256
257 <target name="Configuring Administration Pages" if="enable.admin.pages">
258 <echo>Enabling Admin Pages</echo>
259 <rsr file="${installDir}/etc/main.cfg" pattern="^\s*status\s+.*" replacement="status enabled"/>
260 <echo>Creating admin and demo users</echo>
261 <adduser txt2db="${installDir}/bin/${shell.name}/txt2db"
262 usersDb="${installDir}/etc/users.gdb"
263 username="admin"
264 password="${admin.password}"
265 groups="administrator,colbuilder,all-collections-editor"
266 comment="created at install time"/>
267 <adduser
268 txt2db="${installDir}/bin/${shell.name}/txt2db"
269 usersDb="${installDir}/etc/users.gdb"
270 username="demo"
271 password="demo"
272 groups="demo"
273 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
274 </target>
275
276 <target name="Installing Documented Examples">
277 <unzip src="${orig.dir}/documented-examples.zip" dest="${installDir}/collect"/>
278 </target>
279
280</project>
Note: See TracBrowser for help on using the repository browser.