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

Revision 17107, 4.0 KB (checked in by oranfry, 12 years ago)

changed build scripts and create-installer targets after the greenstone ant tasks were moved. also, greenstone2 installer now creates admin and demo users at install

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
19    <condition property="bundled.java.exists">
20        <available file="../@java.extracted@/bin/java"/>
21    </condition>
22
23
24    <target name="install-core-components" depends="">
25
26        <echo>basedir: ${basedir}</echo>
27        <echo>installDir: ${installDir}</echo>
28        <echo>antinstaller.jar: ${antinstaller.jar}</echo>
29
30        <!-- create the installation directory -->
31        <echo message="Creating Installation directory"/>
32        <mkdir dir="${installDir}"/>
33
34        <!-- install files -->
35        <echo message="Installing Core Files"/>
36        <unzip src="${antinstaller.jar}" dest="${installDir}">
37            <patternset>
38
39                <include name="gli/**/*"/>
40                <include name="bin/**/*"/>
41                <include name="cgi-bin/**/*"/>
42                <include name="etc/**/*"/>
43                <include name="mappings/**/*"/>
44                <include name="images/**/*"/>
45                <include name="perllib/**/*"/>
46                <include name="indexers/**/*"/>
47                <include name="macros/**/*"/>
48                <include name="collect/**/*"/>
49
50                <include name="Install.sh"/>
51                <include name="setup.bash"/>
52                <include name="setup.csh"/>
53                <include name="LICENSE.txt"/>
54                <include name="READMEar.txt"/>
55                <include name="READMEen.txt"/>
56                <include name="READMEes.txt"/>
57                <include name="READMEfr.txt"/>
58                <include name="READMEes.txt"/>
59                <include name="Support.htm"/>
60            </patternset>
61        </unzip>
62        <echo/>
63
64        <echo message="Setting Binaries to Executable"/>
65        <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
66        <chmod dir="${installDir}/bin/darwin" includes="*" perm="775"/>
67        <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
68        <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
69        <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
70        <echo/>
71
72        <echo message="Filling in concrete values in config files"/>
73        <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
74        <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
75        <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
76        <echo/>
77
78        <echo message="Creating admin and demo users"/>
79        <adduser txt2db="${installDir}/bin/linux/txt2db"
80            usersDb="${installDir}/etc/users.db"
81            username="admin"
82            password="${admin.password}"
83            groups="administrator,colbuilder"
84            comment="created at install time"/>
85        <adduser
86            txt2db="${installDir}/bin/linux/txt2db"
87            usersDb="${installDir}/etc/users.db"
88            username="demo"
89            password="demo"
90            groups="demo"
91            comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
92
93        <!-- delete unneeded files -->     
94        <echo message="Deleting some unneeded files"/>
95        <delete dir="${installDir}/resources/icons"/>
96        <delete file="${installDir}/resources/*.png"/>
97
98        <echo message="Finished"/>
99
100    </target>
101
102    <!-- Source -->
103    <target name="install-source-code" depends="">
104        <echo message="Installing Source Code"/>
105        <unzip src="${antinstaller.jar}" dest="${installDir}">
106            <patternset>
107                <include name="common-src/**/*"/>
108                <include name="runtime-src/**/*"/>
109                <include name="build-src/**/*"/>
110                <include name="packages/**/*"/>
111            </patternset>
112        </unzip>
113    </target>
114
115    <target name="install-java">
116        <echo message="Installing bundled java"/>
117        <copy todir="${installDir}/packages/jre">
118            <fileset dir="../@java.extracted@"/>
119        </copy>
120        <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>       
121    </target>
122
123    <target name="cleanuptarget">
124    </target>
125   
126
127</project>
Note: See TracBrowser for help on using the browser.