source: release-kits/mark3/installer/build.xml@ 16743

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

simplification of installer descriptors

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