root/release-kits/wirk3/installer/build.xml @ 16631

Revision 16631, 8.1 KB (checked in by oranfry, 11 years ago)

changes afer splitting gsdl into common, build and runtime

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    <!-- load windows properties -->
27    <winprops/>
28   
29   
30    <target name="install-core-components">
31
32        <!-- create the installation directory -->
33        <echo message="Creating Installation directory"/>
34        <echo>basedir: ${basedir}</echo>
35        <echo>installDir: ${installDir}</echo>
36        <echo>antinstaller.jar: ${antinstaller.jar}</echo>
37        <mkdir dir="${installDir}"/>
38
39        <!-- install binaries  -->
40        <echo message="Installing Executable Binaries (bin)"/>
41        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="bin/**/*"/></patternset></unzip>
42        <echo/>
43
44        <echo message="Installing Documentation (docs)"/>
45        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="docs/**/*"/></patternset></unzip>
46        <echo/>
47
48        <echo message="Installing GLI (gli)"/>
49        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gli/**/*"/></patternset></unzip>
50        <echo/>
51
52        <echo message="Installing gs2build (gs2build)"/>
53        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gs2build/**/*"/></patternset></unzip>
54        <echo/>
55
56        <echo message="Installing Libraries (lib)"/>
57        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="lib/**/*"/></patternset></unzip>
58        <echo/>
59
60        <echo message="Installing Web Content (web)"/>
61        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="web/**/*"/></patternset></unzip>
62        <echo/>
63
64        <echo message="Installing Resources (resources)"/>
65        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="resources/**/*"/></patternset></unzip>
66        <echo/>
67
68        <echo message="Installing Windows Utility Commands (winutil)"/>
69        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="winutil/**/*"/></patternset></unzip>
70        <echo/>
71
72       
73        <echo message="Installing Top Level Files"/>
74        <unzip src="${antinstaller.jar}" dest="${installDir}">
75            <patternset>
76                <include name="greenstone3-build.xml"/>
77                <include name="build.properties"/>
78                <include name="gs3-server.bat"/>
79                <include name="gs3-setup.bat"/>
80                <include name="LICENSE.txt"/>
81                <include name="README.txt"/>
82                <include name="server.jar"/>
83            </patternset>
84        </unzip>
85        <echo/>
86       
87        <!-- rename greenstone3-build.xml back to build.xml -->
88        <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
89       
90        <!-- change the tomcat ports in build.properties -->
91        <echo message="Changing tomcat ports in build.properties"/>
92        <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
93        <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
94        <echo message="Changing tomcat ports in resources/tomcat/server.xml"/>
95        <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir.local}/packages/tomcat/conf/server.xml" overwrite="true"/>
96       
97        <!-- set gsdlhome in gs2build setup.bat -->
98        <echo message="Setting %GSDLHOME% in gs2build\setup.bat"/>
99        <rsr file="${installDir}/gs2build/setup.bat" pattern="@gsdlhome@" replacement="${installDir.local}\gs2build" />
100
101       
102        <!-- copy the greenstone3.xml file to tomcat -->
103        <echo message="Copying greenstone3.xml to tomcat directory"/>
104        <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
105        <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" />
106
107        <!-- set up global properties -->
108        <echo message="Setting up global properties"/>
109        <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
110        <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
111        <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.server@" replacement="${tomcat.server}" />
112        <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.port@" replacement="${tomcat.port}" />
113
114        <!-- set up log4j properties-->
115        <echo message="Setting up log4j properties"/>
116        <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
117        <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
118
119        <!-- delete unneeded files -->     
120        <delete dir="${installDir}/resources/icons"/>
121        <delete file="${installDir}/resources/*.png"/>
122
123    </target>
124
125    <!-- Source -->
126    <target name="install-source-code">
127        <echo message="Installing Source Code (src)"/>
128        <mkdir dir="${installDir}/src"/>
129        <unzip src="${antinstaller.jar}" dest="${installDir}">
130            <patternset>
131                <include name="src/**/*"/>
132            </patternset>
133        </unzip>
134    </target>
135
136    <target name="install-tomcat">
137       
138        <echo message="Installing Apache Tomcat"/>
139        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/tomcat/**/*"/></patternset></unzip>
140
141        <!-- change the tomcat ports in tomcats server.xml -->
142        <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@server@" replacement="${tomcat.server}" />
143        <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@port@" replacement="${tomcat.port}" />
144        <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}" />
145
146    </target>
147    <target name="install-ant">
148        <echo message="Installing Apache Ant"/>
149        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/ant/**/*"/></patternset></unzip>
150    </target>
151   
152    <target name="cleanuptarget">
153    </target>
154   
155    <target name="install-start-menu-shortcuts">
156
157        <mkdir dir="${win32.personal.programs_menu}\Greenstone-@version@\Documentation"/>
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\gli.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 browser.