[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"/>
|
---|
[17468] | 18 | <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
|
---|
[14982] | 19 |
|
---|
[17576] | 20 | <target name="Installing Core System" depends="">
|
---|
[14982] | 21 |
|
---|
| 22 | <echo>basedir: ${basedir}</echo>
|
---|
| 23 | <echo>installDir: ${installDir}</echo>
|
---|
| 24 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
[15980] | 25 |
|
---|
| 26 | <!-- create the installation directory -->
|
---|
| 27 | <echo message="Creating Installation directory"/>
|
---|
[14982] | 28 | <mkdir dir="${installDir}"/>
|
---|
| 29 |
|
---|
[17608] | 30 | <echo>Installing Core Files</echo>
|
---|
| 31 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
|
---|
| 32 | <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
|
---|
| 33 | <delete file="core.lzma"/>
|
---|
| 34 | <unzip src="${basedir}/core.comp" dest="${installDir}"/>
|
---|
| 35 | <delete file="core.comp"/>
|
---|
[14982] | 36 |
|
---|
| 37 | <echo message="Setting Binaries to Executable"/>
|
---|
[15980] | 38 | <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
|
---|
[16469] | 39 | <chmod dir="${installDir}/bin/darwin" includes="*" perm="775"/>
|
---|
[17470] | 40 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
[15980] | 41 | <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
|
---|
| 42 | <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
|
---|
[14982] | 43 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
[18666] | 44 | <chmod dir="${installDir}/apache-httpd/darwin/bin" includes="*" perm="775"/>
|
---|
[18854] | 45 | <chmod dir="${installDir}/apache-httpd/darwin" includes="*.sh" perm="775"/>
|
---|
[14982] | 46 | <echo/>
|
---|
| 47 |
|
---|
[16469] | 48 | <echo message="Filling in concrete values in config files"/>
|
---|
[18847] | 49 | <copy file="${installDir}/cgi-bin/gsdlsite.cfg.in" tofile="${installDir}/cgi-bin/gsdlsite.cfg"/>
|
---|
[16469] | 50 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
| 51 | <echo/>
|
---|
| 52 |
|
---|
[18977] | 53 | <echo>Correcting perl shebangs in perl scripts</echo>
|
---|
| 54 | <exec executable="which" outputproperty="perl.executable"><arg value="perl"/></exec>
|
---|
[18980] | 55 | <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
|
---|
[18977] | 56 | <echo/>
|
---|
| 57 |
|
---|
[14982] | 58 | <!-- delete unneeded files -->
|
---|
[16832] | 59 | <echo message="Deleting some unneeded files"/>
|
---|
[14982] | 60 | <delete dir="${installDir}/resources/icons"/>
|
---|
| 61 | <delete file="${installDir}/resources/*.png"/>
|
---|
| 62 |
|
---|
[18854] | 63 | <echo>Setting up apache web server</echo>
|
---|
| 64 | <exec dir="${installDir}" executable="${installDir}/apache-httpd/darwin/install-bindist.sh">
|
---|
| 65 | <arg value="${installDir}/apache-httpd/darwin"/>
|
---|
| 66 | </exec>
|
---|
| 67 |
|
---|
[18980] | 68 | <echo>Creating the english dictionary</echo>
|
---|
| 69 | <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
|
---|
| 70 | <echo/>
|
---|
| 71 |
|
---|
[17257] | 72 | <echo>Creating installation properties file</echo>
|
---|
| 73 | <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
|
---|
| 74 |
|
---|
[15142] | 75 | <echo message="Finished"/>
|
---|
| 76 |
|
---|
[14982] | 77 | </target>
|
---|
| 78 |
|
---|
[17710] | 79 | <!-- ImageMagick -->
|
---|
| 80 | <target name="Installing ImageMagick" depends="">
|
---|
| 81 | <echo message="Installing ImageMagick"/>
|
---|
| 82 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
|
---|
| 83 | <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
|
---|
| 84 | <delete file="imagemagick.lzma"/>
|
---|
| 85 | <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/darwin" />
|
---|
| 86 | <delete file="imagemagick.comp"/>
|
---|
[17716] | 87 | <chmod dir="${installDir}/bin/darwin/imagemagick/bin" includes="*" perm="775"/>
|
---|
[14982] | 88 | </target>
|
---|
| 89 |
|
---|
[17710] | 90 | <!-- Ghostscript -->
|
---|
| 91 | <target name="Installing Ghostscript" depends="">
|
---|
| 92 | <echo message="Installing Ghostscript"/>
|
---|
| 93 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
|
---|
| 94 | <sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/>
|
---|
| 95 | <delete file="ghostscript.lzma"/>
|
---|
| 96 | <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/darwin" />
|
---|
| 97 | <delete file="ghostscript.comp"/>
|
---|
[17716] | 98 | <chmod dir="${installDir}/bin/darwin/ghostscript/bin" includes="*" perm="775"/>
|
---|
[17710] | 99 | </target>
|
---|
| 100 |
|
---|
| 101 |
|
---|
[17815] | 102 | <target name="Source Release" depends="">
|
---|
[17710] | 103 |
|
---|
[17815] | 104 | <!-- create the installation directory -->
|
---|
| 105 | <echo message="Creating Installation directory"/>
|
---|
| 106 | <mkdir dir="${installDir}"/>
|
---|
| 107 |
|
---|
| 108 | <echo>Installing Source Release</echo>
|
---|
| 109 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="source-release.lzma"/></patternset></unzip>
|
---|
| 110 | <sevenzip task="decode" input="${basedir}/source-release.lzma" output="${basedir}/source-release.comp"/>
|
---|
| 111 | <delete file="source-release.lzma"/>
|
---|
| 112 | <unzip src="${basedir}/source-release.comp" dest="${installDir}"/>
|
---|
| 113 | <delete file="source-release.comp"/>
|
---|
| 114 |
|
---|
| 115 | <echo message="Setting Binaries to Executable"/>
|
---|
| 116 | <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
|
---|
| 117 | <chmod dir="${installDir}/bin/darwin" includes="*" perm="775"/>
|
---|
| 118 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
| 119 | <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
|
---|
| 120 | <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
|
---|
| 121 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
| 122 | <echo/>
|
---|
| 123 |
|
---|
| 124 | <echo message="Filling in concrete values in config files"/>
|
---|
| 125 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
| 126 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
|
---|
| 127 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
|
---|
| 128 | <echo/>
|
---|
| 129 |
|
---|
| 130 | <echo>Create usage.txt</echo>
|
---|
| 131 | <echo file="${installDir}/etc/usage.txt"></echo>
|
---|
| 132 |
|
---|
| 133 | <echo>Creating installation properties file</echo>
|
---|
| 134 | <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
|
---|
| 135 |
|
---|
| 136 | <echo message="Finished"/>
|
---|
| 137 |
|
---|
| 138 | </target>
|
---|
| 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 message="Creating admin and demo users"/>
|
---|
| 144 | <adduser txt2db="${installDir}/bin/darwin/txt2db"
|
---|
| 145 | usersDb="${installDir}/etc/users.gdb"
|
---|
| 146 | username="admin"
|
---|
| 147 | password="${admin.password}"
|
---|
| 148 | groups="administrator,colbuilder"
|
---|
| 149 | comment="created at install time"/>
|
---|
| 150 | <adduser
|
---|
| 151 | txt2db="${installDir}/bin/darwin/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>
|
---|
[17815] | 158 |
|
---|
| 159 |
|
---|
[14982] | 160 | </project>
|
---|