source: release-kits/wirk3/installer/build.xml@ 17339

Last change on this file since 17339 was 17339, checked in by oranfry, 16 years ago

make sure we copile gli with the version numbers changed, and properly delete all .svn directories from dist

File size: 8.3 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" default="" basedir="${basedir}">
7
8 <!-- this is required to pick up the properties generated during the install pages -->
9 <property file="${basedir}/ant.install.properties"/>
10
11 <path id="project.classpath">
12 <pathelement path="${antinstaller.jar}"/>
13 </path>
14
15 <!-- custom tasks -->
16 <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
17 <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
18 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
19 <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
20
21 <!-- create a local installDir String -->
22 <path id="installDir.path">
23 <pathelement location="${installDir}"/>
24 </path>
25 <property name="installDir.local" refid="installDir.path"/>
26
27 <!-- load windows properties -->
28 <winprops/>
29
30 <!-- determine if there is an existing installation in the installDir-->
31 <available file="${installDir}\installation.properties" property="is.overinstall"/>
32
33 <target name="load-previous-props" if="is.overinstall">
34 <property file="${installDir}\installation.properties"/>
35 </target>
36
37 <target name="install-core-components" depends="load-previous-props">
38
39 <!-- figure out the start menu path (if not already set from previous installation) -->
40 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
41
42 <echo>basedir: ${basedir}</echo>
43 <echo>installDir: ${installDir}</echo>
44 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
45 <echo>startmenu.path: ${startmenu.path}</echo>
46
47 <!-- create the installation directory -->
48 <echo message="Creating Installation directory"/>
49 <mkdir dir="${installDir}"/>
50
51 <!-- install files -->
52 <echo message="Installing Files"/>
53 <unzip src="${antinstaller.jar}" dest="${installDir}">
54 <patternset>
55
56 <include name="bin/**/*"/>
57 <include name="docs/**/*"/>
58 <include name="gli/**/*"/>
59 <include name="gs2build/**/*"/>
60 <exclude name="gs2build/common-src/**/*"/>
61 <exclude name="gs2build/build-src/**/*"/>
62 <exclude name="gs2build/runtime-src/**/*"/>
63 <include name="lib/**/*"/>
64 <include name="web/**/*"/>
65 <include name="resources/**/*"/>
66 <include name="winutil/**/*"/>
67
68 <include name="greenstone3-build.xml"/>
69 <include name="build.properties"/>
70 <include name="gs3-server.bat"/>
71 <include name="gs3-setup.bat"/>
72 <include name="LICENSE.txt"/>
73 <include name="README.txt"/>
74 <include name="server.jar"/>
75 <include name="Uninstall.jar"/>
76 </patternset>
77 </unzip>
78 <echo/>
79
80 <!-- rename greenstone3-build.xml back to build.xml -->
81 <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
82
83 <!-- change the tomcat ports in build.properties -->
84 <echo message="Changing tomcat ports in build.properties"/>
85 <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
86 <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
87 <echo message="Changing tomcat ports in resources/tomcat/server.xml"/>
88 <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir.local}/packages/tomcat/conf/server.xml" overwrite="true"/>
89
90 <!-- set gsdlhome in gs2build setup.bat -->
91 <echo message="Setting %GSDLHOME% in gs2build\setup.bat"/>
92 <rsr file="${installDir}/gs2build/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir.local}\gs2build" winPath="true"/>
93 <!-- copy the greenstone3.xml file to tomcat -->
94 <echo message="Copying greenstone3.xml to tomcat directory"/>
95 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
96 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" winPath="true" />
97
98 <!-- set up global properties -->
99 <echo message="Setting up global properties"/>
100 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
101 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" winPath="true" />
102 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.server@" replacement="${tomcat.server}" />
103 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.port@" replacement="${tomcat.port}" />
104
105 <!-- set up log4j properties-->
106 <echo message="Setting up log4j properties"/>
107 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
108 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" winPath="true" />
109
110 <!-- delete unneeded files -->
111 <delete dir="${installDir}/resources/icons"/>
112 <delete file="${installDir}/resources/*.png"/>
113
114 <echo message="Creating installation properties file"/>
115 <echo file="${installDir}\installation.properties">startmenu.path:${startmenu.path}</echo>
116
117 </target>
118
119 <!-- Source -->
120 <target name="install-source-code">
121 <echo message="Installing Source Code (src)"/>
122 <mkdir dir="${installDir}/src"/>
123 <unzip src="${antinstaller.jar}" dest="${installDir}">
124 <patternset>
125 <include name="src/**/*"/>
126 <include name="gs2build/common-src/**/*"/>
127 <include name="gs2build/build-src/**/*"/>
128 <include name="gs2build/runtime-src/**/*"/>
129 </patternset>
130 </unzip>
131 </target>
132
133 <target name="install-tomcat">
134
135 <echo message="Installing Apache Tomcat"/>
136 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/tomcat/**/*"/></patternset></unzip>
137
138 <!-- change the tomcat ports in tomcats server.xml -->
139 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@server@" replacement="${tomcat.server}" />
140 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@port@" replacement="${tomcat.port}" />
141 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}" />
142
143 </target>
144 <target name="install-ant">
145 <echo message="Installing Apache Ant"/>
146 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/ant/**/*"/></patternset></unzip>
147 </target>
148
149 <target name="install-jre">
150 <echo>Installing Java Runtime Environment</echo>
151 <mkdir dir="${installDir}/packages"/>
152 <copy todir="${installDir}/packages/jre">
153 <fileset dir="../@java.extracted@"/>
154 </copy>
155 </target>
156
157 <target name="cleanuptarget">
158 </target>
159
160 <target name="install-start-menu-shortcuts">
161
162 <mkdir dir="${startmenu.path}\Documentation"/>
163
164 <shortcut
165 file="${startmenu.path}\Greenstone3 Server.lnk"
166 execute="${installDir}\gs3-server.bat"
167 workingDirectory="${installDir}"
168 iconFile="${installDir}\resources\images\gs3.ico"
169 iconIndex="0" />
170
171 <shortcut
172 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
173 execute="${installDir}\gli\gli.bat"
174 workingDirectory="${installDir}\gli"
175 iconFile="${installDir}\resources\images\gs3.ico"
176 iconIndex="0" />
177
178 <shortcut
179 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
180 execute="${installDir}\gli\gems.bat"
181 workingDirectory="${installDir}\gli"
182 iconFile="${installDir}\resources\images\gs3.ico"
183 iconIndex="0" />
184
185 <shortcut
186 file="${startmenu.path}\Uninstall.lnk"
187 execute="${installDir}\winutil\search4j.exe -h packages\jre -l Uninstall.jar"
188 workingDirectory="${installDir}"
189 iconFile="${installDir}\images\gs3.ico"
190 iconIndex="0" />
191
192 <shortcut
193 file="${startmenu.path}\Documentation\README.lnk"
194 execute="${installDir}\README.txt" />
195
196 <shortcut
197 file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
198 execute="${installDir}\documentation\manual\manual.pdf" />
199
200 <shortcut
201 file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
202 execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
203
204 </target>
205
206</project>
Note: See TracBrowser for help on using the repository browser.