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

Last change on this file since 15973 was 15973, checked in by oranfry, 13 years ago

made the install-ant and install-tomcat options work

File size: 7.0 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="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 binaries and set executable -->
29 <echo message="Installing Executable Binaries (bin)"/>
30 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="bin/**/*"/></patternset></unzip>
31 <echo/>
32
33 <echo message="Installing Documentation (docs)"/>
34 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="docs/**/*"/></patternset></unzip>
35 <echo/>
36
37 <echo message="Installing GLI (gli)"/>
38 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gli/**/*"/></patternset></unzip>
39 <echo/>
40
41 <echo message="Installing gs2build (gs2build)"/>
42 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gs2build/**/*"/></patternset></unzip>
43 <echo/>
44
45 <echo message="Installing Libraries (lib)"/>
46 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="lib/**/*"/></patternset></unzip>
47 <echo/>
48
49 <echo message="Installing Web Content (web)"/>
50 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="web/**/*"/></patternset></unzip>
51 <echo/>
52
53 <echo message="Installing Resources (resources)"/>
54 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="resources/**/*"/></patternset></unzip>
55 <echo/>
56
57 <echo message="Installing Top Level Files"/>
58 <unzip src="${antinstaller.jar}" dest="${installDir}">
59 <patternset>
60 <include name="build.xml"/>
61 <include name="build.properties"/>
62 <include name="gs3-server.sh"/>
63 <include name="gs3-setup.sh"/>
64 <include name="LICENSE.txt"/>
65 <include name="README.txt"/>
66 <include name="server.jar"/>
67 </patternset>
68 </unzip>
69 <echo/>
70
71 <echo message="Setting Binaries to Executable"/>
72 <chmod dir="${installDir}" includes="*.sh" perm="775"/>
73 <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
74 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
75 <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
76 <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
77 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
78 <echo/>
79
80 <!-- change the tomcat ports in build.properties -->
81 <echo message="Changing tomcat ports in build.properties"/>
82 <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
83 <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
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="$1${installDir}/web$2" />
89 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
90 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
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="$1${installDir}/web$2" />
96
97
98 <!-- in the gs3-setup.sh file, set ANT_HOME and put it in PATH (no need anymore)-->
99 <!--<echo>In the gs3-setup.sh file, set ANT_HOME and put it in PATH</echo>
100 <exec executable="echo" output="${installDir}/gs3-setup.sh" append="true">
101 <arg line="export ANT_HOME=${installDir}/packages/ant; export PATH=$ANT_HOME/bin:$PATH;"/>
102 </exec>-->
103
104 <!-- delete unneeded files -->
105 <echo message="Deleting some extraneous files"/>
106 <delete dir="${installDir}/resources/icons"/>
107 <delete file="${installDir}/resources/*.png"/>
108
109 <echo message="Finished"/>
110
111 </target>
112
113 <!-- Source -->
114 <target name="install-source-code" depends="">
115 <echo message="Installing Source Code (src)"/>
116 <mkdir dir="${installDir}/src"/>
117 <unzip src="${antinstaller.jar}" dest="${installDir}">
118 <patternset>
119 <include name="src/**/*"/>
120 </patternset>
121 </unzip>
122 </target>
123
124 <target name="install-java">
125
126 <echo message="Installing bundled java"/>
127
128 <copy todir="${installDir}/packages/jre">
129 <fileset dir="../@java.extracted@"/>
130 </copy>
131 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
132
133 <echo/>
134
135 </target>
136
137 <target name="install-tomcat">
138 <echo message="Installing Tomcat (packages/tomcat)"/>
139 <!-- extract the files -->
140 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/tomcat/**/*"/></patternset></unzip>
141
142 <!-- change the tomcat ports in tomcats server.xml -->
143 <echo message="Changing tomcat ports tomcat's server.xml"/>
144 <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
145 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
146 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
147
148 <!-- copy the greenstone3.xml file to tomcat -->
149 <echo message="Copying greenstone3.xml to tomcat directory"/>
150 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
151 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="(.*)@gsdl3webhome@(.*)" replacement="$1${installDir}/web$2" />
152
153 <!-- set binaries to executable -->
154 <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
155 <echo/>
156
157 </target>
158
159 <target name="install-ant">
160
161 <!-- extract the files -->
162 <echo message="Installing Ant (packages/ant)"/>
163 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/ant/**/*"/></patternset></unzip>
164
165 <!-- set binaries to executable -->
166 <chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/>
167 <echo/>
168 </target>
169
170
171
172 <target name="cleanuptarget">
173 </target>
174
175
176</project>
Note: See TracBrowser for help on using the repository browser.