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

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

got the component scheme working in lirk3

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="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
31        <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
32        <delete file="core.lzma"/>
33        <unzip src="${basedir}/core.comp" dest="${installDir}"/>
34        <delete file="core.comp"/>
35
36        <!-- jre -->
37        <mkdir dir="packages"/>
38        <move todir="${installDir}/packages/jre">
39            <fileset dir="../@linux-java.extracted@"/>
40        </move>
41        <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>       
42
43
44        <echo>Renaming greenstone3-build.xml back to build.xml</echo>
45        <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
46
47        <echo>Setting Binaries to Executable</echo>
48        <chmod dir="${installDir}" includes="*.sh" perm="775"/>
49        <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
50        <chmod dir="${installDir}/bin" includes="*" perm="775"/>
51        <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
52        <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
53        <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
54        <echo/>
55
56        <echo>Changing tomcat ports in build.properties</echo>
57        <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
58        <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
59
60        <echo>Setting up global properties</echo>
61        <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
62        <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
63        <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
64        <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
65
66        <echo>Setting up log4j properties</echo>
67        <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
68        <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
69
70        <echo>Deleting some unneeded files</echo>
71        <delete dir="${installDir}/resources/icons"/>
72        <delete file="${installDir}/resources/*.png"/>
73
74        <echo>Creating installation properties file</echo>
75        <echo file="${installDir}/installation.properties">#this file is just a placeholder for now</echo>
76
77        <echo>Finished</echo>
78
79    </target>
80
81    <!-- Source -->
82    <target name="install-source-code" depends="">
83
84        <echo>Installing Source Code</echo>
85        <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
86        <sevenzip task="decode" input="${basedir}/sourcecode.lzma" output="${basedir}/sourcecode.comp"/>
87        <delete file="sourcecode.lzma"/>
88        <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
89        <delete file="sourcecode.comp"/>
90
91
92    </target>
93
94    <target name="install-tomcat">
95        <echo>Installing Tomcat (packages/tomcat)</echo>
96        <mkdir dir="packages"/>
97        <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="tomcat.lzma"/></patternset></unzip>
98        <sevenzip task="decode" input="${basedir}/tomcat.lzma" output="${basedir}/tomcat.comp"/>
99        <delete file="tomcat.lzma"/>
100        <unzip src="${basedir}/tomcat.comp" dest="${installDir}/packages"/>
101        <delete file="tomcat.comp"/>
102
103        <echo>Changing tomcat ports tomcat's server.xml</echo>
104        <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
105        <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
106        <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
107       
108        <echo>Copying greenstone3.xml to tomcat directory</echo>
109        <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
110        <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="(.*)@gsdl3webhome@(.*)" replacement="$1${installDir}/web$2" />
111
112        <echo>Setting tomcat binaries to executable</echo>
113        <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
114        <echo/>
115    </target>
116
117    <target name="install-ant">
118        <echo>Installing Ant (packages/ant)</echo>
119        <mkdir dir="packages"/>
120        <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ant.lzma"/></patternset></unzip>
121        <sevenzip task="decode" input="${basedir}/ant.lzma" output="${basedir}/ant.comp"/>
122        <delete file="ant.lzma"/>
123        <unzip src="${basedir}/ant.comp" dest="${installDir}/packages"/>
124        <delete file="ant.comp"/>
125
126        <echo>Setting ant binaries to executable</echo>
127        <chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/>
128        <echo/>
129    </target>
130
131    <target name="cleanuptarget"></target>
132   
133</project>
Note: See TracBrowser for help on using the browser.