[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 |
|
---|
[15205] | 19 | <target name="install-core-components" 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"/>
|
---|
[17444] | 39 | <move todir="${installDir}/packages/jre">
|
---|
| 40 | <fileset dir="../@linux-java.extracted@"/>
|
---|
| 41 | </move>
|
---|
| 42 | <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
|
---|
| 43 |
|
---|
| 44 |
|
---|
[17123] | 45 | <echo>Renaming greenstone3-build.xml back to build.xml</echo>
|
---|
[16686] | 46 | <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
|
---|
| 47 |
|
---|
[17123] | 48 | <echo>Setting Binaries to Executable</echo>
|
---|
[14982] | 49 | <chmod dir="${installDir}" includes="*.sh" perm="775"/>
|
---|
| 50 | <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
|
---|
[15142] | 51 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
[14982] | 52 | <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
|
---|
| 53 | <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
|
---|
| 54 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
| 55 | <echo/>
|
---|
| 56 |
|
---|
[17123] | 57 | <echo>Changing tomcat ports in build.properties</echo>
|
---|
[14982] | 58 | <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
|
---|
| 59 | <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
|
---|
| 60 |
|
---|
[17123] | 61 | <echo>Setting up global properties</echo>
|
---|
[14982] | 62 | <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
|
---|
| 63 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
| 64 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
|
---|
| 65 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
|
---|
| 66 |
|
---|
[17123] | 67 | <echo>Setting up log4j properties</echo>
|
---|
[14982] | 68 | <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
|
---|
| 69 | <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
| 70 |
|
---|
[17123] | 71 | <echo>Deleting some unneeded files</echo>
|
---|
[14982] | 72 | <delete dir="${installDir}/resources/icons"/>
|
---|
| 73 | <delete file="${installDir}/resources/*.png"/>
|
---|
| 74 |
|
---|
[17257] | 75 | <echo>Creating installation properties file</echo>
|
---|
| 76 | <echo file="${installDir}/installation.properties">#this file is just a placeholder for now</echo>
|
---|
| 77 |
|
---|
[17123] | 78 | <echo>Finished</echo>
|
---|
[15142] | 79 |
|
---|
[14982] | 80 | </target>
|
---|
| 81 |
|
---|
| 82 | <!-- Source -->
|
---|
[15205] | 83 | <target name="install-source-code" depends="">
|
---|
[17123] | 84 |
|
---|
[17257] | 85 | <echo>Installing Source Code</echo>
|
---|
[17446] | 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 |
|
---|
| 92 |
|
---|
[14982] | 93 | </target>
|
---|
| 94 |
|
---|
[15205] | 95 | <target name="install-tomcat">
|
---|
[17123] | 96 | <echo>Installing Tomcat (packages/tomcat)</echo>
|
---|
[17446] | 97 | <mkdir dir="packages"/>
|
---|
| 98 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="tomcat.lzma"/></patternset></unzip>
|
---|
| 99 | <sevenzip task="decode" input="${basedir}/tomcat.lzma" output="${basedir}/tomcat.comp"/>
|
---|
| 100 | <delete file="tomcat.lzma"/>
|
---|
| 101 | <unzip src="${basedir}/tomcat.comp" dest="${installDir}/packages"/>
|
---|
| 102 | <delete file="tomcat.comp"/>
|
---|
| 103 |
|
---|
[17123] | 104 | <echo>Changing tomcat ports tomcat's server.xml</echo>
|
---|
[15973] | 105 | <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
|
---|
| 106 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
|
---|
| 107 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
|
---|
| 108 |
|
---|
[17123] | 109 | <echo>Copying greenstone3.xml to tomcat directory</echo>
|
---|
[15973] | 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 |
|
---|
[17123] | 113 | <echo>Setting tomcat binaries to executable</echo>
|
---|
[15973] | 114 | <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
|
---|
| 115 | <echo/>
|
---|
[15142] | 116 | </target>
|
---|
[15205] | 117 |
|
---|
| 118 | <target name="install-ant">
|
---|
[17123] | 119 | <echo>Installing Ant (packages/ant)</echo>
|
---|
[17446] | 120 | <mkdir dir="packages"/>
|
---|
| 121 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ant.lzma"/></patternset></unzip>
|
---|
| 122 | <sevenzip task="decode" input="${basedir}/ant.lzma" output="${basedir}/ant.comp"/>
|
---|
| 123 | <delete file="ant.lzma"/>
|
---|
| 124 | <unzip src="${basedir}/ant.comp" dest="${installDir}/packages"/>
|
---|
| 125 | <delete file="ant.comp"/>
|
---|
| 126 |
|
---|
[17123] | 127 | <echo>Setting ant binaries to executable</echo>
|
---|
[15973] | 128 | <chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/>
|
---|
| 129 | <echo/>
|
---|
[15205] | 130 | </target>
|
---|
| 131 |
|
---|
[17123] | 132 | <target name="cleanuptarget"></target>
|
---|
[14982] | 133 |
|
---|
| 134 | </project>
|
---|