[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 |
|
---|
[15205] | 25 | <target name="install-core-components" depends="">
|
---|
[14982] | 26 |
|
---|
| 27 | <echo>basedir: ${basedir}</echo>
|
---|
| 28 | <echo>installDir: ${installDir}</echo>
|
---|
| 29 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
[15980] | 30 |
|
---|
[17152] | 31 | <echo>Creating Installation directory</echo>
|
---|
[14982] | 32 | <mkdir dir="${installDir}"/>
|
---|
| 33 |
|
---|
[17152] | 34 | <echo>Installing Core Files</echo>
|
---|
[17396] | 35 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
|
---|
| 36 | <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
|
---|
| 37 | <delete file="core.lzma"/>
|
---|
| 38 | <unzip src="${basedir}/core.comp" dest="${installDir}"/>
|
---|
| 39 | <delete file="core.comp"/>
|
---|
[14982] | 40 |
|
---|
[17437] | 41 | <echo message="Installing Servers"/>
|
---|
| 42 | <copy tofile="${installDir}/cgi-bin/oaiserver" file="${installDir}/bin/linux/oaiserver"/>
|
---|
| 43 | <copy tofile="${installDir}/cgi-bin/library" file="${installDir}/bin/linux/library"/>
|
---|
| 44 |
|
---|
[17444] | 45 | <!-- jre -->
|
---|
| 46 | <move todir="${installDir}/packages/jre">
|
---|
| 47 | <fileset dir="../@linux-java.extracted@"/>
|
---|
| 48 | </move>
|
---|
| 49 | <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
|
---|
[17437] | 50 |
|
---|
[17152] | 51 | <echo>Setting Binaries to Executable</echo>
|
---|
[15980] | 52 | <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
|
---|
| 53 | <chmod dir="${installDir}/bin/linux" includes="*" perm="775"/>
|
---|
| 54 | <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
|
---|
| 55 | <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
|
---|
[14982] | 56 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
| 57 | <echo/>
|
---|
| 58 |
|
---|
[17152] | 59 | <echo>Filling in concrete values in config files</echo>
|
---|
[16832] | 60 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
[17075] | 61 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
|
---|
| 62 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
|
---|
[16832] | 63 | <echo/>
|
---|
| 64 |
|
---|
[17152] | 65 | <echo>Creating admin and demo users</echo>
|
---|
[17107] | 66 | <adduser txt2db="${installDir}/bin/linux/txt2db"
|
---|
| 67 | usersDb="${installDir}/etc/users.db"
|
---|
| 68 | username="admin"
|
---|
| 69 | password="${admin.password}"
|
---|
| 70 | groups="administrator,colbuilder"
|
---|
| 71 | comment="created at install time"/>
|
---|
| 72 | <adduser
|
---|
| 73 | txt2db="${installDir}/bin/linux/txt2db"
|
---|
| 74 | usersDb="${installDir}/etc/users.db"
|
---|
| 75 | username="demo"
|
---|
| 76 | password="demo"
|
---|
| 77 | groups="demo"
|
---|
| 78 | comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
|
---|
| 79 |
|
---|
[17152] | 80 | <echo>Set the installation locale in config files</echo>
|
---|
| 81 | <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
|
---|
| 82 | <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
| 83 | <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
| 84 |
|
---|
| 85 | <rsr
|
---|
| 86 | file="${installDir}/gli/classes/xml/config.xml"
|
---|
| 87 | pattern="(<Argument name="general.locale">).*(</Argument>)"
|
---|
| 88 | replacement="$1${language}$2"/>
|
---|
| 89 |
|
---|
| 90 | <echo file="${installDir}/etc/main.cfg" append="true"
|
---|
| 91 | >cgiarg shortname=l argdefault=${language}</echo>
|
---|
| 92 |
|
---|
| 93 | <rsr file="${installDir}/etc/main.cfg" pattern="^status .*" replacement="status enabled"/>
|
---|
| 94 |
|
---|
| 95 | <echo>Deleting some unneeded files</echo>
|
---|
[14982] | 96 | <delete dir="${installDir}/resources/icons"/>
|
---|
| 97 | <delete file="${installDir}/resources/*.png"/>
|
---|
| 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 |
|
---|
| 106 | <!-- Source -->
|
---|
[15205] | 107 | <target name="install-source-code" depends="">
|
---|
[17152] | 108 | <echo>Installing Source Code</echo>
|
---|
[17396] | 109 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
|
---|
| 110 | <sevenzip task="decode" input="${basedir}/sourcecode.lzma" output="${basedir}/sourcecode.comp"/>
|
---|
| 111 | <delete file="sourcecode.lzma"/>
|
---|
| 112 | <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
|
---|
| 113 | <delete file="sourcecode.comp"/>
|
---|
[14982] | 114 | </target>
|
---|
| 115 |
|
---|
[17107] | 116 | <target name="cleanuptarget"></target>
|
---|
[14982] | 117 |
|
---|
| 118 |
|
---|
| 119 | </project>
|
---|