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