[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 |
|
---|
[17596] | 19 | <target name="Installing Core System" depends="">
|
---|
[14982] | 20 |
|
---|
| 21 | <!-- create the installation directory -->
|
---|
[17257] | 22 | <echo>Creating Installation directory</echo>
|
---|
[14982] | 23 | <echo>basedir: ${basedir}</echo>
|
---|
| 24 | <echo>installDir: ${installDir}</echo>
|
---|
| 25 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
| 26 | <mkdir dir="${installDir}"/>
|
---|
| 27 |
|
---|
| 28 |
|
---|
[16686] | 29 | <!-- install files -->
|
---|
[17155] | 30 | <echo>Installing Core Files</echo>
|
---|
[17446] | 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"/>
|
---|
[14982] | 36 |
|
---|
[17444] | 37 | <!-- jre -->
|
---|
[17446] | 38 | <mkdir dir="packages"/>
|
---|
[17641] | 39 | <copy todir="${installDir}/packages/jre" failonerror="false">
|
---|
[17444] | 40 | <fileset dir="../@linux-java.extracted@"/>
|
---|
[17470] | 41 | </copy>
|
---|
[17444] | 42 | <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
|
---|
| 43 |
|
---|
[17123] | 44 | <echo>Setting Binaries to Executable</echo>
|
---|
[14982] | 45 | <chmod dir="${installDir}" includes="*.sh" perm="775"/>
|
---|
| 46 | <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
|
---|
[15142] | 47 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
[14982] | 48 | <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
|
---|
[17663] | 49 | <chmod dir="${installDir}/gs2build/bin/linux/imagemagick" includes="*" perm="775"/>
|
---|
[14982] | 50 | <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
|
---|
| 51 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
| 52 | <echo/>
|
---|
| 53 |
|
---|
[17123] | 54 | <echo>Changing tomcat ports in build.properties</echo>
|
---|
[14982] | 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 |
|
---|
[17123] | 58 | <echo>Setting up global properties</echo>
|
---|
[14982] | 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 |
|
---|
[17123] | 64 | <echo>Setting up log4j properties</echo>
|
---|
[14982] | 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 |
|
---|
[17257] | 68 | <echo>Creating installation properties file</echo>
|
---|
| 69 | <echo file="${installDir}/installation.properties">#this file is just a placeholder for now</echo>
|
---|
| 70 |
|
---|
[17123] | 71 | <echo>Finished</echo>
|
---|
[15142] | 72 |
|
---|
[14982] | 73 | </target>
|
---|
| 74 |
|
---|
[17652] | 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 |
|
---|
[14982] | 101 | <!-- Source -->
|
---|
[17596] | 102 | <target name="Installing Source Code" depends="">
|
---|
[17123] | 103 |
|
---|
[17257] | 104 | <echo>Installing Source Code</echo>
|
---|
[17446] | 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 |
|
---|
[17646] | 111 | </target>
|
---|
[17446] | 112 |
|
---|
[17646] | 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"/>
|
---|
[14982] | 121 | </target>
|
---|
| 122 |
|
---|
[17646] | 123 |
|
---|
[17596] | 124 | <target name="Installing Tomcat">
|
---|
[17123] | 125 | <echo>Installing Tomcat (packages/tomcat)</echo>
|
---|
[17446] | 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 |
|
---|
[17123] | 133 | <echo>Changing tomcat ports tomcat's server.xml</echo>
|
---|
[15973] | 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 |
|
---|
[17123] | 138 | <echo>Copying greenstone3.xml to tomcat directory</echo>
|
---|
[15973] | 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 |
|
---|
[17123] | 142 | <echo>Setting tomcat binaries to executable</echo>
|
---|
[15973] | 143 | <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
|
---|
| 144 | <echo/>
|
---|
[15142] | 145 | </target>
|
---|
[15205] | 146 |
|
---|
[17596] | 147 | <target name="Installing Ant">
|
---|
[17123] | 148 | <echo>Installing Ant (packages/ant)</echo>
|
---|
[17446] | 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 |
|
---|
[17123] | 156 | <echo>Setting ant binaries to executable</echo>
|
---|
[15973] | 157 | <chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/>
|
---|
| 158 | <echo/>
|
---|
[15205] | 159 | </target>
|
---|
| 160 |
|
---|
[14982] | 161 | </project>
|
---|