[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"/>
|
---|
| 17 | <typedef name="adduser" classname="org.greenstone.anttasks.AddGreenstoneUserToDatabase" classpathref="project.classpath"/>
|
---|
[17396] | 18 | <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
|
---|
[14982] | 19 |
|
---|
[15142] | 20 | <condition property="bundled.java.exists">
|
---|
[17396] | 21 | <available file="../@linux-java.extracted@/bin/java"/>
|
---|
[15142] | 22 | </condition>
|
---|
| 23 |
|
---|
[17765] | 24 | <target name="Initialising" if="bundled.java.exists">
|
---|
[17754] | 25 | <mkdir dir="${installDir}"/>
|
---|
| 26 | <copy todir="${installDir}/packages/jre" failonerror="false">
|
---|
| 27 | <fileset dir="../@linux-java.extracted@"/>
|
---|
| 28 | </copy>
|
---|
| 29 | <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
|
---|
| 30 | </target>
|
---|
[15142] | 31 |
|
---|
[17576] | 32 | <!-- core system -->
|
---|
[17764] | 33 | <target name="Installing Core System">
|
---|
[14982] | 34 |
|
---|
| 35 | <mkdir dir="${installDir}"/>
|
---|
| 36 |
|
---|
[17152] | 37 | <echo>Installing Core Files</echo>
|
---|
[17396] | 38 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
|
---|
| 39 | <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
|
---|
| 40 | <delete file="core.lzma"/>
|
---|
| 41 | <unzip src="${basedir}/core.comp" dest="${installDir}"/>
|
---|
| 42 | <delete file="core.comp"/>
|
---|
[14982] | 43 |
|
---|
[17437] | 44 | <echo message="Installing Servers"/>
|
---|
[18703] | 45 | <copy tofile="${installDir}/cgi-bin/oaiserver.cgi" file="${installDir}/bin/linux/oaiserver.cgi"/>
|
---|
| 46 | <copy tofile="${installDir}/cgi-bin/library.cgi" file="${installDir}/bin/linux/library.cgi"/>
|
---|
[17437] | 47 |
|
---|
[17152] | 48 | <echo>Setting Binaries to Executable</echo>
|
---|
[15980] | 49 | <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
|
---|
| 50 | <chmod dir="${installDir}/bin/linux" includes="*" perm="775"/>
|
---|
[18513] | 51 | <chmod dir="${installDir}/bin/linux/wv/bin" includes="*" perm="775"/>
|
---|
[17470] | 52 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
[15980] | 53 | <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
|
---|
| 54 | <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
|
---|
[14982] | 55 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
[18666] | 56 | <chmod dir="${installDir}/apache-httpd/linux/bin" includes="*" perm="775"/>
|
---|
[14982] | 57 | <echo/>
|
---|
| 58 |
|
---|
[17152] | 59 | <echo>Filling in concrete values in config files</echo>
|
---|
[17830] | 60 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
|
---|
| 61 | <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
| 62 | <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
|
---|
| 63 | <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
|
---|
| 64 | </rsr>
|
---|
[16832] | 65 | <echo/>
|
---|
| 66 |
|
---|
[17152] | 67 | <echo>Creating admin and demo users</echo>
|
---|
[17107] | 68 | <adduser txt2db="${installDir}/bin/linux/txt2db"
|
---|
| 69 | usersDb="${installDir}/etc/users.db"
|
---|
| 70 | username="admin"
|
---|
| 71 | password="${admin.password}"
|
---|
| 72 | groups="administrator,colbuilder"
|
---|
| 73 | comment="created at install time"/>
|
---|
| 74 | <adduser
|
---|
| 75 | txt2db="${installDir}/bin/linux/txt2db"
|
---|
| 76 | usersDb="${installDir}/etc/users.db"
|
---|
| 77 | username="demo"
|
---|
| 78 | password="demo"
|
---|
| 79 | groups="demo"
|
---|
| 80 | comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
|
---|
| 81 |
|
---|
[17152] | 82 | <echo>Set the installation locale in config files</echo>
|
---|
| 83 | <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
|
---|
| 84 | <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
| 85 | <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
| 86 |
|
---|
| 87 | <rsr
|
---|
| 88 | file="${installDir}/gli/classes/xml/config.xml"
|
---|
| 89 | pattern="(<Argument name="general.locale">).*(</Argument>)"
|
---|
| 90 | replacement="$1${language}$2"/>
|
---|
| 91 |
|
---|
| 92 | <echo file="${installDir}/etc/main.cfg" append="true"
|
---|
| 93 | >cgiarg shortname=l argdefault=${language}</echo>
|
---|
| 94 |
|
---|
| 95 | <rsr file="${installDir}/etc/main.cfg" pattern="^status .*" replacement="status enabled"/>
|
---|
| 96 |
|
---|
[17257] | 97 | <echo>Creating installation properties file</echo>
|
---|
| 98 | <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
|
---|
| 99 |
|
---|
[15142] | 100 | <echo message="Finished"/>
|
---|
| 101 |
|
---|
[14982] | 102 | </target>
|
---|
| 103 |
|
---|
[17786] | 104 | <!-- imagemagick -->
|
---|
| 105 | <target name="Installing ImageMagick">
|
---|
| 106 | <echo>Installing ImageMagick</echo>
|
---|
| 107 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
|
---|
| 108 | <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
|
---|
| 109 | <delete file="imagemagick.lzma"/>
|
---|
| 110 | <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/linux"/>
|
---|
| 111 | <delete file="imagemagick.comp"/>
|
---|
| 112 |
|
---|
| 113 | <echo>Setting ImageMagick Binaries to Executable</echo>
|
---|
| 114 | <chmod dir="${installDir}/bin/linux/imagemagick/bin" includes="*" perm="775"/>
|
---|
| 115 |
|
---|
| 116 | </target>
|
---|
[17650] | 117 |
|
---|
[17786] | 118 | <!-- source release -->
|
---|
| 119 | <target name="Source Release">
|
---|
[17650] | 120 |
|
---|
[17786] | 121 | <echo>Installing Source Release</echo>
|
---|
| 122 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="source-release.lzma"/></patternset></unzip>
|
---|
| 123 | <sevenzip task="decode" input="${basedir}/source-release.lzma" output="${basedir}/source-release.comp"/>
|
---|
| 124 | <delete file="source-release.lzma"/>
|
---|
| 125 | <unzip src="${basedir}/source-release.comp" dest="${installDir}"/>
|
---|
| 126 | <delete file="source-release.comp"/>
|
---|
| 127 |
|
---|
[17812] | 128 | <echo>Setting Binaries to Executable</echo>
|
---|
| 129 | <chmod dir="${installDir}" includes="*.sh,*.bash,**/configure" perm="775"/>
|
---|
| 130 | <chmod dir="${installDir}/bin/linux" includes="*" perm="775"/>
|
---|
| 131 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
| 132 | <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
|
---|
| 133 | <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
|
---|
| 134 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
| 135 | <echo/>
|
---|
| 136 |
|
---|
[17830] | 137 | <echo>Filling in concrete values in config files</echo>
|
---|
| 138 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
|
---|
| 139 | <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
| 140 | <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
|
---|
| 141 | <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
|
---|
| 142 | </rsr>
|
---|
| 143 | <echo/>
|
---|
| 144 |
|
---|
[17650] | 145 | <echo>Set the installation locale in config files</echo>
|
---|
| 146 | <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
|
---|
| 147 | <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
| 148 | <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
| 149 |
|
---|
| 150 | <rsr
|
---|
| 151 | file="${installDir}/gli/classes/xml/config.xml"
|
---|
| 152 | pattern="(<Argument name="general.locale">).*(</Argument>)"
|
---|
| 153 | replacement="$1${language}$2"/>
|
---|
| 154 |
|
---|
| 155 | <echo file="${installDir}/etc/main.cfg" append="true"
|
---|
| 156 | >cgiarg shortname=l argdefault=${language}</echo>
|
---|
| 157 |
|
---|
| 158 | <rsr file="${installDir}/etc/main.cfg" pattern="^status .*" replacement="status enabled"/>
|
---|
| 159 |
|
---|
[17812] | 160 | <echo>Create usage.txt</echo>
|
---|
| 161 | <echo file="${installDir}/etc/usage.txt"></echo>
|
---|
| 162 |
|
---|
[17650] | 163 | <echo>Creating installation properties file</echo>
|
---|
| 164 | <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
|
---|
| 165 |
|
---|
| 166 | </target>
|
---|
| 167 |
|
---|
[14982] | 168 | </project>
|
---|