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

Last change on this file since 21847 was 21847, checked in by oranfry, 14 years ago

dont rely on hooks for replacement

File size: 12.0 KB
RevLine 
[14982]1<?xml version="1.0"?>
2<!--
3This is the build.xml run by AntInstaller for the installer
4-->
[15205]5<project name="Installation">
[14982]6
7 <!-- this is required to pick up the properties generated during the install pages -->
8 <property file="${basedir}/ant.install.properties"/>
9
[19935]10 <!-- custom tasks -->
11 <path id="project.classpath"><pathelement path="${antinstaller.jar}"/></path>
[14982]12
[17107]13 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
[19959]14 <!-- if linux|mac -->
[17468]15 <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
[19959]16 <!-- /if -->
[19935]17 <!-- if windows -->
18 <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
19 <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
20 <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
21 <!-- /if -->
[14982]22
[19935]23 <!-- create a local and strictly unix installDir String -->
24 <path id="installDir.path"><pathelement location="${installDir}"/></path>
25 <property name="installDir.local" refid="installDir.path"/>
26 <pathconvert targetos="unix" property="installDir.unix" refid="installDir.path"/>
[14982]27
[19935]28 <!-- if windows -->
29 <!-- load windows properties -->
30 <winprops/>
31 <!-- /if -->
32
33 <!-- work out whether a jre is bundled with this installer -->
[20306]34 <available file="../jre/bin" property="bundled.java.exists"/>
[19935]35
36 <!-- determine if there is an existing installation in the installDir-->
37 <available file="${installDir}\installation.properties" property="is.overinstall"/>
38
39 <!-- target to copy the bundled jre into place -->
[17765]40 <target name="Initialising" if="bundled.java.exists">
[17754]41 <mkdir dir="${installDir}"/>
42 <copy todir="${installDir}/packages/jre" failonerror="false">
[19935]43 <fileset dir="../jre"/>
[17754]44 </copy>
45 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
46 </target>
47
[19935]48 <!-- target to load in the messages left by the last installation -->
49 <target name="Looking For Previous Installation" if="is.overinstall">
50 <property file="${installDir}\installation.properties"/>
51 <delete dir="${installed.startmenu.path}" failonerror="false"/>
52 </target>
53
[17764]54 <target name="Installing Core System">
[17754]55
[19935]56 <!-- rip out build.xml to the temp dir so we can fake and <antcall> with <ant> -->
57 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="build.xml"/></patternset></unzip>
[14982]58
59
[19935]60 <!-- if windows -->
61 <echo>Figuring out the start menu path</echo>
62 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
63 <path id="startmenu.path.path" path="${startmenu.path}"/>
64 <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
65
66 <echo>Extracting 7za tool</echo>
67 <unzip src="${antinstaller.jar}" dest="${basedir}">
68 <patternset><include name="7za.exe"/></patternset>
69 </unzip>
70 <!-- /if -->
71
72 <echo>Extracting core component</echo>
[20190]73 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
74 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec><!-- /if -->
75 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/><!-- /if -->
76 <delete file="core.lzma"/>
77 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
78 <delete file="core.comp"/>
[19935]79
80 <echo>Setting binaries to executable</echo>
[14982]81 <chmod dir="${installDir}" includes="*.sh" perm="775"/>
82 <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
[15142]83 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
[19935]84 <!-- if linux -->
[14982]85 <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
[19935]86 <!-- /if -->
87 <!-- if mac -->
88 <chmod dir="${installDir}/gs2build/bin/darwin" includes="*" perm="775"/>
89 <!-- /if -->
[14982]90 <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
91 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
[21807]92 <!--<chmod file="${installDir}/packages/ant/bin/ant" perm="775"/>-->
[19964]93 <!--
94 source is not included for now
[19953]95 <chmod dir="${installDir}/gs2build" includes="**/configure" perm="775"/>
96 <chmod dir="${installDir}/gs2build/common-src/packages/gdbm/gdbm-1.8.3" includes="mkinstalldirs" perm="775"/>
[19964]97 <chmod file="${installDir}/src/packages/javagdbm/configure" perm="775"/>
98 -->
[14982]99
[19935]100 <echo>Setting tomcat ports</echo>
[21847]101 <rsr file="${installDir}/build.properties">
102 <job pattern="^(tomcat\.server[=:]).*" replacement="$1${tomcat.server}" />
103 <job pattern="^(tomcat\.port[=:]).*" replacement="$1${tomcat.port}" />
104 <job pattern="^(tomcat\.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
105 </rsr>
[14982]106
[17123]107 <echo>Setting up global properties</echo>
[14982]108 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
[19935]109 <rsr file="${installDir}/web/WEB-INF/classes/global.properties">
[21847]110 <job pattern="^(gsdl3\.home[:=]).*" replacement="$1${installDir.unix}/web" />
111 <job pattern="^(tomcat.server[:=]).*" replacement="$1${tomcat.server}" />
112 <job pattern="^(tomcat\.port[:=]).*" replacement="$1${tomcat.port}" />
[19935]113 </rsr>
[14982]114
[17123]115 <echo>Setting up log4j properties</echo>
[14982]116 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
[19955]117 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.unix}/web" />
[14982]118
[19935]119 <!-- if windows -->
120 <echo message="Setting GSDLHOME in gs2build\setup.bat"/>
[21820]121 <rsr file="${installDir}/gs2build/setup.bat" pattern="&quot;?\*\*GSDLHOME\*\*&quot;?" replacement="&quot;${installDir.local}\gs2build&quot;" />
[19935]122 <!-- /if -->
123
[18980]124 <echo>Creating the english dictionary</echo>
125 <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
126
[19935]127 <echo>Creating usage.txt</echo>
[17814]128 <echo file="${installDir}/gs2build/etc/usage.txt"></echo>
129
[17257]130 <echo>Creating installation properties file</echo>
[19935]131 <echo file="${installDir}\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
[17257]132
[17123]133 <echo>Finished</echo>
[15142]134
[14982]135 </target>
136
[17646]137 <target name="Installing ImageMagick">
[19935]138
[17646]139 <echo>Installing ImageMagick</echo>
[20190]140 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
141 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec><!-- /if -->
142 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/><!-- /if -->
143 <delete file="imagemagick.lzma"/>
144 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}"/>
145 <delete file="imagemagick.comp"/>
[19935]146
147 <echo>Setting binaries to executable</echo>
148 <!-- if linux -->
[17699]149 <chmod dir="${installDir}/gs2build/bin/linux/imagemagick/bin" includes="*" perm="775"/>
[19935]150 <!-- /if -->
151 <!-- if mac -->
152 <chmod dir="${installDir}/gs2build/bin/darwin/imagemagick/bin" includes="*" perm="775"/>
153 <!-- /if -->
154
[14982]155 </target>
156
[19935]157 <target name="Installing Ghostscript">
[17646]158
[19935]159 <echo>Installing Ghostscript</echo>
[20190]160 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
161 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec><!-- /if -->
162 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/><!-- /if -->
163 <delete file="ghostscript.lzma"/>
164 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}"/>
165 <delete file="ghostscript.comp"/>
[19935]166
167 <echo>Setting binaries to executable</echo>
168 <!-- if linux -->
169 <chmod dir="${installDir}/gs2build/bin/linux/ghostscript/bin" includes="*" perm="775"/>
170 <!-- /if -->
171 <!-- if mac -->
172 <chmod dir="${installDir}/gs2build/bin/darwin/ghostscript/bin" includes="*" perm="775"/>
173 <!-- /if -->
174
175 </target>
176
[17596]177 <target name="Installing Tomcat">
[19935]178
[17123]179 <echo>Installing Tomcat (packages/tomcat)</echo>
[17446]180 <mkdir dir="packages"/>
[20190]181 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="tomcat.lzma"/></patternset></unzip>
182 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x tomcat.lzma"/></exec><!-- /if -->
183 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/tomcat.lzma" output="${basedir}/tomcat.comp"/><!-- /if -->
184 <delete file="tomcat.lzma"/>
185 <unzip src="${basedir}/tomcat.comp" dest="${installDir}"/>
186 <delete file="tomcat.comp"/>
[17446]187
[20190]188
[17123]189 <echo>Changing tomcat ports tomcat's server.xml</echo>
[20084]190 <copy file="${installDir}/resources/tomcat/server_tomcat6.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
[19935]191 <rsr file="${installDir}/packages/tomcat/conf/server.xml">
192 <job pattern="@port@" replacement="${tomcat.port}"/>
193 <job pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}"/>
194 </rsr>
195
[17123]196 <echo>Copying greenstone3.xml to tomcat directory</echo>
[15973]197 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
[19962]198 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}${file.separator}web" />
[15973]199
[19935]200 <echo>Set binaries to executable</echo>
[15973]201 <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
[19935]202
[15142]203 </target>
[15205]204
[19935]205 <target name="Installing Start Menu Shortcuts">
[17786]206
[19935]207 <echo>Installing Start Menu Shortcuts</echo>
[17814]208
[19935]209 <mkdir dir="${startmenu.path}\Documentation"/>
210
211 <shortcut
212 file="${startmenu.path}\Greenstone3 Server.lnk"
213 execute="${installDir}\gs3-server.bat"
214 workingDirectory="${installDir}"
[21819]215 iconFile="${installDir}\resources\images\server.ico"
[19935]216 iconIndex="0" />
[17786]217
[19935]218 <shortcut
219 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
220 execute="${installDir}\gli\gli.bat"
221 workingDirectory="${installDir}\gli"
[21819]222 iconFile="${installDir}\resources\images\librarian.ico"
[19935]223 iconIndex="0" />
224
225 <shortcut
226 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
227 execute="${installDir}\gli\gems.bat"
228 workingDirectory="${installDir}\gli"
[21819]229 iconFile="${installDir}\resources\images\metadata.ico"
[19935]230 iconIndex="0" />
[17786]231
[19935]232 <shortcut
233 file="${startmenu.path}\Uninstall.lnk"
234 execute="${installDir}\Uninstall.bat"
235 workingDirectory="${installDir}"
[20012]236 iconFile="${installDir}\resources\images\uninstall.ico"
[19935]237 iconIndex="0" />
238
239 <shortcut
240 file="${startmenu.path}\Documentation\README.lnk"
241 execute="${installDir}\README.txt" />
242
243 <shortcut
244 file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
245 execute="${installDir}\documentation\manual\manual.pdf" />
246
247 <shortcut
248 file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
249 execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
[20012]250
251 <shortcut
252 file="${startmenu.path}\Documentation\Greenstone Wiki.url"
253 url="http://wiki.greenstone.org" />
254
255 <shortcut
256 file="${startmenu.path}\Documentation\Greenstone Website.url"
257 url="http://www.greenstone.org" />
[19935]258
259 </target>
[17814]260
[19935]261 <!-- util target to extract the given component -->
262 <!-- pass in ${component.name} as a param -->
[20190]263 <!-- unused at this time as causes display errors in installer gui!
[19935]264 <target name="extract-component">
[20190]265 <!- - extract the component into place - ->
[19935]266 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="${component.name}.lzma"/></patternset></unzip>
[20190]267 <!- - if windows - ->
[19935]268 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ${component.name}.lzma"/></exec>
[20190]269 <!- - /if - ->
270 <!- - if linux|mac - ->
[19935]271 <sevenzip task="decode" input="${basedir}/${component.name}.lzma" output="${basedir}/${component.name}.comp"/>
[20190]272 <!- - /if - ->
[19935]273 <delete file="${component.name}.lzma"/>
274 <unzip src="${basedir}/${component.name}.comp" dest="${installDir}"/>
275 <delete file="${component.name}.comp"/>
[17786]276 </target>
[20190]277 -->
[17786]278
[14982]279</project>
Note: See TracBrowser for help on using the repository browser.