[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>
|
---|
[19503] | 38 |
|
---|
| 39 | <!-- web copies from compressed lzma files, cdrom copies from folders -->
|
---|
| 40 |
|
---|
| 41 | <!-- start web -->
|
---|
[17396] | 42 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
|
---|
| 43 | <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
|
---|
| 44 | <delete file="core.lzma"/>
|
---|
| 45 | <unzip src="${basedir}/core.comp" dest="${installDir}"/>
|
---|
| 46 | <delete file="core.comp"/>
|
---|
[19503] | 47 | <!-- end web -->
|
---|
[14982] | 48 |
|
---|
[19503] | 49 | <!-- start cdrom -->
|
---|
| 50 | <copy todir="${installDir}">
|
---|
| 51 | <fileset dir="${cd.dir}/Software/core/all"/>
|
---|
| 52 | <fileset dir="${cd.dir}/Software/core/linux"/>
|
---|
| 53 | </copy>
|
---|
| 54 | <!-- end cdrom -->
|
---|
| 55 |
|
---|
[17152] | 56 | <echo>Setting Binaries to Executable</echo>
|
---|
[15980] | 57 | <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
|
---|
[18876] | 58 | <chmod dir="${installDir}/bin/linux" includes="**/*" perm="775"/>
|
---|
[17470] | 59 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
[15980] | 60 | <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
|
---|
| 61 | <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
|
---|
[14982] | 62 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
[18666] | 63 | <chmod dir="${installDir}/apache-httpd/linux/bin" includes="*" perm="775"/>
|
---|
[18848] | 64 | <chmod dir="${installDir}/apache-httpd/linux" includes="*.sh" perm="775"/>
|
---|
[14982] | 65 | <echo/>
|
---|
| 66 |
|
---|
[17152] | 67 | <echo>Filling in concrete values in config files</echo>
|
---|
[18847] | 68 | <copy file="${installDir}/cgi-bin/gsdlsite.cfg.in" tofile="${installDir}/cgi-bin/gsdlsite.cfg"/>
|
---|
[18876] | 69 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
[18976] | 70 |
|
---|
| 71 | <echo>Correcting perl shebangs in perl scripts</echo>
|
---|
| 72 | <exec executable="which" outputproperty="perl.executable"><arg value="perl"/></exec>
|
---|
[18980] | 73 | <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
|
---|
[16832] | 74 | <echo/>
|
---|
| 75 |
|
---|
[18980] | 76 | <echo>Creating the english dictionary</echo>
|
---|
| 77 | <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
|
---|
| 78 | <echo/>
|
---|
| 79 |
|
---|
[19201] | 80 |
|
---|
[17152] | 81 | <echo>Set the installation locale in config files</echo>
|
---|
| 82 | <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
|
---|
| 83 | <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
| 84 | <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
| 85 |
|
---|
| 86 | <rsr
|
---|
| 87 | file="${installDir}/gli/classes/xml/config.xml"
|
---|
| 88 | pattern="(<Argument name="general.locale">).*(</Argument>)"
|
---|
| 89 | replacement="$1${language}$2"/>
|
---|
| 90 |
|
---|
| 91 | <echo file="${installDir}/etc/main.cfg" append="true"
|
---|
| 92 | >cgiarg shortname=l argdefault=${language}</echo>
|
---|
| 93 |
|
---|
[18840] | 94 | <echo>Setting up apache web server</echo>
|
---|
| 95 | <exec dir="${installDir}" executable="${installDir}/apache-httpd/linux/install-bindist.sh">
|
---|
| 96 | <arg value="${installDir}/apache-httpd/linux"/>
|
---|
| 97 | </exec>
|
---|
| 98 |
|
---|
[17257] | 99 | <echo>Creating installation properties file</echo>
|
---|
| 100 | <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
|
---|
| 101 |
|
---|
[15142] | 102 | <echo message="Finished"/>
|
---|
| 103 |
|
---|
[14982] | 104 | </target>
|
---|
| 105 |
|
---|
[17786] | 106 | <!-- imagemagick -->
|
---|
| 107 | <target name="Installing ImageMagick">
|
---|
| 108 | <echo>Installing ImageMagick</echo>
|
---|
| 109 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
|
---|
| 110 | <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
|
---|
| 111 | <delete file="imagemagick.lzma"/>
|
---|
| 112 | <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/linux"/>
|
---|
| 113 | <delete file="imagemagick.comp"/>
|
---|
| 114 |
|
---|
| 115 | <echo>Setting ImageMagick Binaries to Executable</echo>
|
---|
| 116 | <chmod dir="${installDir}/bin/linux/imagemagick/bin" includes="*" perm="775"/>
|
---|
| 117 |
|
---|
| 118 | </target>
|
---|
[17650] | 119 |
|
---|
[17786] | 120 | <!-- source release -->
|
---|
| 121 | <target name="Source Release">
|
---|
[17650] | 122 |
|
---|
[17786] | 123 | <echo>Installing Source Release</echo>
|
---|
| 124 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="source-release.lzma"/></patternset></unzip>
|
---|
| 125 | <sevenzip task="decode" input="${basedir}/source-release.lzma" output="${basedir}/source-release.comp"/>
|
---|
| 126 | <delete file="source-release.lzma"/>
|
---|
| 127 | <unzip src="${basedir}/source-release.comp" dest="${installDir}"/>
|
---|
| 128 | <delete file="source-release.comp"/>
|
---|
| 129 |
|
---|
[17812] | 130 | <echo>Setting Binaries to Executable</echo>
|
---|
| 131 | <chmod dir="${installDir}" includes="*.sh,*.bash,**/configure" perm="775"/>
|
---|
| 132 | <chmod dir="${installDir}/bin/linux" includes="*" perm="775"/>
|
---|
| 133 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
| 134 | <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
|
---|
| 135 | <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
|
---|
| 136 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
| 137 | <echo/>
|
---|
| 138 |
|
---|
[17830] | 139 | <echo>Filling in concrete values in config files</echo>
|
---|
| 140 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
|
---|
| 141 | <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
| 142 | <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
|
---|
| 143 | <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
|
---|
| 144 | </rsr>
|
---|
| 145 | <echo/>
|
---|
| 146 |
|
---|
[17650] | 147 | <echo>Set the installation locale in config files</echo>
|
---|
| 148 | <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
|
---|
| 149 | <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
| 150 | <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
| 151 |
|
---|
| 152 | <rsr
|
---|
| 153 | file="${installDir}/gli/classes/xml/config.xml"
|
---|
| 154 | pattern="(<Argument name="general.locale">).*(</Argument>)"
|
---|
| 155 | replacement="$1${language}$2"/>
|
---|
| 156 |
|
---|
| 157 | <echo file="${installDir}/etc/main.cfg" append="true"
|
---|
| 158 | >cgiarg shortname=l argdefault=${language}</echo>
|
---|
| 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 |
|
---|
[19201] | 168 | <target name="Configuring Administration Pages" if="enable.admin.pages">
|
---|
| 169 | <echo>Enabling Admin Pages</echo>
|
---|
| 170 | <rsr file="${installDir}/etc/main.cfg" pattern="^\s*status\s+.*" replacement="status enabled"/>
|
---|
| 171 | <echo>Creating admin and demo users</echo>
|
---|
| 172 | <adduser txt2db="${installDir}/bin/linux/txt2db"
|
---|
| 173 | usersDb="${installDir}/etc/users.gdb"
|
---|
| 174 | username="admin"
|
---|
| 175 | password="${admin.password}"
|
---|
[19256] | 176 | groups="administrator,colbuilder,all-collections-editor"
|
---|
[19201] | 177 | comment="created at install time"/>
|
---|
| 178 | <adduser
|
---|
| 179 | txt2db="${installDir}/bin/linux/txt2db"
|
---|
| 180 | usersDb="${installDir}/etc/users.gdb"
|
---|
| 181 | username="demo"
|
---|
| 182 | password="demo"
|
---|
| 183 | groups="demo"
|
---|
| 184 | comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
|
---|
| 185 | </target>
|
---|
| 186 |
|
---|
[14982] | 187 | </project>
|
---|