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

Last change on this file since 17468 was 17468, checked in by oranfry, 14 years ago

importing the sevenzip task into all installer build.xmls

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