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

Revision 18977, 6.4 KB (checked in by oranfry, 11 years ago)

correct the perl shebang as part of the remote greenstone setup

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    <target name="Installing Core System" depends="">
21
22        <echo>basedir: ${basedir}</echo>
23        <echo>installDir: ${installDir}</echo>
24        <echo>antinstaller.jar: ${antinstaller.jar}</echo>
25
26        <!-- create the installation directory -->
27        <echo message="Creating Installation directory"/>
28        <mkdir dir="${installDir}"/>
29
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"/>
36
37        <echo message="Setting Binaries to Executable"/>
38        <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
39        <chmod dir="${installDir}/bin/darwin" includes="*" perm="775"/>
40        <chmod dir="${installDir}/bin" includes="*" perm="775"/>
41        <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
42        <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
43        <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
44        <chmod dir="${installDir}/apache-httpd/darwin/bin" includes="*" perm="775"/>
45        <chmod dir="${installDir}/apache-httpd/darwin" includes="*.sh" perm="775"/>
46        <echo/>
47
48        <echo message="Filling in concrete values in config files"/>
49        <copy file="${installDir}/cgi-bin/gsdlsite.cfg.in" tofile="${installDir}/cgi-bin/gsdlsite.cfg"/>
50        <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
51        <echo/>
52
53        <echo>Correcting perl shebangs in perl scripts</echo>
54        <exec executable="which" outputproperty="perl.executable"><arg value="perl"/></exec>
55        <if><bool><not><isempty value="${perl.executable}"/></not></bool>
56            <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
57        </if>
58        <echo/>
59
60        <echo message="Creating admin and demo users"/>
61        <adduser txt2db="${installDir}/bin/darwin/txt2db"
62            usersDb="${installDir}/etc/users.db"
63            username="admin"
64            password="${admin.password}"
65            groups="administrator,colbuilder"
66            comment="created at install time"/>
67        <adduser
68            txt2db="${installDir}/bin/darwin/txt2db"
69            usersDb="${installDir}/etc/users.db"
70            username="demo"
71            password="demo"
72            groups="demo"
73            comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
74
75        <!-- delete unneeded files -->     
76        <echo message="Deleting some unneeded files"/>
77        <delete dir="${installDir}/resources/icons"/>
78        <delete file="${installDir}/resources/*.png"/>
79
80        <echo>Setting up apache web server</echo>
81        <exec dir="${installDir}" executable="${installDir}/apache-httpd/darwin/install-bindist.sh">
82            <arg value="${installDir}/apache-httpd/darwin"/>
83        </exec>
84
85        <echo>Creating installation properties file</echo>
86        <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
87
88        <echo message="Finished"/>
89
90    </target>
91
92    <!-- ImageMagick -->
93    <target name="Installing ImageMagick" depends="">
94        <echo message="Installing ImageMagick"/>
95        <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
96        <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
97        <delete file="imagemagick.lzma"/>
98        <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/darwin" />
99        <delete file="imagemagick.comp"/>
100        <chmod dir="${installDir}/bin/darwin/imagemagick/bin" includes="*" perm="775"/>
101    </target>
102
103    <!-- Ghostscript -->
104    <target name="Installing Ghostscript" depends="">
105        <echo message="Installing Ghostscript"/>
106        <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
107        <sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/>
108        <delete file="ghostscript.lzma"/>
109        <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/darwin" />
110        <delete file="ghostscript.comp"/>
111        <chmod dir="${installDir}/bin/darwin/ghostscript/bin" includes="*" perm="775"/>
112    </target>
113
114
115    <target name="Source Release" depends="">
116
117        <!-- create the installation directory -->
118        <echo message="Creating Installation directory"/>
119        <mkdir dir="${installDir}"/>
120
121        <echo>Installing Source Release</echo>
122        <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="source-release.lzma"/></patternset></unzip>
123        <sevenzip task="decode" input="${basedir}/source-release.lzma" output="${basedir}/source-release.comp"/>
124        <delete file="source-release.lzma"/>
125        <unzip src="${basedir}/source-release.comp" dest="${installDir}"/>
126        <delete file="source-release.comp"/>
127
128        <echo message="Setting Binaries to Executable"/>
129        <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
130        <chmod dir="${installDir}/bin/darwin" includes="*" perm="775"/>
131        <chmod dir="${installDir}/bin" includes="*" perm="775"/>
132        <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
133        <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
134        <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
135        <echo/>
136
137        <echo message="Filling in concrete values in config files"/>
138        <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
139        <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
140        <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
141        <echo/>
142
143        <echo>Create usage.txt</echo>
144        <echo file="${installDir}/etc/usage.txt"></echo>
145
146        <echo>Creating installation properties file</echo>
147        <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
148
149        <echo message="Finished"/>
150
151    </target>
152
153
154
155</project>
Note: See TracBrowser for help on using the browser.