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

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

changed build scripts and create-installer targets after the greenstone ant tasks were moved. also, greenstone2 installer now creates admin and demo users at install

File size: 7.8 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 <!-- create the installation directory -->
40 <echo message="Creating Installation directory"/>
41 <echo>basedir: ${basedir}</echo>
42 <echo>installDir: ${installDir}</echo>
43 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
44 <mkdir dir="${installDir}"/>
45
46 <!-- install files -->
47 <echo message="Installing Files"/>
48 <unzip src="${antinstaller.jar}" dest="${installDir}">
49 <patternset>
50
51 <include name="bin/**/*"/>
52 <include name="docs/**/*"/>
53 <include name="gli/**/*"/>
54 <include name="gs2build/**/*"/>
55 <exclude name="gs2build/common-src/**/*"/>
56 <exclude name="gs2build/build-src/**/*"/>
57 <exclude name="gs2build/runtime-src/**/*"/>
58 <include name="lib/**/*"/>
59 <include name="web/**/*"/>
60 <include name="resources/**/*"/>
61 <include name="winutil/**/*"/>
62
63 <include name="greenstone3-build.xml"/>
64 <include name="build.properties"/>
65 <include name="installation.properties"/>
66 <include name="gs3-server.bat"/>
67 <include name="gs3-setup.bat"/>
68 <include name="LICENSE.txt"/>
69 <include name="README.txt"/>
70 <include name="server.jar"/>
71
72 </patternset>
73 </unzip>
74 <echo/>
75
76 <!-- rename greenstone3-build.xml back to build.xml -->
77 <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
78
79 <!-- change the tomcat ports in build.properties -->
80 <echo message="Changing tomcat ports in build.properties"/>
81 <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
82 <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
83 <echo message="Changing tomcat ports in resources/tomcat/server.xml"/>
84 <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir.local}/packages/tomcat/conf/server.xml" overwrite="true"/>
85
86 <!-- set gsdlhome in gs2build setup.bat -->
87 <echo message="Setting %GSDLHOME% in gs2build\setup.bat"/>
88 <rsr file="${installDir}/gs2build/setup.bat" pattern="@gsdlhome@" replacement="${installDir.local}\gs2build" />
89
90
91 <!-- copy the greenstone3.xml file to tomcat -->
92 <echo message="Copying greenstone3.xml to tomcat directory"/>
93 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
94 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" />
95
96 <!-- set up global properties -->
97 <echo message="Setting up global properties"/>
98 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
99 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
100 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.server@" replacement="${tomcat.server}" />
101 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.port@" replacement="${tomcat.port}" />
102
103 <!-- set up log4j properties-->
104 <echo message="Setting up log4j properties"/>
105 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
106 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
107
108 <!-- delete unneeded files -->
109 <delete dir="${installDir}/resources/icons"/>
110 <delete file="${installDir}/resources/*.png"/>
111
112 </target>
113
114 <!-- Source -->
115 <target name="install-source-code">
116 <echo message="Installing Source Code (src)"/>
117 <mkdir dir="${installDir}/src"/>
118 <unzip src="${antinstaller.jar}" dest="${installDir}">
119 <patternset>
120 <include name="src/**/*"/>
121 <include name="gs2build/common-src/**/*"/>
122 <include name="gs2build/build-src/**/*"/>
123 <include name="gs2build/runtime-src/**/*"/>
124 </patternset>
125 </unzip>
126 </target>
127
128 <target name="install-tomcat">
129
130 <echo message="Installing Apache Tomcat"/>
131 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/tomcat/**/*"/></patternset></unzip>
132
133 <!-- change the tomcat ports in tomcats server.xml -->
134 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@server@" replacement="${tomcat.server}" />
135 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@port@" replacement="${tomcat.port}" />
136 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}" />
137
138 </target>
139 <target name="install-ant">
140 <echo message="Installing Apache Ant"/>
141 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/ant/**/*"/></patternset></unzip>
142 </target>
143
144 <target name="cleanuptarget">
145 </target>
146
147 <target name="install-start-menu-shortcuts">
148
149 <!-- figure out the start menu path (if not already set from previous installation) -->
150 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
151
152 <mkdir dir="${startmenu.path}\Documentation"/>
153
154 <shortcut
155 file="${startmenu.path}\Greenstone3 Server.lnk"
156 execute="${installDir}\gs3-server.bat"
157 workingDirectory="${installDir}"
158 iconFile="${installDir}\resources\images\gs3.ico"
159 iconIndex="0" />
160
161 <shortcut
162 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
163 execute="${installDir}\gli\gli.bat"
164 workingDirectory="${installDir}\gli"
165 iconFile="${installDir}\resources\images\gs3.ico"
166 iconIndex="0" />
167
168 <shortcut
169 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
170 execute="${installDir}\gli\gems4gs3.bat"
171 workingDirectory="${installDir}\gli"
172 iconFile="${installDir}\resources\images\gs3.ico"
173 iconIndex="0" />
174
175 <shortcut
176 file="${startmenu.path}\Documentation\README.lnk"
177 execute="${installDir}\README.txt" />
178
179 <shortcut
180 file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
181 execute="${installDir}\documentation\manual\manual.pdf" />
182
183 <shortcut
184 file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
185 execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
186
187 <rsr file="${installDir}\installation.properties" pattern="@startmenu.path@" replacement="${startmenu.path}" winPath="true"/>
188
189 </target>
190
191</project>
Note: See TracBrowser for help on using the repository browser.