[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 |
|
---|
[17437] | 37 | <echo message="Installing Servers"/>
|
---|
| 38 | <copy tofile="${installDir}/cgi-bin/oaiserver" file="${installDir}/bin/darwin/oaiserver"/>
|
---|
| 39 | <copy tofile="${installDir}/cgi-bin/library" file="${installDir}/bin/darwin/library"/>
|
---|
| 40 |
|
---|
[14982] | 41 | <echo message="Setting Binaries to Executable"/>
|
---|
[15980] | 42 | <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
|
---|
[16469] | 43 | <chmod dir="${installDir}/bin/darwin" includes="*" perm="775"/>
|
---|
[17470] | 44 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
[15980] | 45 | <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
|
---|
| 46 | <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
|
---|
[14982] | 47 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
| 48 | <echo/>
|
---|
| 49 |
|
---|
[16469] | 50 | <echo message="Filling in concrete values in config files"/>
|
---|
| 51 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
[17076] | 52 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
|
---|
| 53 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
|
---|
[16469] | 54 | <echo/>
|
---|
| 55 |
|
---|
[17107] | 56 | <echo message="Creating admin and demo users"/>
|
---|
[17611] | 57 | <adduser txt2db="${installDir}/bin/darwin/txt2db"
|
---|
[17107] | 58 | usersDb="${installDir}/etc/users.db"
|
---|
| 59 | username="admin"
|
---|
| 60 | password="${admin.password}"
|
---|
| 61 | groups="administrator,colbuilder"
|
---|
| 62 | comment="created at install time"/>
|
---|
| 63 | <adduser
|
---|
[17611] | 64 | txt2db="${installDir}/bin/darwin/txt2db"
|
---|
[17107] | 65 | usersDb="${installDir}/etc/users.db"
|
---|
| 66 | username="demo"
|
---|
| 67 | password="demo"
|
---|
| 68 | groups="demo"
|
---|
| 69 | comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
|
---|
| 70 |
|
---|
[14982] | 71 | <!-- delete unneeded files -->
|
---|
[16832] | 72 | <echo message="Deleting some unneeded files"/>
|
---|
[14982] | 73 | <delete dir="${installDir}/resources/icons"/>
|
---|
| 74 | <delete file="${installDir}/resources/*.png"/>
|
---|
| 75 |
|
---|
[17257] | 76 | <echo>Creating installation properties file</echo>
|
---|
| 77 | <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
|
---|
| 78 |
|
---|
[15142] | 79 | <echo message="Finished"/>
|
---|
| 80 |
|
---|
[14982] | 81 | </target>
|
---|
| 82 |
|
---|
[17652] | 83 | <!-- sourcecode core system -->
|
---|
| 84 | <target name="Installing Source Code Core">
|
---|
| 85 |
|
---|
| 86 | <echo>Installing Source Code Core</echo>
|
---|
| 87 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode-core.lzma"/></patternset></unzip>
|
---|
| 88 | <sevenzip task="decode" input="${basedir}/sourcecode-core.lzma" output="${basedir}/sourcecode-core.comp"/>
|
---|
| 89 | <delete file="sourcecode-core.lzma"/>
|
---|
| 90 | <unzip src="${basedir}/sourcecode-core.comp" dest="${installDir}"/>
|
---|
| 91 | <delete file="sourcecode-core.comp"/>
|
---|
| 92 |
|
---|
| 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 |
|
---|
| 106 | <rsr file="${installDir}/etc/main.cfg" pattern="^status .*" replacement="status enabled"/>
|
---|
| 107 |
|
---|
| 108 | <echo>Creating installation properties file</echo>
|
---|
| 109 | <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
|
---|
| 110 |
|
---|
| 111 | </target>
|
---|
| 112 |
|
---|
[14982] | 113 | <!-- Source -->
|
---|
[17576] | 114 | <target name="Installing Source Code" depends="">
|
---|
[16818] | 115 | <echo message="Installing Source Code"/>
|
---|
[17608] | 116 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
|
---|
| 117 | <sevenzip task="decode" input="${basedir}/sourcecode.lzma" output="${basedir}/sourcecode.comp"/>
|
---|
| 118 | <delete file="sourcecode.lzma"/>
|
---|
| 119 | <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
|
---|
| 120 | <delete file="sourcecode.comp"/>
|
---|
[17710] | 121 | </target>
|
---|
[17608] | 122 |
|
---|
[17710] | 123 | <!-- ImageMagick -->
|
---|
| 124 | <target name="Installing ImageMagick" depends="">
|
---|
| 125 | <echo message="Installing ImageMagick"/>
|
---|
| 126 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
|
---|
| 127 | <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
|
---|
| 128 | <delete file="imagemagick.lzma"/>
|
---|
| 129 | <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/darwin" />
|
---|
| 130 | <delete file="imagemagick.comp"/>
|
---|
[17716] | 131 | <chmod dir="${installDir}/bin/darwin/imagemagick/bin" includes="*" perm="775"/>
|
---|
[14982] | 132 | </target>
|
---|
| 133 |
|
---|
[17710] | 134 | <!-- Ghostscript -->
|
---|
| 135 | <target name="Installing Ghostscript" depends="">
|
---|
| 136 | <echo message="Installing Ghostscript"/>
|
---|
| 137 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
|
---|
| 138 | <sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/>
|
---|
| 139 | <delete file="ghostscript.lzma"/>
|
---|
| 140 | <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/darwin" />
|
---|
| 141 | <delete file="ghostscript.comp"/>
|
---|
[17716] | 142 | <chmod dir="${installDir}/bin/darwin/ghostscript/bin" includes="*" perm="775"/>
|
---|
[17710] | 143 | </target>
|
---|
| 144 |
|
---|
| 145 |
|
---|
| 146 |
|
---|
[14982] | 147 | </project>
|
---|