[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 |
|
---|
| 24 |
|
---|
[17576] | 25 | <!-- core system -->
|
---|
| 26 | <target name="Installing Core System">
|
---|
[14982] | 27 |
|
---|
| 28 | <echo>basedir: ${basedir}</echo>
|
---|
| 29 | <echo>installDir: ${installDir}</echo>
|
---|
| 30 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
[15980] | 31 |
|
---|
[17152] | 32 | <echo>Creating Installation directory</echo>
|
---|
[14982] | 33 | <mkdir dir="${installDir}"/>
|
---|
| 34 |
|
---|
[17152] | 35 | <echo>Installing Core Files</echo>
|
---|
[17396] | 36 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
|
---|
| 37 | <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
|
---|
| 38 | <delete file="core.lzma"/>
|
---|
| 39 | <unzip src="${basedir}/core.comp" dest="${installDir}"/>
|
---|
| 40 | <delete file="core.comp"/>
|
---|
[14982] | 41 |
|
---|
[17437] | 42 | <echo message="Installing Servers"/>
|
---|
| 43 | <copy tofile="${installDir}/cgi-bin/oaiserver" file="${installDir}/bin/linux/oaiserver"/>
|
---|
| 44 | <copy tofile="${installDir}/cgi-bin/library" file="${installDir}/bin/linux/library"/>
|
---|
| 45 |
|
---|
[17444] | 46 | <!-- jre -->
|
---|
[17641] | 47 | <copy todir="${installDir}/packages/jre" failonerror="false">
|
---|
[17444] | 48 | <fileset dir="../@linux-java.extracted@"/>
|
---|
[17470] | 49 | </copy>
|
---|
[17444] | 50 | <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
|
---|
[17437] | 51 |
|
---|
[17152] | 52 | <echo>Setting Binaries to Executable</echo>
|
---|
[15980] | 53 | <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
|
---|
| 54 | <chmod dir="${installDir}/bin/linux" includes="*" perm="775"/>
|
---|
[17470] | 55 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
[15980] | 56 | <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
|
---|
| 57 | <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
|
---|
[14982] | 58 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
| 59 | <echo/>
|
---|
| 60 |
|
---|
[17152] | 61 | <echo>Filling in concrete values in config files</echo>
|
---|
[16832] | 62 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
[17075] | 63 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
|
---|
| 64 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
|
---|
[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 |
|
---|
| 97 | <echo>Deleting some unneeded files</echo>
|
---|
[14982] | 98 | <delete dir="${installDir}/resources/icons"/>
|
---|
| 99 | <delete file="${installDir}/resources/*.png"/>
|
---|
| 100 |
|
---|
[17257] | 101 | <echo>Creating installation properties file</echo>
|
---|
| 102 | <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
|
---|
| 103 |
|
---|
[15142] | 104 | <echo message="Finished"/>
|
---|
| 105 |
|
---|
[14982] | 106 | </target>
|
---|
| 107 |
|
---|
[17576] | 108 | <!-- source code -->
|
---|
| 109 | <target name="Installing Source Code">
|
---|
[17152] | 110 | <echo>Installing Source Code</echo>
|
---|
[17396] | 111 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
|
---|
| 112 | <sevenzip task="decode" input="${basedir}/sourcecode.lzma" output="${basedir}/sourcecode.comp"/>
|
---|
| 113 | <delete file="sourcecode.lzma"/>
|
---|
| 114 | <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
|
---|
| 115 | <delete file="sourcecode.comp"/>
|
---|
[14982] | 116 | </target>
|
---|
| 117 |
|
---|
[17646] | 118 | <!-- imagemagick -->
|
---|
| 119 | <target name="Installing ImageMagick">
|
---|
| 120 | <echo>Installing ImageMagick</echo>
|
---|
| 121 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
|
---|
| 122 | <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
|
---|
| 123 | <delete file="imagemagick.lzma"/>
|
---|
| 124 | <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/linux"/>
|
---|
| 125 | <delete file="imagemagick.comp"/>
|
---|
| 126 | </target>
|
---|
| 127 |
|
---|
[14982] | 128 | </project>
|
---|