root/release-kits/lirk3/installer/build.xml @ 17444

Revision 17444, 5.9 KB (checked in by oranfry, 12 years ago)

jre now part of core

Line 
1<?xml version="1.0"?>
2<!--
3This is the build.xml run by AntInstaller for the installer
4-->
5
6<project name="Installation">
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="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
17
18    <target name="install-core-components" depends="">
19
20        <!-- create the installation directory -->
21        <echo>Creating Installation directory</echo>
22        <echo>basedir: ${basedir}</echo>
23        <echo>installDir: ${installDir}</echo>
24        <echo>antinstaller.jar: ${antinstaller.jar}</echo>
25        <mkdir dir="${installDir}"/>
26
27
28        <!-- install files -->
29        <echo>Installing Core Files</echo>
30        <unzip src="${antinstaller.jar}" dest="${installDir}">
31            <patternset>
32                <include name="bin/**/*"/>
33                <include name="docs/**/*"/>
34                <include name="gli/**/*"/>
35                <include name="gs2build/**/*"/>
36                <exclude name="gs2build/common-src/**/*"/>
37                <exclude name="gs2build/build-src/**/*"/>
38                <exclude name="gs2build/runtime-src/**/*"/>
39                <include name="lib/**/*"/>
40                <include name="web/**/*"/>
41                <include name="resources/**/*"/>
42
43                <include name="greenstone3-build.xml"/>
44                <include name="build.properties"/>
45                <include name="gs3-server.sh"/>
46                <include name="gs3-setup.sh"/>
47                <include name="LICENSE.txt"/>
48                <include name="README.txt"/>
49                <include name="server.jar"/>
50                <include name="Uninstall.jar"/>
51            </patternset>
52        </unzip>
53        <echo/>
54
55        <!-- jre -->
56        <move todir="${installDir}/packages/jre">
57            <fileset dir="../@linux-java.extracted@"/>
58        </move>
59        <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>       
60
61
62        <echo>Renaming greenstone3-build.xml back to build.xml</echo>
63        <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
64
65        <echo>Setting Binaries to Executable</echo>
66        <chmod dir="${installDir}" includes="*.sh" perm="775"/>
67        <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
68        <chmod dir="${installDir}/bin" includes="*" perm="775"/>
69        <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
70        <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
71        <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
72        <echo/>
73
74        <echo>Changing tomcat ports in build.properties</echo>
75        <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
76        <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
77
78        <echo>Setting up global properties</echo>
79        <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
80        <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
81        <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
82        <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
83
84        <echo>Setting up log4j properties</echo>
85        <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
86        <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
87
88        <echo>Deleting some unneeded files</echo>
89        <delete dir="${installDir}/resources/icons"/>
90        <delete file="${installDir}/resources/*.png"/>
91
92        <echo>Creating installation properties file</echo>
93        <echo file="${installDir}/installation.properties">#this file is just a placeholder for now</echo>
94
95        <echo>Finished</echo>
96
97    </target>
98
99    <!-- Source -->
100    <target name="install-source-code" depends="">
101
102        <echo>Installing Source Code</echo>
103        <mkdir dir="${installDir}/src"/>
104        <unzip src="${antinstaller.jar}" dest="${installDir}">
105            <patternset>
106                <include name="src/**/*"/>
107                <include name="gs2build/common-src/**/*"/>
108                <include name="gs2build/build-src/**/*"/>
109                <include name="gs2build/runtime-src/**/*"/>
110            </patternset>
111        </unzip>
112    </target>
113
114    <target name="install-tomcat">
115        <echo>Installing Tomcat (packages/tomcat)</echo>
116        <unzip src="${antinstaller.jar}" dest="${installDir}">
117            <patternset>
118                <include name="packages/tomcat/**/*"/>
119            </patternset>
120        </unzip>
121        <echo>Changing tomcat ports tomcat's server.xml</echo>
122        <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
123        <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
124        <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
125       
126        <echo>Copying greenstone3.xml to tomcat directory</echo>
127        <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
128        <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="(.*)@gsdl3webhome@(.*)" replacement="$1${installDir}/web$2" />
129
130        <echo>Setting tomcat binaries to executable</echo>
131        <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
132        <echo/>
133    </target>
134
135    <target name="install-ant">
136        <echo>Installing Ant (packages/ant)</echo>
137        <unzip src="${antinstaller.jar}" dest="${installDir}">
138            <patternset>
139                <include name="packages/ant/**/*"/>
140            </patternset>
141        </unzip>
142        <echo>Setting ant binaries to executable</echo>
143        <chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/>
144        <echo/>
145    </target>
146
147    <target name="cleanuptarget"></target>
148   
149</project>
Note: See TracBrowser for help on using the browser.