[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">
|
---|
[19610] | 21 | <or>
|
---|
| 22 | <available file="../@linux-java.extracted@/bin/java"/>
|
---|
| 23 | <available file="${orig.dir}/Java/Linux/jre"/>
|
---|
| 24 | </or>
|
---|
[15142] | 25 | </condition>
|
---|
| 26 |
|
---|
[17765] | 27 | <target name="Initialising" if="bundled.java.exists">
|
---|
[19601] | 28 | <mkdir dir="${installDir}/packages"/>
|
---|
| 29 | <!-- start web -->
|
---|
[17754] | 30 | <copy todir="${installDir}/packages/jre" failonerror="false">
|
---|
| 31 | <fileset dir="../@linux-java.extracted@"/>
|
---|
| 32 | </copy>
|
---|
[19601] | 33 | <!-- end web -->
|
---|
| 34 |
|
---|
| 35 | <!-- start cdrom -->
|
---|
| 36 | <copy todir="${installDir}/packages/jre" failonerror="false">
|
---|
| 37 | <fileset dir="${orig.dir}/Java/Linux/jre"/>
|
---|
| 38 | </copy>
|
---|
| 39 | <!-- end cdrom -->
|
---|
[19610] | 40 |
|
---|
[17754] | 41 | <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
|
---|
| 42 | </target>
|
---|
[15142] | 43 |
|
---|
[17576] | 44 | <!-- core system -->
|
---|
[17764] | 45 | <target name="Installing Core System">
|
---|
[14982] | 46 |
|
---|
| 47 | <mkdir dir="${installDir}"/>
|
---|
| 48 |
|
---|
[17152] | 49 | <echo>Installing Core Files</echo>
|
---|
[19503] | 50 |
|
---|
| 51 | <!-- web copies from compressed lzma files, cdrom copies from folders -->
|
---|
| 52 |
|
---|
| 53 | <!-- start web -->
|
---|
[17396] | 54 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
|
---|
| 55 | <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
|
---|
| 56 | <delete file="core.lzma"/>
|
---|
| 57 | <unzip src="${basedir}/core.comp" dest="${installDir}"/>
|
---|
| 58 | <delete file="core.comp"/>
|
---|
[19503] | 59 | <!-- end web -->
|
---|
[14982] | 60 |
|
---|
[19503] | 61 | <!-- start cdrom -->
|
---|
| 62 | <copy todir="${installDir}">
|
---|
[19510] | 63 | <fileset dir="${orig.dir}/Software/core/all"/>
|
---|
| 64 | <fileset dir="${orig.dir}/Software/core/linux"/>
|
---|
[19503] | 65 | </copy>
|
---|
| 66 | <!-- end cdrom -->
|
---|
| 67 |
|
---|
[17152] | 68 | <echo>Setting Binaries to Executable</echo>
|
---|
[15980] | 69 | <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
|
---|
[18876] | 70 | <chmod dir="${installDir}/bin/linux" includes="**/*" perm="775"/>
|
---|
[17470] | 71 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
[15980] | 72 | <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
|
---|
| 73 | <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
|
---|
[14982] | 74 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
[18666] | 75 | <chmod dir="${installDir}/apache-httpd/linux/bin" includes="*" perm="775"/>
|
---|
[18848] | 76 | <chmod dir="${installDir}/apache-httpd/linux" includes="*.sh" perm="775"/>
|
---|
[14982] | 77 | <echo/>
|
---|
| 78 |
|
---|
[17152] | 79 | <echo>Filling in concrete values in config files</echo>
|
---|
[18847] | 80 | <copy file="${installDir}/cgi-bin/gsdlsite.cfg.in" tofile="${installDir}/cgi-bin/gsdlsite.cfg"/>
|
---|
[18876] | 81 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
[18976] | 82 |
|
---|
| 83 | <echo>Correcting perl shebangs in perl scripts</echo>
|
---|
| 84 | <exec executable="which" outputproperty="perl.executable"><arg value="perl"/></exec>
|
---|
[18980] | 85 | <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
|
---|
[16832] | 86 | <echo/>
|
---|
| 87 |
|
---|
[18980] | 88 | <echo>Creating the english dictionary</echo>
|
---|
| 89 | <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
|
---|
| 90 | <echo/>
|
---|
| 91 |
|
---|
[19201] | 92 |
|
---|
[17152] | 93 | <echo>Set the installation locale in config files</echo>
|
---|
| 94 | <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
|
---|
| 95 | <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
| 96 | <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
| 97 |
|
---|
| 98 | <rsr
|
---|
| 99 | file="${installDir}/gli/classes/xml/config.xml"
|
---|
| 100 | pattern="(<Argument name="general.locale">).*(</Argument>)"
|
---|
| 101 | replacement="$1${language}$2"/>
|
---|
| 102 |
|
---|
| 103 | <echo file="${installDir}/etc/main.cfg" append="true"
|
---|
| 104 | >cgiarg shortname=l argdefault=${language}</echo>
|
---|
| 105 |
|
---|
[18840] | 106 | <echo>Setting up apache web server</echo>
|
---|
| 107 | <exec dir="${installDir}" executable="${installDir}/apache-httpd/linux/install-bindist.sh">
|
---|
| 108 | <arg value="${installDir}/apache-httpd/linux"/>
|
---|
| 109 | </exec>
|
---|
| 110 |
|
---|
[17257] | 111 | <echo>Creating installation properties file</echo>
|
---|
| 112 | <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
|
---|
| 113 |
|
---|
[15142] | 114 | <echo message="Finished"/>
|
---|
| 115 |
|
---|
[14982] | 116 | </target>
|
---|
| 117 |
|
---|
[17786] | 118 | <!-- imagemagick -->
|
---|
| 119 | <target name="Installing ImageMagick">
|
---|
| 120 | <echo>Installing ImageMagick</echo>
|
---|
[19510] | 121 | <!-- start web -->
|
---|
[17786] | 122 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
|
---|
| 123 | <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
|
---|
| 124 | <delete file="imagemagick.lzma"/>
|
---|
| 125 | <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/linux"/>
|
---|
| 126 | <delete file="imagemagick.comp"/>
|
---|
[19510] | 127 | <!-- end web -->
|
---|
| 128 |
|
---|
| 129 | <!-- start cdrom -->
|
---|
| 130 | <copy todir="${installDir}/bin/linux">
|
---|
| 131 | <fileset dir="${orig.dir}/Software/imagemagick/linux"/>
|
---|
| 132 | </copy>
|
---|
| 133 | <!-- end cdrom -->
|
---|
| 134 |
|
---|
[17786] | 135 | <echo>Setting ImageMagick Binaries to Executable</echo>
|
---|
| 136 | <chmod dir="${installDir}/bin/linux/imagemagick/bin" includes="*" perm="775"/>
|
---|
| 137 |
|
---|
| 138 | </target>
|
---|
[17650] | 139 |
|
---|
[19201] | 140 | <target name="Configuring Administration Pages" if="enable.admin.pages">
|
---|
| 141 | <echo>Enabling Admin Pages</echo>
|
---|
| 142 | <rsr file="${installDir}/etc/main.cfg" pattern="^\s*status\s+.*" replacement="status enabled"/>
|
---|
| 143 | <echo>Creating admin and demo users</echo>
|
---|
| 144 | <adduser txt2db="${installDir}/bin/linux/txt2db"
|
---|
| 145 | usersDb="${installDir}/etc/users.gdb"
|
---|
| 146 | username="admin"
|
---|
| 147 | password="${admin.password}"
|
---|
[19256] | 148 | groups="administrator,colbuilder,all-collections-editor"
|
---|
[19201] | 149 | comment="created at install time"/>
|
---|
| 150 | <adduser
|
---|
| 151 | txt2db="${installDir}/bin/linux/txt2db"
|
---|
| 152 | usersDb="${installDir}/etc/users.gdb"
|
---|
| 153 | username="demo"
|
---|
| 154 | password="demo"
|
---|
| 155 | groups="demo"
|
---|
| 156 | comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
|
---|
| 157 | </target>
|
---|
| 158 |
|
---|
[19624] | 159 | <target name="Installing Documented Examples">
|
---|
| 160 | <copy todir="${installDir}/collect">
|
---|
| 161 | <fileset dir="${orig.dir}/Documented Examples" includes="documented-examples/**/*"/>
|
---|
| 162 | </copy>
|
---|
| 163 | </target>
|
---|
| 164 |
|
---|
| 165 |
|
---|
[14982] | 166 | </project>
|
---|