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