1 | <?xml version="1.0"?>
|
---|
2 | <!--
|
---|
3 | This 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 | <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
|
---|
32 | <typedef name="adduser" classname="org.greenstone.anttasks.AddGreenstoneUserToDatabase" classpathref="project.classpath"/>
|
---|
33 | <!-- if windows -->
|
---|
34 | <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
|
---|
35 | <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
|
---|
36 | <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
|
---|
37 | <!-- /if -->
|
---|
38 | <!-- if linux|mac -->
|
---|
39 | <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
|
---|
40 | <!-- /if -->
|
---|
41 |
|
---|
42 | <!-- determine if a bundled java exists -->
|
---|
43 | <condition property="bundled.java.exists">
|
---|
44 | <available file="../@linux-java.extracted@/bin/java"/>
|
---|
45 | </condition>
|
---|
46 |
|
---|
47 | <!-- determine if there is an existing installation in the installDir-->
|
---|
48 | <available file="${installDir}\etc\installation.properties" property="is.overinstall"/>
|
---|
49 |
|
---|
50 | <!-- create a local installDir String -->
|
---|
51 | <path id="installDir.path"><pathelement location="${installDir}"/></path>
|
---|
52 | <property name="installDir.local" refid="installDir.path"/>
|
---|
53 |
|
---|
54 | <!-- if windows -->
|
---|
55 | <!-- load windows properties -->
|
---|
56 | <winprops/>
|
---|
57 | <!-- /if -->
|
---|
58 |
|
---|
59 | <!-- load the properties of the previous installation if this is an overinstall -->
|
---|
60 | <target name="Looking For Previous Installation" if="is.overinstall">
|
---|
61 | <property file="${installDir}\etc\installation.properties"/>
|
---|
62 | <delete dir="${installed.startmenu.path}" failonerror="false"/>
|
---|
63 | </target>
|
---|
64 |
|
---|
65 | <!-- copy jre -->
|
---|
66 | <target name="Initialising" if="bundled.java.exists">
|
---|
67 | <mkdir dir="${installDir}/packages"/>
|
---|
68 | <copy todir="${installDir}/packages/jre" failonerror="false">
|
---|
69 | <fileset dir="../@linux-java.extracted@"/>
|
---|
70 | </copy>
|
---|
71 | <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
|
---|
72 | </target>
|
---|
73 |
|
---|
74 | <!-- core system -->
|
---|
75 | <target name="Installing Core System">
|
---|
76 |
|
---|
77 | <!-- if windows -->
|
---|
78 | <!-- figure out the start menu path -->
|
---|
79 | <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
|
---|
80 | <path id="startmenu.path.path" path="${startmenu.path}"/>
|
---|
81 | <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
|
---|
82 |
|
---|
83 | <!-- extract 7za tool -->
|
---|
84 | <unzip src="${antinstaller.jar}" dest="${basedir}">
|
---|
85 | <patternset><include name="7za.exe"/></patternset>
|
---|
86 | </unzip>
|
---|
87 | <!-- /if -->
|
---|
88 |
|
---|
89 | <!-- start web -->
|
---|
90 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
|
---|
91 | <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/><!-- /if -->
|
---|
92 | <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec><!-- /if -->
|
---|
93 | <delete file="core.lzma"/>
|
---|
94 | <unzip src="${basedir}/core.comp" dest="${installDir}"/>
|
---|
95 | <delete file="core.comp"/>
|
---|
96 | <!-- end web -->
|
---|
97 |
|
---|
98 | <!-- start cdrom -->
|
---|
99 | <copy todir="${installDir}">
|
---|
100 | <fileset dir="${orig.dir}/Software/core/all"/>
|
---|
101 | <fileset dir="${orig.dir}/Software/core/${rk.os}"/><!-- /if -->
|
---|
102 | </copy>
|
---|
103 | <!-- if windows -->
|
---|
104 | <copy todir="${installDir}/packages/jre" failonerror="false">
|
---|
105 | <fileset dir="${orig.dir}/Java/Windows/jre"/>
|
---|
106 | </copy>
|
---|
107 | <!-- /if -->
|
---|
108 | <!-- end cdrom -->
|
---|
109 |
|
---|
110 | <echo>Setting Binaries to Executable</echo>
|
---|
111 | <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
|
---|
112 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
113 | <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
|
---|
114 | <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
|
---|
115 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
116 | <!-- if linux|mac -->
|
---|
117 | <chmod dir="${installDir}/bin/${shell.name}" includes="**/*" perm="775"/>
|
---|
118 | <chmod dir="${installDir}/apache-httpd/${shell.name}/bin" includes="*" perm="775"/>
|
---|
119 | <chmod dir="${installDir}/apache-httpd/${shell.name}" includes="*.sh" perm="775"/>
|
---|
120 | <!-- /if -->
|
---|
121 |
|
---|
122 | <echo>Filling in concrete values in config files</echo>
|
---|
123 | <copy file="${installDir}/cgi-bin/gsdlsite.cfg.in" tofile="${installDir}/cgi-bin/gsdlsite.cfg"/>
|
---|
124 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir.local}"/>
|
---|
125 |
|
---|
126 | <echo>Correcting perl shebangs in perl scripts</echo>
|
---|
127 | <!-- if linux|mac -->
|
---|
128 | <exec executable="which" outputproperty="perl.executable"><arg value="perl"/></exec>
|
---|
129 | <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
|
---|
130 | <!-- / if -->
|
---|
131 | <!-- if windows -->
|
---|
132 | <property name="perl.executable" value="${installDir.local}\bin\windows\perl\perl.exe"/>
|
---|
133 | <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
|
---|
134 | <!-- /if -->
|
---|
135 |
|
---|
136 | <echo>Creating the english dictionary</echo>
|
---|
137 | <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
|
---|
138 |
|
---|
139 | <!-- if linux|mac -->
|
---|
140 | <echo>Set the installation locale in config files</echo>
|
---|
141 | <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
|
---|
142 | <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
143 | <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
144 | <!-- /if -->
|
---|
145 | <rsr
|
---|
146 | file="${installDir}/gli/classes/xml/config.xml"
|
---|
147 | pattern="(<Argument name="general.locale">).*(</Argument>)"
|
---|
148 | replacement="$1${language}$2"/>
|
---|
149 |
|
---|
150 | <echo file="${installDir}/etc/main.cfg" append="true"
|
---|
151 | >cgiarg shortname=l argdefault=${language}</echo>
|
---|
152 |
|
---|
153 | <!-- if linux|mac -->
|
---|
154 | <echo>Setting up apache web server</echo>
|
---|
155 | <exec dir="${installDir}" executable="${installDir}/apache-httpd/linux/install-bindist.sh">
|
---|
156 | <arg value="${installDir}/apache-httpd/${shell.name}"/>
|
---|
157 | </exec>
|
---|
158 | <!-- /if -->
|
---|
159 |
|
---|
160 | <echo message="Creating installation properties file"/>
|
---|
161 | <!-- if linux|mac -->
|
---|
162 | <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
|
---|
163 | <!-- /if -->
|
---|
164 | <!-- if windows -->
|
---|
165 | <echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
|
---|
166 | <!-- /if -->
|
---|
167 |
|
---|
168 | </target>
|
---|
169 |
|
---|
170 | <!-- ImageMagick -->
|
---|
171 | <target name="Installing ImageMagick">
|
---|
172 | <echo>Installing ImageMagick</echo>
|
---|
173 | <!-- start web -->
|
---|
174 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
|
---|
175 | <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/><!-- /if -->
|
---|
176 | <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec><!-- /if -->
|
---|
177 | <delete file="imagemagick.lzma"/>
|
---|
178 | <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/${shell.name}"/>
|
---|
179 | <delete file="imagemagick.comp"/>
|
---|
180 | <!-- end web -->
|
---|
181 |
|
---|
182 | <!-- start cdrom -->
|
---|
183 | <copy todir="${installDir}/bin/${shell.name}">
|
---|
184 | <fileset dir="${orig.dir}/Software/imagemagick/${rk.os}"/>
|
---|
185 | </copy>
|
---|
186 | <!-- end cdrom -->
|
---|
187 |
|
---|
188 | <chmod dir="${installDir}/bin/${shell.name}/imagemagick/bin" includes="*" perm="775"/>
|
---|
189 |
|
---|
190 | </target>
|
---|
191 |
|
---|
192 | <!-- Ghostscript -->
|
---|
193 | <target name="Installing Ghostscript" depends="">
|
---|
194 | <echo message="Installing Ghostscript"/>
|
---|
195 | <!-- start web -->
|
---|
196 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
|
---|
197 | <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/><!-- /if -->
|
---|
198 | <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec><!-- /if -->
|
---|
199 | <delete file="ghostscript.lzma"/>
|
---|
200 | <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/${shell.name}" />
|
---|
201 | <delete file="ghostscript.comp"/>
|
---|
202 | <!-- end web -->
|
---|
203 |
|
---|
204 | <!-- start cdrom -->
|
---|
205 | <copy todir="${installDir}/bin/${shell.name}">
|
---|
206 | <fileset dir="${orig.dir}/Software/ghostscript/${rk.os}"/>
|
---|
207 | </copy>
|
---|
208 | <!-- end cdrom -->
|
---|
209 |
|
---|
210 | <chmod dir="${installDir}/bin/${shell.name}/ghostscript/bin" includes="*" perm="775"/>
|
---|
211 | </target>
|
---|
212 |
|
---|
213 | <!-- Start menu shortcuts -->
|
---|
214 | <target name="Installing Start Menu Shortcuts">
|
---|
215 |
|
---|
216 | <mkdir dir="${startmenu.path}\Documentation"/>
|
---|
217 |
|
---|
218 | <shortcut
|
---|
219 | file="${startmenu.path}\Greenstone Server.lnk"
|
---|
220 | execute="${installDir}\server.exe"
|
---|
221 | workingDirectory="${installDir}"
|
---|
222 | iconFile="${installDir}\web\images\serverico.ico"
|
---|
223 | iconIndex="0" />
|
---|
224 |
|
---|
225 | <shortcut
|
---|
226 | file="${startmenu.path}\Librarian Interface (GLI).lnk"
|
---|
227 | execute="${installDir}\gli\gli.bat"
|
---|
228 | workingDirectory="${installDir}\gli"
|
---|
229 | iconFile="${installDir}\web\images\icon.ico"
|
---|
230 | iconIndex="0" />
|
---|
231 |
|
---|
232 | <shortcut
|
---|
233 | file="${startmenu.path}\Librarian Interface for Remote Server (Client GLI).lnk"
|
---|
234 | execute="${installDir}\gli\client-gli.bat"
|
---|
235 | workingDirectory="${installDir}\gli"
|
---|
236 | iconFile="${installDir}\web\images\icon.ico"
|
---|
237 | iconIndex="0" />
|
---|
238 |
|
---|
239 | <shortcut
|
---|
240 | file="${startmenu.path}\Metadata Set Editor (GEMS).lnk"
|
---|
241 | execute="${installDir}\gli\gems.bat"
|
---|
242 | workingDirectory="${installDir}\gli"
|
---|
243 | iconFile="${installDir}\web\images\gems.ico"
|
---|
244 | iconIndex="0" />
|
---|
245 |
|
---|
246 | <shortcut
|
---|
247 | file="${startmenu.path}\Uninstall.lnk"
|
---|
248 | execute="${installDir}\Uninstall.bat"
|
---|
249 | workingDirectory="${installDir}"
|
---|
250 | iconFile="${installDir}\web\images\uninstall.ico"
|
---|
251 | iconIndex="0" />
|
---|
252 |
|
---|
253 | <shortcut
|
---|
254 | file="${startmenu.path}\Documentation\READMEen.lnk"
|
---|
255 | execute="${installDir}\READMEen.txt" />
|
---|
256 |
|
---|
257 | <shortcut
|
---|
258 | file="${startmenu.path}\Documentation\Greenstone Wiki.url"
|
---|
259 | url="http://wiki.greenstone.org" />
|
---|
260 |
|
---|
261 | <shortcut
|
---|
262 | file="${startmenu.path}\Documentation\Greenstone Website.url"
|
---|
263 | url="http://www.greenstone.org" />
|
---|
264 |
|
---|
265 | </target>
|
---|
266 |
|
---|
267 | <target name="Configuring Administration Pages" if="enable.admin.pages">
|
---|
268 | <echo>Enabling Admin Pages</echo>
|
---|
269 | <rsr file="${installDir}/etc/main.cfg" pattern="^\s*status\s+.*" replacement="status enabled"/>
|
---|
270 | <echo>Creating admin and demo users</echo>
|
---|
271 | <adduser txt2db="${installDir}/bin/${shell.name}/txt2db"
|
---|
272 | usersDb="${installDir}/etc/users.gdb"
|
---|
273 | username="admin"
|
---|
274 | password="${admin.password}"
|
---|
275 | groups="administrator,colbuilder,all-collections-editor"
|
---|
276 | comment="created at install time"/>
|
---|
277 | <adduser
|
---|
278 | txt2db="${installDir}/bin/${shell.name}/txt2db"
|
---|
279 | usersDb="${installDir}/etc/users.gdb"
|
---|
280 | username="demo"
|
---|
281 | password="demo"
|
---|
282 | groups="demo"
|
---|
283 | comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
|
---|
284 | </target>
|
---|
285 |
|
---|
286 | <target name="Installing Documented Examples">
|
---|
287 | <copy todir="${installDir}/collect">
|
---|
288 | <fileset dir="${orig.dir}/Documented Examples" includes="documented-examples/**/*"/>
|
---|
289 | </copy>
|
---|
290 | </target>
|
---|
291 |
|
---|
292 | </project>
|
---|