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

Last change on this file since 17663 was 17663, checked in by oranfry, 15 years ago

fixes to lirk and mark

File size: 7.5 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 <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
18
19 <target name="Installing Core System" depends="">
20
21 <!-- create the installation directory -->
22 <echo message="Creating Installation directory"/>
23 <echo>basedir: ${basedir}</echo>
24 <echo>installDir: ${installDir}</echo>
25 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
26 <mkdir dir="${installDir}"/>
27
28 <!-- install files -->
29 <echo message="Installing Files"/>
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 <echo message="Setting Binaries to Executable"/>
37 <chmod dir="${installDir}" includes="*.sh" perm="775"/>
38 <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
39 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
40 <chmod dir="${installDir}/gs2build/bin/darwin" includes="*" perm="775"/>
41 <chmod dir="${installDir}/gs2build/bin/darwin/imagemagick" includes="*" perm="775"/>
42 <chmod dir="${installDir}/gs2build/bin/darwin/ghostscript" includes="*" perm="775"/>
43 <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
44 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
45 <echo/>
46
47 <!-- change the tomcat ports in build.properties -->
48 <echo message="Changing tomcat ports in build.properties"/>
49 <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
50 <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
51
52 <!-- set up global properties -->
53 <echo message="Setting up global properties"/>
54 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
55 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
56 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
57 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
58
59 <!-- set up log4j properties-->
60 <echo message="Setting up log4j properties"/>
61 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
62 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
63
64 <echo>Creating installation properties file</echo>
65 <echo file="${installDir}/installation.properties">#this file is just a placeholder for now</echo>
66
67 <echo message="Finished"/>
68
69 </target>
70
71 <!-- sourcecode core system -->
72 <target name="Installing Source Code Core">
73
74 <echo>Installing Source Code Core</echo>
75 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode-core.lzma"/></patternset></unzip>
76 <sevenzip task="decode" input="${basedir}/sourcecode-core.lzma" output="${basedir}/sourcecode-core.comp"/>
77 <delete file="sourcecode-core.lzma"/>
78 <unzip src="${basedir}/sourcecode-core.comp" dest="${installDir}"/>
79 <delete file="sourcecode-core.comp"/>
80
81 <echo>Setting up global properties</echo>
82 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
83 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
84 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
85 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
86
87 <echo>Setting up log4j properties</echo>
88 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
89 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
90
91 <echo>Creating installation properties file</echo>
92 <echo file="${installDir}/installation.properties">#this file is just a placeholder for now</echo>
93
94
95 </target>
96
97
98 <!-- Source -->
99 <target name="Installing Source Code" depends="">
100 <echo>Installing Source Code</echo>
101 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
102 <sevenzip task="decode" input="${basedir}/sourcecode.lzma" output="${basedir}/sourcecode.comp"/>
103 <delete file="sourcecode.lzma"/>
104 <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
105 <delete file="sourcecode.comp"/>
106 </target>
107
108 <target name="Installing Tomcat">
109 <echo message="Installing Tomcat (packages/tomcat)"/>
110 <mkdir dir="packages"/>
111 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="tomcat.lzma"/></patternset></unzip>
112 <sevenzip task="decode" input="${basedir}/tomcat.lzma" output="${basedir}/tomcat.comp"/>
113 <delete file="tomcat.lzma"/>
114 <unzip src="${basedir}/tomcat.comp" dest="${installDir}/packages"/>
115 <delete file="tomcat.comp"/>
116
117 <!-- change the tomcat ports in tomcats server.xml -->
118 <echo message="Changing tomcat ports tomcat's server.xml"/>
119 <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
120 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
121 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
122
123 <!-- copy the greenstone3.xml file to tomcat -->
124 <echo message="Copying greenstone3.xml to tomcat directory"/>
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 <!-- set binaries to executable -->
129 <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
130 <echo/>
131
132 </target>
133
134 <target name="Installing Ant">
135
136 <!-- extract the files -->
137 <echo message="Installing Ant (packages/ant)"/>
138 <mkdir dir="packages"/>
139 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ant.lzma"/></patternset></unzip>
140 <sevenzip task="decode" input="${basedir}/ant.lzma" output="${basedir}/ant.comp"/>
141 <delete file="ant.lzma"/>
142 <unzip src="${basedir}/ant.comp" dest="${installDir}/packages"/>
143 <delete file="ant.comp"/>
144
145 <!-- set binaries to executable -->
146 <chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/>
147 <echo/>
148 </target>
149
150</project>
Note: See TracBrowser for help on using the repository browser.