[14982] | 1 | <?xml version="1.0"?>
|
---|
| 2 | <!--
|
---|
| 3 | This is the build.xml run by AntInstaller for the installer
|
---|
| 4 | -->
|
---|
| 5 |
|
---|
[15205] | 6 | <project name="Installation">
|
---|
[14982] | 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 -->
|
---|
[17107] | 16 | <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
|
---|
[17468] | 17 | <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
|
---|
[14982] | 18 |
|
---|
[17597] | 19 | <target name="Installing Core System" depends="">
|
---|
[14982] | 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 |
|
---|
[16743] | 28 | <!-- install files -->
|
---|
| 29 | <echo message="Installing Files"/>
|
---|
[17453] | 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"/>
|
---|
[14982] | 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"/>
|
---|
[15142] | 39 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
[17663] | 40 | <chmod dir="${installDir}/gs2build/bin/darwin" includes="*" perm="775"/>
|
---|
[14982] | 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 |
|
---|
[17652] | 62 | <echo>Creating installation properties file</echo>
|
---|
| 63 | <echo file="${installDir}/installation.properties">#this file is just a placeholder for now</echo>
|
---|
[15142] | 64 |
|
---|
[17652] | 65 | <echo message="Finished"/>
|
---|
[14982] | 66 |
|
---|
[17652] | 67 | </target>
|
---|
[14982] | 68 |
|
---|
[17652] | 69 | <!-- sourcecode core system -->
|
---|
| 70 | <target name="Installing Source Code Core">
|
---|
| 71 |
|
---|
| 72 | <echo>Installing Source Code Core</echo>
|
---|
| 73 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode-core.lzma"/></patternset></unzip>
|
---|
| 74 | <sevenzip task="decode" input="${basedir}/sourcecode-core.lzma" output="${basedir}/sourcecode-core.comp"/>
|
---|
| 75 | <delete file="sourcecode-core.lzma"/>
|
---|
| 76 | <unzip src="${basedir}/sourcecode-core.comp" dest="${installDir}"/>
|
---|
| 77 | <delete file="sourcecode-core.comp"/>
|
---|
| 78 |
|
---|
| 79 | <echo>Setting up global properties</echo>
|
---|
| 80 | <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
|
---|
| 81 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
| 82 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
|
---|
| 83 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
|
---|
| 84 |
|
---|
| 85 | <echo>Setting up log4j properties</echo>
|
---|
| 86 | <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
|
---|
| 87 | <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
| 88 |
|
---|
[17257] | 89 | <echo>Creating installation properties file</echo>
|
---|
| 90 | <echo file="${installDir}/installation.properties">#this file is just a placeholder for now</echo>
|
---|
| 91 |
|
---|
[15142] | 92 |
|
---|
[14982] | 93 | </target>
|
---|
| 94 |
|
---|
[17652] | 95 |
|
---|
[14982] | 96 | <!-- Source -->
|
---|
[17597] | 97 | <target name="Installing Source Code" depends="">
|
---|
[17453] | 98 | <echo>Installing Source Code</echo>
|
---|
| 99 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
|
---|
| 100 | <sevenzip task="decode" input="${basedir}/sourcecode.lzma" output="${basedir}/sourcecode.comp"/>
|
---|
| 101 | <delete file="sourcecode.lzma"/>
|
---|
| 102 | <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
|
---|
| 103 | <delete file="sourcecode.comp"/>
|
---|
[14982] | 104 | </target>
|
---|
| 105 |
|
---|
[17597] | 106 | <target name="Installing Tomcat">
|
---|
[15973] | 107 | <echo message="Installing Tomcat (packages/tomcat)"/>
|
---|
[17453] | 108 | <mkdir dir="packages"/>
|
---|
| 109 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="tomcat.lzma"/></patternset></unzip>
|
---|
| 110 | <sevenzip task="decode" input="${basedir}/tomcat.lzma" output="${basedir}/tomcat.comp"/>
|
---|
| 111 | <delete file="tomcat.lzma"/>
|
---|
| 112 | <unzip src="${basedir}/tomcat.comp" dest="${installDir}/packages"/>
|
---|
| 113 | <delete file="tomcat.comp"/>
|
---|
[15973] | 114 |
|
---|
| 115 | <!-- change the tomcat ports in tomcats server.xml -->
|
---|
| 116 | <echo message="Changing tomcat ports tomcat's server.xml"/>
|
---|
| 117 | <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
|
---|
| 118 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
|
---|
| 119 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
|
---|
| 120 |
|
---|
| 121 | <!-- copy the greenstone3.xml file to tomcat -->
|
---|
| 122 | <echo message="Copying greenstone3.xml to tomcat directory"/>
|
---|
| 123 | <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
|
---|
| 124 | <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="(.*)@gsdl3webhome@(.*)" replacement="$1${installDir}/web$2" />
|
---|
| 125 |
|
---|
| 126 | <!-- set binaries to executable -->
|
---|
| 127 | <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
|
---|
| 128 | <echo/>
|
---|
| 129 |
|
---|
[15142] | 130 | </target>
|
---|
[15205] | 131 |
|
---|
[17597] | 132 | <target name="Installing Ant">
|
---|
[15973] | 133 |
|
---|
| 134 | <!-- extract the files -->
|
---|
| 135 | <echo message="Installing Ant (packages/ant)"/>
|
---|
[17453] | 136 | <mkdir dir="packages"/>
|
---|
| 137 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ant.lzma"/></patternset></unzip>
|
---|
| 138 | <sevenzip task="decode" input="${basedir}/ant.lzma" output="${basedir}/ant.comp"/>
|
---|
| 139 | <delete file="ant.lzma"/>
|
---|
| 140 | <unzip src="${basedir}/ant.comp" dest="${installDir}/packages"/>
|
---|
| 141 | <delete file="ant.comp"/>
|
---|
[15973] | 142 |
|
---|
| 143 | <!-- set binaries to executable -->
|
---|
| 144 | <chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/>
|
---|
| 145 | <echo/>
|
---|
[15205] | 146 | </target>
|
---|
| 147 |
|
---|
[17711] | 148 | <!-- ImageMagick -->
|
---|
| 149 | <target name="Installing ImageMagick" depends="">
|
---|
| 150 | <echo message="Installing ImageMagick"/>
|
---|
| 151 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
|
---|
| 152 | <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
|
---|
| 153 | <delete file="imagemagick.lzma"/>
|
---|
| 154 | <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/gs2build/bin/darwin" />
|
---|
| 155 | <delete file="imagemagick.comp"/>
|
---|
[17715] | 156 | <chmod dir="${installDir}/gs2build/bin/darwin/imagemagick/bin" includes="*" perm="775"/>
|
---|
[17711] | 157 | </target>
|
---|
| 158 |
|
---|
| 159 | <!-- Ghostscript -->
|
---|
| 160 | <target name="Installing Ghostscript" depends="">
|
---|
| 161 | <echo message="Installing Ghostscript"/>
|
---|
| 162 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
|
---|
| 163 | <sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/>
|
---|
| 164 | <delete file="ghostscript.lzma"/>
|
---|
| 165 | <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/gs2build/bin/darwin" />
|
---|
| 166 | <delete file="ghostscript.comp"/>
|
---|
[17715] | 167 | <chmod dir="${installDir}/gs2build/bin/darwin/ghostscript/bin" includes="*" perm="775"/>
|
---|
[17711] | 168 | </target>
|
---|
| 169 |
|
---|
| 170 |
|
---|
[14982] | 171 | </project>
|
---|