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

Revision 15142, 6.7 KB (checked in by oranfry, 11 years ago)

changes to the wrapper and installer logic, and a few changes to init and compile stuff

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="">
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
18    <condition property="bundled.java.exists">
19        <available file="../@java.extracted@/bin/java"/>
20    </condition>
21
22
23    <target name="default" depends="">
24
25        <!-- create the installation directory -->
26        <echo message="Creating Installation directory"/>
27        <echo>basedir: ${basedir}</echo>
28        <echo>installDir: ${installDir}</echo>
29        <echo>antinstaller.jar: ${antinstaller.jar}</echo>
30        <mkdir dir="${installDir}"/>
31
32
33        <!-- install binaries and set executable -->
34        <echo message="Installing Executable Binaries (bin)"/>
35        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="bin/**/*"/></patternset></unzip>
36        <echo/>
37
38        <echo message="Installing Documentation (docs)"/>
39        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="docs/**/*"/></patternset></unzip>
40        <echo/>
41
42        <echo message="Installing GLI (gli)"/>
43        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gli/**/*"/></patternset></unzip>
44        <echo/>
45
46        <echo message="Installing gs2build (gs2build)"/>
47        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gs2build/**/*"/></patternset></unzip>
48        <echo/>
49
50        <echo message="Installing Libraries (lib)"/>
51        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="lib/**/*"/></patternset></unzip>
52        <echo/>
53
54        <echo message="Installing Web Content (web)"/>
55        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="web/**/*"/></patternset></unzip>
56        <echo/>
57
58        <echo message="Installing Packages (packages)"/>
59        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/**/*"/></patternset></unzip>
60        <echo/>
61
62        <echo message="Installing Resources (resources)"/>
63        <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="resources/**/*"/></patternset></unzip>
64        <echo/>
65
66        <echo message="Installing Top Level Files"/>
67        <unzip src="${antinstaller.jar}" dest="${installDir}">
68            <patternset>
69                <include name="build.xml"/>
70                <include name="build.properties"/>
71                <include name="gs3-server.sh"/>
72                <include name="gs3-setup.sh"/>
73                <include name="LICENSE.txt"/>
74                <include name="README.txt"/>
75                <include name="server.jar"/>
76            </patternset>
77        </unzip>
78        <echo/>
79
80        <echo message="Setting Binaries to Executable"/>
81        <chmod dir="${installDir}" includes="*.sh" perm="775"/>
82        <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
83        <chmod dir="${installDir}/bin" includes="*" perm="775"/>
84        <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
85        <chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/>
86        <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
87        <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
88        <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
89        <echo/>
90
91        <!-- change the tomcat ports in build.properties -->
92        <echo message="Changing tomcat ports in build.properties"/>
93        <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
94        <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
95
96        <!-- change the tomcat ports in tomcats server.xml -->
97        <echo message="Changing tomcat ports tomcat's server.xml"/>
98        <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
99        <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
100        <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
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="$1${installDir}/web$2" />
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="$1${installDir}/web$2" />
111        <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
112        <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
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="$1${installDir}/web$2" />
118
119
120        <!-- in the gs3-setup.sh file, set ANT_HOME and put it in PATH (no need anymore)-->
121        <!--<echo>In the gs3-setup.sh file, set ANT_HOME and put it in PATH</echo>
122        <exec executable="echo" output="${installDir}/gs3-setup.sh" append="true">
123            <arg line="export ANT_HOME=${installDir}/packages/ant; export PATH=$ANT_HOME/bin:$PATH;"/>
124        </exec>-->
125
126        <!-- delete unneeded files -->     
127        <echo message="Deleting some extraneous files"/>
128        <delete dir="${installDir}/resources/icons"/>
129        <delete file="${installDir}/resources/*.png"/>
130
131        <echo message="Finished"/>
132
133    </target>
134
135    <!-- Source -->
136    <target name="tgsrc" depends="">
137        <echo message="Installing Source Code (src)"/>
138        <mkdir dir="${installDir}/src"/>
139        <unzip src="${antinstaller.jar}" dest="${installDir}">
140            <patternset>
141                <include name="src/**/*"/>
142            </patternset>
143        </unzip>
144    </target>
145
146    <target name="install-bundled-java" depends="" if="bundled.java.exists">
147        <echo message="Installing bundled java"/>
148        <copy todir="${installDir}/packages/jre">
149            <fileset dir="../@java.extracted@"/>
150        </copy>
151        <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>       
152    </target>
153
154    <target name="cleanuptarget" depends="install-bundled-java">
155    </target>
156   
157
158</project>
Note: See TracBrowser for help on using the browser.