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