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 | <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
|
---|
18 |
|
---|
19 | <target name="Installing Core System" depends="">
|
---|
20 |
|
---|
21 | <!-- create the installation directory -->
|
---|
22 | <echo message="Creating Installation directory"/>
|
---|
23 | <echo>basedir: ${basedir}</echo>
|
---|
24 | <echo>installDir: ${installDir}</echo>
|
---|
25 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
26 | <mkdir dir="${installDir}"/>
|
---|
27 |
|
---|
28 | <!-- install files -->
|
---|
29 | <echo message="Installing Files"/>
|
---|
30 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
|
---|
31 | <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
|
---|
32 | <delete file="core.lzma"/>
|
---|
33 | <unzip src="${basedir}/core.comp" dest="${installDir}"/>
|
---|
34 | <delete file="core.comp"/>
|
---|
35 |
|
---|
36 | <echo message="Setting Binaries to Executable"/>
|
---|
37 | <chmod dir="${installDir}" includes="*.sh" perm="775"/>
|
---|
38 | <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
|
---|
39 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
40 | <chmod dir="${installDir}/gs2build/bin/darwin" includes="*" perm="775"/>
|
---|
41 | <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
|
---|
42 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
43 | <echo/>
|
---|
44 |
|
---|
45 | <!-- change the tomcat ports in build.properties -->
|
---|
46 | <echo message="Changing tomcat ports in build.properties"/>
|
---|
47 | <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
|
---|
48 | <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
|
---|
49 |
|
---|
50 | <!-- set up global properties -->
|
---|
51 | <echo message="Setting up global properties"/>
|
---|
52 | <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
|
---|
53 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
54 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
|
---|
55 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
|
---|
56 |
|
---|
57 | <!-- set up log4j properties-->
|
---|
58 | <echo message="Setting up log4j properties"/>
|
---|
59 | <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
|
---|
60 | <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
61 |
|
---|
62 | <echo>Create usage.txt</echo>
|
---|
63 | <echo file="${installDir}/gs2build/etc/usage.txt"></echo>
|
---|
64 |
|
---|
65 | <echo>Creating installation properties file</echo>
|
---|
66 | <echo file="${installDir}/installation.properties">#this file is just a placeholder for now</echo>
|
---|
67 |
|
---|
68 | <echo message="Finished"/>
|
---|
69 |
|
---|
70 | </target>
|
---|
71 |
|
---|
72 | <target name="Installing Tomcat">
|
---|
73 | <echo message="Installing Tomcat (packages/tomcat)"/>
|
---|
74 | <mkdir dir="packages"/>
|
---|
75 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="tomcat.lzma"/></patternset></unzip>
|
---|
76 | <sevenzip task="decode" input="${basedir}/tomcat.lzma" output="${basedir}/tomcat.comp"/>
|
---|
77 | <delete file="tomcat.lzma"/>
|
---|
78 | <unzip src="${basedir}/tomcat.comp" dest="${installDir}/packages"/>
|
---|
79 | <delete file="tomcat.comp"/>
|
---|
80 |
|
---|
81 | <!-- change the tomcat ports in tomcats server.xml -->
|
---|
82 | <echo message="Changing tomcat ports tomcat's server.xml"/>
|
---|
83 | <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
|
---|
84 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
|
---|
85 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
|
---|
86 |
|
---|
87 | <!-- copy the greenstone3.xml file to tomcat -->
|
---|
88 | <echo message="Copying greenstone3.xml to tomcat directory"/>
|
---|
89 | <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
|
---|
90 | <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="(.*)@gsdl3webhome@(.*)" replacement="$1${installDir}/web$2" />
|
---|
91 |
|
---|
92 | <!-- set binaries to executable -->
|
---|
93 | <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
|
---|
94 | <echo/>
|
---|
95 |
|
---|
96 | </target>
|
---|
97 |
|
---|
98 | <target name="Installing Ant">
|
---|
99 |
|
---|
100 | <!-- extract the files -->
|
---|
101 | <echo message="Installing Ant (packages/ant)"/>
|
---|
102 | <mkdir dir="packages"/>
|
---|
103 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ant.lzma"/></patternset></unzip>
|
---|
104 | <sevenzip task="decode" input="${basedir}/ant.lzma" output="${basedir}/ant.comp"/>
|
---|
105 | <delete file="ant.lzma"/>
|
---|
106 | <unzip src="${basedir}/ant.comp" dest="${installDir}/packages"/>
|
---|
107 | <delete file="ant.comp"/>
|
---|
108 |
|
---|
109 | <!-- set binaries to executable -->
|
---|
110 | <chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/>
|
---|
111 | <echo/>
|
---|
112 | </target>
|
---|
113 |
|
---|
114 | <!-- ImageMagick -->
|
---|
115 | <target name="Installing ImageMagick" depends="">
|
---|
116 | <echo message="Installing ImageMagick"/>
|
---|
117 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
|
---|
118 | <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
|
---|
119 | <delete file="imagemagick.lzma"/>
|
---|
120 | <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/gs2build/bin/darwin" />
|
---|
121 | <delete file="imagemagick.comp"/>
|
---|
122 | <chmod dir="${installDir}/gs2build/bin/darwin/imagemagick/bin" includes="*" perm="775"/>
|
---|
123 | </target>
|
---|
124 |
|
---|
125 | <!-- Ghostscript -->
|
---|
126 | <target name="Installing Ghostscript" depends="">
|
---|
127 | <echo message="Installing Ghostscript"/>
|
---|
128 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
|
---|
129 | <sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/>
|
---|
130 | <delete file="ghostscript.lzma"/>
|
---|
131 | <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/gs2build/bin/darwin" />
|
---|
132 | <delete file="ghostscript.comp"/>
|
---|
133 | <chmod dir="${installDir}/gs2build/bin/darwin/ghostscript/bin" includes="*" perm="775"/>
|
---|
134 | </target>
|
---|
135 |
|
---|
136 | <target name="Source Release" depends="">
|
---|
137 |
|
---|
138 | <!-- create the installation directory -->
|
---|
139 | <echo message="Creating Installation directory"/>
|
---|
140 | <mkdir dir="${installDir}"/>
|
---|
141 |
|
---|
142 | <echo>Installing Source Release</echo>
|
---|
143 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="source-release.lzma"/></patternset></unzip>
|
---|
144 | <sevenzip task="decode" input="${basedir}/source-release.lzma" output="${basedir}/source-release.comp"/>
|
---|
145 | <delete file="source-release.lzma"/>
|
---|
146 | <unzip src="${basedir}/source-release.comp" dest="${installDir}"/>
|
---|
147 | <delete file="source-release.comp"/>
|
---|
148 |
|
---|
149 | <echo message="Setting Binaries to Executable"/>
|
---|
150 | <chmod dir="${installDir}" includes="*.sh" perm="775"/>
|
---|
151 | <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
|
---|
152 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
153 | <chmod dir="${installDir}/gs2build/bin/darwin" includes="*" perm="775"/>
|
---|
154 | <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
|
---|
155 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
156 | <echo/>
|
---|
157 |
|
---|
158 | <!-- set up global properties -->
|
---|
159 | <echo message="Setting up global properties"/>
|
---|
160 | <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
|
---|
161 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
162 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
|
---|
163 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
|
---|
164 |
|
---|
165 | <!-- set up log4j properties-->
|
---|
166 | <echo message="Setting up log4j properties"/>
|
---|
167 | <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
|
---|
168 | <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
169 |
|
---|
170 | <echo>Create usage.txt</echo>
|
---|
171 | <echo file="${installDir}/gs2build/etc/usage.txt"></echo>
|
---|
172 |
|
---|
173 | <echo>Creating installation properties file</echo>
|
---|
174 | <echo file="${installDir}/installation.properties">#this file is just a placeholder for now</echo>
|
---|
175 |
|
---|
176 | <echo message="Finished"/>
|
---|
177 |
|
---|
178 | </target>
|
---|
179 |
|
---|
180 |
|
---|
181 |
|
---|
182 | </project>
|
---|