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