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

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

initial import of LiRK3

File size: 6.1 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" default="" basedir="${basedir}">
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="default" 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 Packages (packages)"/>
54 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/**/*"/></patternset></unzip>
55 <echo/>
56
57 <echo message="Installing Resources (resources)"/>
58 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="resources/**/*"/></patternset></unzip>
59 <echo/>
60
61 <echo message="Installing Top Level Files"/>
62 <unzip src="${antinstaller.jar}" dest="${installDir}">
63 <patternset>
64 <include name="build.xml"/>
65 <include name="build.properties"/>
66 <include name="gs3-server.sh"/>
67 <include name="gs3-setup.sh"/>
68 <include name="LICENSE.txt"/>
69 <include name="README.txt"/>
70 <include name="server.jar"/>
71 </patternset>
72 </unzip>
73 <echo/>
74
75 <echo message="Setting Binaries to Executable"/>
76 <chmod dir="${installDir}" includes="*.sh" perm="775"/>
77 <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
78 <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
79 <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
80 <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
81 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
82 <echo/>
83
84 <!-- change the tomcat ports in build.properties -->
85 <echo message="Changing tomcat ports in build.properties"/>
86 <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
87 <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
88
89 <!-- change the tomcat ports in tomcats server.xml -->
90 <echo message="Changing tomcat ports tomcat's server.xml"/>
91 <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
92 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
93 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
94
95 <!-- copy the greenstone3.xml file to tomcat -->
96 <echo message="Copying greenstone3.xml to tomcat directory"/>
97 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
98 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="(.*)@gsdl3webhome@(.*)" replacement="$1${installDir}/web$2" />
99
100 <!-- set up global properties -->
101 <echo message="Setting up global properties"/>
102 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
103 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
104 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
105 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
106
107 <!-- set up log4j properties-->
108 <echo message="Setting up log4j properties"/>
109 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
110 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
111
112 <!-- in the gs3-setup.sh file, set ANT_HOME and put it in PATH -->
113 <echo>In the gs3-setup.sh file, set ANT_HOME and put it in PATH</echo>
114 <exec executable="echo" output="${installDir}/gs3-setup.sh" append="true">
115 <arg line="export ANT_HOME=${installDir}/packages/ant; export PATH=$ANT_HOME/bin:$PATH;"/>
116 </exec>
117
118 <!-- delete unneeded files -->
119 <delete dir="${installDir}/resources/icons"/>
120 <delete file="${installDir}/resources/*.png"/>
121
122 </target>
123
124 <!-- Source -->
125 <target name="tgsrc" depends="">
126 <echo message="Installing Source Code (src)"/>
127 <mkdir dir="${installDir}/src"/>
128 <unzip src="${antinstaller.jar}" dest="${installDir}">
129 <patternset>
130 <include name="src/**/*"/>
131 </patternset>
132 </unzip>
133 </target>
134
135 <target name="cleanuptarget">
136 </target>
137
138
139</project>
Note: See TracBrowser for help on using the repository browser.