[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"/>
|
---|
[14982] | 17 |
|
---|
[15205] | 18 | <target name="install-core-components" depends="">
|
---|
[14982] | 19 |
|
---|
| 20 | <!-- create the installation directory -->
|
---|
[17257] | 21 | <echo>Creating Installation directory</echo>
|
---|
[14982] | 22 | <echo>basedir: ${basedir}</echo>
|
---|
| 23 | <echo>installDir: ${installDir}</echo>
|
---|
| 24 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
| 25 | <mkdir dir="${installDir}"/>
|
---|
| 26 |
|
---|
| 27 |
|
---|
[16686] | 28 | <!-- install files -->
|
---|
[17155] | 29 | <echo>Installing Core Files</echo>
|
---|
[16686] | 30 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
| 31 | <patternset>
|
---|
| 32 | <include name="bin/**/*"/>
|
---|
| 33 | <include name="docs/**/*"/>
|
---|
| 34 | <include name="gli/**/*"/>
|
---|
| 35 | <include name="gs2build/**/*"/>
|
---|
[17051] | 36 | <exclude name="gs2build/common-src/**/*"/>
|
---|
| 37 | <exclude name="gs2build/build-src/**/*"/>
|
---|
| 38 | <exclude name="gs2build/runtime-src/**/*"/>
|
---|
[16686] | 39 | <include name="lib/**/*"/>
|
---|
| 40 | <include name="web/**/*"/>
|
---|
| 41 | <include name="resources/**/*"/>
|
---|
[14982] | 42 |
|
---|
[16686] | 43 | <include name="greenstone3-build.xml"/>
|
---|
[14982] | 44 | <include name="build.properties"/>
|
---|
| 45 | <include name="gs3-server.sh"/>
|
---|
| 46 | <include name="gs3-setup.sh"/>
|
---|
| 47 | <include name="LICENSE.txt"/>
|
---|
| 48 | <include name="README.txt"/>
|
---|
| 49 | <include name="server.jar"/>
|
---|
[17244] | 50 | <include name="Uninstall.jar"/>
|
---|
[14982] | 51 | </patternset>
|
---|
| 52 | </unzip>
|
---|
| 53 | <echo/>
|
---|
| 54 |
|
---|
[17444] | 55 | <!-- jre -->
|
---|
| 56 | <move todir="${installDir}/packages/jre">
|
---|
| 57 | <fileset dir="../@linux-java.extracted@"/>
|
---|
| 58 | </move>
|
---|
| 59 | <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
|
---|
| 60 |
|
---|
| 61 |
|
---|
[17123] | 62 | <echo>Renaming greenstone3-build.xml back to build.xml</echo>
|
---|
[16686] | 63 | <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
|
---|
| 64 |
|
---|
[17123] | 65 | <echo>Setting Binaries to Executable</echo>
|
---|
[14982] | 66 | <chmod dir="${installDir}" includes="*.sh" perm="775"/>
|
---|
| 67 | <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
|
---|
[15142] | 68 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
[14982] | 69 | <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
|
---|
| 70 | <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
|
---|
| 71 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
| 72 | <echo/>
|
---|
| 73 |
|
---|
[17123] | 74 | <echo>Changing tomcat ports in build.properties</echo>
|
---|
[14982] | 75 | <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
|
---|
| 76 | <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
|
---|
| 77 |
|
---|
[17123] | 78 | <echo>Setting up global properties</echo>
|
---|
[14982] | 79 | <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
|
---|
| 80 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
| 81 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
|
---|
| 82 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
|
---|
| 83 |
|
---|
[17123] | 84 | <echo>Setting up log4j properties</echo>
|
---|
[14982] | 85 | <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
|
---|
| 86 | <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
| 87 |
|
---|
[17123] | 88 | <echo>Deleting some unneeded files</echo>
|
---|
[14982] | 89 | <delete dir="${installDir}/resources/icons"/>
|
---|
| 90 | <delete file="${installDir}/resources/*.png"/>
|
---|
| 91 |
|
---|
[17257] | 92 | <echo>Creating installation properties file</echo>
|
---|
| 93 | <echo file="${installDir}/installation.properties">#this file is just a placeholder for now</echo>
|
---|
| 94 |
|
---|
[17123] | 95 | <echo>Finished</echo>
|
---|
[15142] | 96 |
|
---|
[14982] | 97 | </target>
|
---|
| 98 |
|
---|
| 99 | <!-- Source -->
|
---|
[15205] | 100 | <target name="install-source-code" depends="">
|
---|
[17123] | 101 |
|
---|
[17257] | 102 | <echo>Installing Source Code</echo>
|
---|
[14982] | 103 | <mkdir dir="${installDir}/src"/>
|
---|
| 104 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
| 105 | <patternset>
|
---|
| 106 | <include name="src/**/*"/>
|
---|
[17051] | 107 | <include name="gs2build/common-src/**/*"/>
|
---|
| 108 | <include name="gs2build/build-src/**/*"/>
|
---|
| 109 | <include name="gs2build/runtime-src/**/*"/>
|
---|
[14982] | 110 | </patternset>
|
---|
| 111 | </unzip>
|
---|
| 112 | </target>
|
---|
| 113 |
|
---|
[15205] | 114 | <target name="install-tomcat">
|
---|
[17123] | 115 | <echo>Installing Tomcat (packages/tomcat)</echo>
|
---|
[16686] | 116 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
| 117 | <patternset>
|
---|
| 118 | <include name="packages/tomcat/**/*"/>
|
---|
| 119 | </patternset>
|
---|
| 120 | </unzip>
|
---|
[17123] | 121 | <echo>Changing tomcat ports tomcat's server.xml</echo>
|
---|
[15973] | 122 | <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
|
---|
| 123 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
|
---|
| 124 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
|
---|
| 125 |
|
---|
[17123] | 126 | <echo>Copying greenstone3.xml to tomcat directory</echo>
|
---|
[15973] | 127 | <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
|
---|
| 128 | <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="(.*)@gsdl3webhome@(.*)" replacement="$1${installDir}/web$2" />
|
---|
| 129 |
|
---|
[17123] | 130 | <echo>Setting tomcat binaries to executable</echo>
|
---|
[15973] | 131 | <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
|
---|
| 132 | <echo/>
|
---|
[15142] | 133 | </target>
|
---|
[15205] | 134 |
|
---|
| 135 | <target name="install-ant">
|
---|
[17123] | 136 | <echo>Installing Ant (packages/ant)</echo>
|
---|
[16686] | 137 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
| 138 | <patternset>
|
---|
| 139 | <include name="packages/ant/**/*"/>
|
---|
| 140 | </patternset>
|
---|
| 141 | </unzip>
|
---|
[17123] | 142 | <echo>Setting ant binaries to executable</echo>
|
---|
[15973] | 143 | <chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/>
|
---|
| 144 | <echo/>
|
---|
[15205] | 145 | </target>
|
---|
| 146 |
|
---|
[17123] | 147 | <target name="cleanuptarget"></target>
|
---|
[14982] | 148 |
|
---|
| 149 | </project>
|
---|