source: release-kits/lirk3/installer/build.xml@ 17155

Last change on this file since 17155 was 17155, checked in by oranfry, 12 years ago

minor output improvement

File size: 5.8 KB
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 message="Creating Installation directory"/>
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 </patternset>
51 </unzip>
52 <echo/>
53
54 <echo>Renaming greenstone3-build.xml back to build.xml</echo>
55 <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
56
57 <echo>Setting Binaries to Executable</echo>
58 <chmod dir="${installDir}" includes="*.sh" perm="775"/>
59 <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
60 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
61 <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
62 <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
63 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
64 <echo/>
65
66 <echo>Changing tomcat ports in build.properties</echo>
67 <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
68 <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
69
70 <echo>Setting up global properties</echo>
71 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
72 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
73 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
74 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
75
76 <echo>Setting up log4j properties</echo>
77 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
78 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
79
80 <echo>Deleting some unneeded files</echo>
81 <delete dir="${installDir}/resources/icons"/>
82 <delete file="${installDir}/resources/*.png"/>
83
84 <echo>Finished</echo>
85
86 </target>
87
88 <!-- Source -->
89 <target name="install-source-code" depends="">
90
91 <echo>Installing Source Code<echo>
92 <mkdir dir="${installDir}/src"/>
93 <unzip src="${antinstaller.jar}" dest="${installDir}">
94 <patternset>
95 <include name="src/**/*"/>
96 <include name="gs2build/common-src/**/*"/>
97 <include name="gs2build/build-src/**/*"/>
98 <include name="gs2build/runtime-src/**/*"/>
99 </patternset>
100 </unzip>
101 </target>
102
103 <target name="install-java">
104 <echo>Installing bundled java</echo>
105 <copy todir="${installDir}/packages/jre">
106 <fileset dir="../@java.extracted@"/>
107 </copy>
108 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
109 <echo/>
110 </target>
111
112 <target name="install-tomcat">
113 <echo>Installing Tomcat (packages/tomcat)</echo>
114 <unzip src="${antinstaller.jar}" dest="${installDir}">
115 <patternset>
116 <include name="packages/tomcat/**/*"/>
117 </patternset>
118 </unzip>
119 <echo>Changing tomcat ports tomcat's server.xml</echo>
120 <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
121 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
122 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
123
124 <echo>Copying greenstone3.xml to tomcat directory</echo>
125 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
126 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="(.*)@gsdl3webhome@(.*)" replacement="$1${installDir}/web$2" />
127
128 <echo>Setting tomcat binaries to executable</echo>
129 <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
130 <echo/>
131 </target>
132
133 <target name="install-ant">
134 <echo>Installing Ant (packages/ant)</echo>
135 <unzip src="${antinstaller.jar}" dest="${installDir}">
136 <patternset>
137 <include name="packages/ant/**/*"/>
138 </patternset>
139 </unzip>
140 <echo>Setting ant binaries to executable</echo>
141 <chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/>
142 <echo/>
143 </target>
144
145 <target name="cleanuptarget"></target>
146
147</project>
Note: See TracBrowser for help on using the repository browser.