source: release-kits/lirk2/installer/build.xml@ 18980

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

create the english gli dictionary at install

File size: 7.2 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 <condition property="bundled.java.exists">
21 <available file="../@linux-java.extracted@/bin/java"/>
22 </condition>
23
24 <target name="Initialising" if="bundled.java.exists">
25 <mkdir dir="${installDir}"/>
26 <copy todir="${installDir}/packages/jre" failonerror="false">
27 <fileset dir="../@linux-java.extracted@"/>
28 </copy>
29 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
30 </target>
31
32 <!-- core system -->
33 <target name="Installing Core System">
34
35 <mkdir dir="${installDir}"/>
36
37 <echo>Installing Core Files</echo>
38 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
39 <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
40 <delete file="core.lzma"/>
41 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
42 <delete file="core.comp"/>
43
44 <echo>Setting Binaries to Executable</echo>
45 <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
46 <chmod dir="${installDir}/bin/linux" includes="**/*" perm="775"/>
47 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
48 <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
49 <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
50 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
51 <chmod dir="${installDir}/apache-httpd/linux/bin" includes="*" perm="775"/>
52 <chmod dir="${installDir}/apache-httpd/linux" includes="*.sh" perm="775"/>
53 <echo/>
54
55 <echo>Filling in concrete values in config files</echo>
56 <copy file="${installDir}/cgi-bin/gsdlsite.cfg.in" tofile="${installDir}/cgi-bin/gsdlsite.cfg"/>
57 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
58
59 <echo>Correcting perl shebangs in perl scripts</echo>
60 <exec executable="which" outputproperty="perl.executable"><arg value="perl"/></exec>
61 <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
62 <echo/>
63
64 <echo>Creating the english dictionary</echo>
65 <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
66 <echo/>
67
68 <echo>Creating admin and demo users</echo>
69 <adduser txt2db="${installDir}/bin/linux/txt2db"
70 usersDb="${installDir}/etc/users.db"
71 username="admin"
72 password="${admin.password}"
73 groups="administrator,colbuilder"
74 comment="created at install time"/>
75 <adduser
76 txt2db="${installDir}/bin/linux/txt2db"
77 usersDb="${installDir}/etc/users.db"
78 username="demo"
79 password="demo"
80 groups="demo"
81 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
82
83 <echo>Set the installation locale in config files</echo>
84 <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
85 <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
86 <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
87
88 <rsr
89 file="${installDir}/gli/classes/xml/config.xml"
90 pattern="(&lt;Argument name=&quot;general.locale&quot;&gt;).*(&lt;/Argument&gt;)"
91 replacement="$1${language}$2"/>
92
93 <echo file="${installDir}/etc/main.cfg" append="true"
94 >cgiarg shortname=l argdefault=${language}</echo>
95
96 <rsr file="${installDir}/etc/main.cfg" pattern="^status .*" replacement="status enabled"/>
97
98 <echo>Setting up apache web server</echo>
99 <exec dir="${installDir}" executable="${installDir}/apache-httpd/linux/install-bindist.sh">
100 <arg value="${installDir}/apache-httpd/linux"/>
101 </exec>
102
103 <echo>Creating installation properties file</echo>
104 <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
105
106 <echo message="Finished"/>
107
108 </target>
109
110 <!-- imagemagick -->
111 <target name="Installing ImageMagick">
112 <echo>Installing ImageMagick</echo>
113 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
114 <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
115 <delete file="imagemagick.lzma"/>
116 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/linux"/>
117 <delete file="imagemagick.comp"/>
118
119 <echo>Setting ImageMagick Binaries to Executable</echo>
120 <chmod dir="${installDir}/bin/linux/imagemagick/bin" includes="*" perm="775"/>
121
122 </target>
123
124 <!-- source release -->
125 <target name="Source Release">
126
127 <echo>Installing Source Release</echo>
128 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="source-release.lzma"/></patternset></unzip>
129 <sevenzip task="decode" input="${basedir}/source-release.lzma" output="${basedir}/source-release.comp"/>
130 <delete file="source-release.lzma"/>
131 <unzip src="${basedir}/source-release.comp" dest="${installDir}"/>
132 <delete file="source-release.comp"/>
133
134 <echo>Setting Binaries to Executable</echo>
135 <chmod dir="${installDir}" includes="*.sh,*.bash,**/configure" perm="775"/>
136 <chmod dir="${installDir}/bin/linux" includes="*" perm="775"/>
137 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
138 <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
139 <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
140 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
141 <echo/>
142
143 <echo>Filling in concrete values in config files</echo>
144 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
145 <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
146 <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
147 <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
148 </rsr>
149 <echo/>
150
151 <echo>Set the installation locale in config files</echo>
152 <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
153 <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
154 <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
155
156 <rsr
157 file="${installDir}/gli/classes/xml/config.xml"
158 pattern="(&lt;Argument name=&quot;general.locale&quot;&gt;).*(&lt;/Argument&gt;)"
159 replacement="$1${language}$2"/>
160
161 <echo file="${installDir}/etc/main.cfg" append="true"
162 >cgiarg shortname=l argdefault=${language}</echo>
163
164 <rsr file="${installDir}/etc/main.cfg" pattern="^status .*" replacement="status enabled"/>
165
166 <echo>Create usage.txt</echo>
167 <echo file="${installDir}/etc/usage.txt"></echo>
168
169 <echo>Creating installation properties file</echo>
170 <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
171
172 </target>
173
174</project>
Note: See TracBrowser for help on using the repository browser.