source: release-kits/mark2/installer/build.xml@ 19256

Last change on this file since 19256 was 19256, checked in by oranfry, 15 years ago

adding admin to one more group at install

File size: 6.8 KB
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 <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
56 <echo/>
57
58 <!-- delete unneeded files -->
59 <echo message="Deleting some unneeded files"/>
60 <delete dir="${installDir}/resources/icons"/>
61 <delete file="${installDir}/resources/*.png"/>
62
63 <echo>Setting up apache web server</echo>
64 <exec dir="${installDir}" executable="${installDir}/apache-httpd/darwin/install-bindist.sh">
65 <arg value="${installDir}/apache-httpd/darwin"/>
66 </exec>
67
68 <echo>Creating the english dictionary</echo>
69 <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
70 <echo/>
71
72 <echo>Creating installation properties file</echo>
73 <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
74
75 <echo message="Finished"/>
76
77 </target>
78
79 <!-- ImageMagick -->
80 <target name="Installing ImageMagick" depends="">
81 <echo message="Installing ImageMagick"/>
82 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
83 <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
84 <delete file="imagemagick.lzma"/>
85 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/darwin" />
86 <delete file="imagemagick.comp"/>
87 <chmod dir="${installDir}/bin/darwin/imagemagick/bin" includes="*" perm="775"/>
88 </target>
89
90 <!-- Ghostscript -->
91 <target name="Installing Ghostscript" depends="">
92 <echo message="Installing Ghostscript"/>
93 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
94 <sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/>
95 <delete file="ghostscript.lzma"/>
96 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/darwin" />
97 <delete file="ghostscript.comp"/>
98 <chmod dir="${installDir}/bin/darwin/ghostscript/bin" includes="*" perm="775"/>
99 </target>
100
101
102 <target name="Source Release" depends="">
103
104 <!-- create the installation directory -->
105 <echo message="Creating Installation directory"/>
106 <mkdir dir="${installDir}"/>
107
108 <echo>Installing Source Release</echo>
109 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="source-release.lzma"/></patternset></unzip>
110 <sevenzip task="decode" input="${basedir}/source-release.lzma" output="${basedir}/source-release.comp"/>
111 <delete file="source-release.lzma"/>
112 <unzip src="${basedir}/source-release.comp" dest="${installDir}"/>
113 <delete file="source-release.comp"/>
114
115 <echo message="Setting Binaries to Executable"/>
116 <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
117 <chmod dir="${installDir}/bin/darwin" includes="*" perm="775"/>
118 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
119 <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
120 <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
121 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
122 <echo/>
123
124 <echo message="Filling in concrete values in config files"/>
125 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
126 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
127 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
128 <echo/>
129
130 <echo>Create usage.txt</echo>
131 <echo file="${installDir}/etc/usage.txt"></echo>
132
133 <echo>Creating installation properties file</echo>
134 <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
135
136 <echo message="Finished"/>
137
138 </target>
139
140 <target name="Configuring Administration Pages" if="enable.admin.pages">
141 <echo>Enabling Admin Pages</echo>
142 <rsr file="${installDir}/etc/main.cfg" pattern="^\s*status\s+.*" replacement="status enabled"/>
143 <echo message="Creating admin and demo users"/>
144 <adduser txt2db="${installDir}/bin/darwin/txt2db"
145 usersDb="${installDir}/etc/users.gdb"
146 username="admin"
147 password="${admin.password}"
148 groups="administrator,colbuilder,all-collections-editor"
149 comment="created at install time"/>
150 <adduser
151 txt2db="${installDir}/bin/darwin/txt2db"
152 usersDb="${installDir}/etc/users.gdb"
153 username="demo"
154 password="demo"
155 groups="demo"
156 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
157 </target>
158
159
160</project>
Note: See TracBrowser for help on using the repository browser.