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