[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 -->
|
---|
| 21 | <echo message="Creating Installation directory"/>
|
---|
| 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"/>
|
---|
| 50 | </patternset>
|
---|
| 51 | </unzip>
|
---|
| 52 | <echo/>
|
---|
| 53 |
|
---|
[17123] | 54 | <echo>Renaming greenstone3-build.xml back to build.xml</echo>
|
---|
[16686] | 55 | <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
|
---|
| 56 |
|
---|
[17123] | 57 | <echo>Setting Binaries to Executable</echo>
|
---|
[14982] | 58 | <chmod dir="${installDir}" includes="*.sh" perm="775"/>
|
---|
| 59 | <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
|
---|
[15142] | 60 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
[14982] | 61 | <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
|
---|
| 62 | <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
|
---|
| 63 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
| 64 | <echo/>
|
---|
| 65 |
|
---|
[17123] | 66 | <echo>Changing tomcat ports in build.properties</echo>
|
---|
[14982] | 67 | <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
|
---|
| 68 | <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
|
---|
| 69 |
|
---|
[17123] | 70 | <echo>Setting up global properties</echo>
|
---|
[14982] | 71 | <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
|
---|
| 72 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
| 73 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
|
---|
| 74 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
|
---|
| 75 |
|
---|
[17123] | 76 | <echo>Setting up log4j properties</echo>
|
---|
[14982] | 77 | <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
|
---|
| 78 | <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
| 79 |
|
---|
[17123] | 80 | <echo>Deleting some unneeded files</echo>
|
---|
[14982] | 81 | <delete dir="${installDir}/resources/icons"/>
|
---|
| 82 | <delete file="${installDir}/resources/*.png"/>
|
---|
| 83 |
|
---|
[17123] | 84 | <echo>Finished</echo>
|
---|
[15142] | 85 |
|
---|
[14982] | 86 | </target>
|
---|
| 87 |
|
---|
| 88 | <!-- Source -->
|
---|
[15205] | 89 | <target name="install-source-code" depends="">
|
---|
[17123] | 90 |
|
---|
| 91 | <echo>Installing Source Code<echo>
|
---|
[14982] | 92 | <mkdir dir="${installDir}/src"/>
|
---|
| 93 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
| 94 | <patternset>
|
---|
| 95 | <include name="src/**/*"/>
|
---|
[17051] | 96 | <include name="gs2build/common-src/**/*"/>
|
---|
| 97 | <include name="gs2build/build-src/**/*"/>
|
---|
| 98 | <include name="gs2build/runtime-src/**/*"/>
|
---|
[14982] | 99 | </patternset>
|
---|
| 100 | </unzip>
|
---|
| 101 | </target>
|
---|
| 102 |
|
---|
[15205] | 103 | <target name="install-java">
|
---|
[17123] | 104 | <echo>Installing bundled java</echo>
|
---|
[15142] | 105 | <copy todir="${installDir}/packages/jre">
|
---|
| 106 | <fileset dir="../@java.extracted@"/>
|
---|
| 107 | </copy>
|
---|
| 108 | <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
|
---|
[15973] | 109 | <echo/>
|
---|
[14982] | 110 | </target>
|
---|
[15142] | 111 |
|
---|
[15205] | 112 | <target name="install-tomcat">
|
---|
[17123] | 113 | <echo>Installing Tomcat (packages/tomcat)</echo>
|
---|
[16686] | 114 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
| 115 | <patternset>
|
---|
| 116 | <include name="packages/tomcat/**/*"/>
|
---|
| 117 | </patternset>
|
---|
| 118 | </unzip>
|
---|
[17123] | 119 | <echo>Changing tomcat ports tomcat's server.xml</echo>
|
---|
[15973] | 120 | <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
|
---|
| 121 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
|
---|
| 122 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
|
---|
| 123 |
|
---|
[17123] | 124 | <echo>Copying greenstone3.xml to tomcat directory</echo>
|
---|
[15973] | 125 | <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
|
---|
| 126 | <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="(.*)@gsdl3webhome@(.*)" replacement="$1${installDir}/web$2" />
|
---|
| 127 |
|
---|
[17123] | 128 | <echo>Setting tomcat binaries to executable</echo>
|
---|
[15973] | 129 | <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
|
---|
| 130 | <echo/>
|
---|
[15142] | 131 | </target>
|
---|
[15205] | 132 |
|
---|
| 133 | <target name="install-ant">
|
---|
[17123] | 134 | <echo>Installing Ant (packages/ant)</echo>
|
---|
[16686] | 135 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
| 136 | <patternset>
|
---|
| 137 | <include name="packages/ant/**/*"/>
|
---|
| 138 | </patternset>
|
---|
| 139 | </unzip>
|
---|
[17123] | 140 | <echo>Setting ant binaries to executable</echo>
|
---|
[15973] | 141 | <chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/>
|
---|
| 142 | <echo/>
|
---|
[15205] | 143 | </target>
|
---|
| 144 |
|
---|
[17123] | 145 | <target name="cleanuptarget"></target>
|
---|
[14982] | 146 |
|
---|
| 147 | </project>
|
---|