source: release-kits/wirk2/installer/build.xml@ 16083

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

rename build.xml on its way into the jar, and then back to the original name on its way back out. This stops a naming conflict with ant-installers own build.xml file. Also, now put the concrete value of @gsdlhome@ into gs2build\setup.bat at install time.

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