root/release-kits/mark2/installer/build.xml @ 17652

Revision 17652, 5.2 KB (checked in by oranfry, 11 years ago)

started source releases

Line 
1<?xml version="1.0"?>
2<!--
3This is the build.xml run by AntInstaller for the installer
4-->
5
6<project name="Installation">
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 -->
16    <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
17    <typedef name="adduser" classname="org.greenstone.anttasks.AddGreenstoneUserToDatabase" classpathref="project.classpath"/>
18    <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
19
20    <condition property="bundled.java.exists">
21        <available file="../@java.extracted@/bin/java"/>
22    </condition>
23
24
25    <target name="Installing Core System" depends="">
26
27        <echo>basedir: ${basedir}</echo>
28        <echo>installDir: ${installDir}</echo>
29        <echo>antinstaller.jar: ${antinstaller.jar}</echo>
30
31        <!-- create the installation directory -->
32        <echo message="Creating Installation directory"/>
33        <mkdir dir="${installDir}"/>
34
35
36        <echo>Installing Core Files</echo>
37        <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
38        <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
39        <delete file="core.lzma"/>
40        <unzip src="${basedir}/core.comp" dest="${installDir}"/>
41        <delete file="core.comp"/>
42
43        <echo message="Installing Servers"/>
44        <copy tofile="${installDir}/cgi-bin/oaiserver" file="${installDir}/bin/darwin/oaiserver"/>
45        <copy tofile="${installDir}/cgi-bin/library" file="${installDir}/bin/darwin/library"/>
46
47        <echo message="Setting Binaries to Executable"/>
48        <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
49        <chmod dir="${installDir}/bin/darwin" includes="*" perm="775"/>
50        <chmod dir="${installDir}/bin" includes="*" perm="775"/>
51        <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
52        <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
53        <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
54        <echo/>
55
56        <echo message="Filling in concrete values in config files"/>
57        <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
58        <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
59        <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
60        <echo/>
61
62        <echo message="Creating admin and demo users"/>
63        <adduser txt2db="${installDir}/bin/darwin/txt2db"
64            usersDb="${installDir}/etc/users.db"
65            username="admin"
66            password="${admin.password}"
67            groups="administrator,colbuilder"
68            comment="created at install time"/>
69        <adduser
70            txt2db="${installDir}/bin/darwin/txt2db"
71            usersDb="${installDir}/etc/users.db"
72            username="demo"
73            password="demo"
74            groups="demo"
75            comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
76
77        <!-- delete unneeded files -->     
78        <echo message="Deleting some unneeded files"/>
79        <delete dir="${installDir}/resources/icons"/>
80        <delete file="${installDir}/resources/*.png"/>
81
82        <echo>Creating installation properties file</echo>
83        <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
84
85        <echo message="Finished"/>
86
87    </target>
88
89    <!-- sourcecode core system -->
90    <target name="Installing Source Code Core">
91
92        <echo>Installing Source Code Core</echo>
93        <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode-core.lzma"/></patternset></unzip>
94        <sevenzip task="decode" input="${basedir}/sourcecode-core.lzma" output="${basedir}/sourcecode-core.comp"/>
95        <delete file="sourcecode-core.lzma"/>
96        <unzip src="${basedir}/sourcecode-core.comp" dest="${installDir}"/>
97        <delete file="sourcecode-core.comp"/>
98
99        <echo>Set the installation locale in config files</echo>
100        <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
101        <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
102        <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
103
104        <rsr
105            file="${installDir}/gli/classes/xml/config.xml"
106            pattern="(&lt;Argument name=&quot;general.locale&quot;&gt;).*(&lt;/Argument&gt;)"
107            replacement="$1${language}$2"/>
108
109        <echo file="${installDir}/etc/main.cfg" append="true"
110            >cgiarg          shortname=l argdefault=${language}</echo>
111
112        <rsr file="${installDir}/etc/main.cfg" pattern="^status .*" replacement="status enabled"/>
113
114        <echo>Creating installation properties file</echo>
115        <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
116
117    </target>
118
119
120
121    <!-- Source -->
122    <target name="Installing Source Code" depends="">
123        <echo message="Installing Source Code"/>
124        <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
125        <sevenzip task="decode" input="${basedir}/sourcecode.lzma" output="${basedir}/sourcecode.comp"/>
126        <delete file="sourcecode.lzma"/>
127        <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
128        <delete file="sourcecode.comp"/>
129
130    </target>
131
132</project>
Note: See TracBrowser for help on using the browser.