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