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

Revision 16749, 6.9 KB (checked in by oranfry, 12 years ago)

simplification of installer descriptors

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