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

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

create needed empty files at build time so they make it into all releases including archive releases

File size: 6.7 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 message="Installing Servers"/>
45 <copy tofile="${installDir}/cgi-bin/oaiserver" file="${installDir}/bin/linux/oaiserver"/>
46 <copy tofile="${installDir}/cgi-bin/library" file="${installDir}/bin/linux/library"/>
47
48 <echo>Setting Binaries to Executable</echo>
49 <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
50 <chmod dir="${installDir}/bin/linux" includes="*" perm="775"/>
51 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
52 <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
53 <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
54 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
55 <echo/>
56
57 <echo>Filling in concrete values in config files</echo>
58 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
59 <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
60 <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
61 <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
62 </rsr>
63 <echo/>
64
65 <echo>Creating admin and demo users</echo>
66 <adduser txt2db="${installDir}/bin/linux/txt2db"
67 usersDb="${installDir}/etc/users.db"
68 username="admin"
69 password="${admin.password}"
70 groups="administrator,colbuilder"
71 comment="created at install time"/>
72 <adduser
73 txt2db="${installDir}/bin/linux/txt2db"
74 usersDb="${installDir}/etc/users.db"
75 username="demo"
76 password="demo"
77 groups="demo"
78 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
79
80 <echo>Set the installation locale in config files</echo>
81 <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
82 <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
83 <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
84
85 <rsr
86 file="${installDir}/gli/classes/xml/config.xml"
87 pattern="(&lt;Argument name=&quot;general.locale&quot;&gt;).*(&lt;/Argument&gt;)"
88 replacement="$1${language}$2"/>
89
90 <echo file="${installDir}/etc/main.cfg" append="true"
91 >cgiarg shortname=l argdefault=${language}</echo>
92
93 <rsr file="${installDir}/etc/main.cfg" pattern="^status .*" replacement="status enabled"/>
94
95 <echo>Creating installation properties file</echo>
96 <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
97
98 <echo message="Finished"/>
99
100 </target>
101
102 <!-- imagemagick -->
103 <target name="Installing ImageMagick">
104 <echo>Installing ImageMagick</echo>
105 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
106 <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
107 <delete file="imagemagick.lzma"/>
108 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/linux"/>
109 <delete file="imagemagick.comp"/>
110
111 <echo>Setting ImageMagick Binaries to Executable</echo>
112 <chmod dir="${installDir}/bin/linux/imagemagick/bin" includes="*" perm="775"/>
113
114 </target>
115
116 <!-- source release -->
117 <target name="Source Release">
118
119 <echo>Installing Source Release</echo>
120 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="source-release.lzma"/></patternset></unzip>
121 <sevenzip task="decode" input="${basedir}/source-release.lzma" output="${basedir}/source-release.comp"/>
122 <delete file="source-release.lzma"/>
123 <unzip src="${basedir}/source-release.comp" dest="${installDir}"/>
124 <delete file="source-release.comp"/>
125
126 <echo>Setting Binaries to Executable</echo>
127 <chmod dir="${installDir}" includes="*.sh,*.bash,**/configure" perm="775"/>
128 <chmod dir="${installDir}/bin/linux" includes="*" perm="775"/>
129 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
130 <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
131 <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
132 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
133 <echo/>
134
135 <echo>Filling in concrete values in config files</echo>
136 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
137 <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
138 <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
139 <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
140 </rsr>
141 <echo/>
142
143 <echo>Set the installation locale in config files</echo>
144 <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
145 <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
146 <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
147
148 <rsr
149 file="${installDir}/gli/classes/xml/config.xml"
150 pattern="(&lt;Argument name=&quot;general.locale&quot;&gt;).*(&lt;/Argument&gt;)"
151 replacement="$1${language}$2"/>
152
153 <echo file="${installDir}/etc/main.cfg" append="true"
154 >cgiarg shortname=l argdefault=${language}</echo>
155
156 <rsr file="${installDir}/etc/main.cfg" pattern="^status .*" replacement="status enabled"/>
157
158 <echo>Create usage.txt</echo>
159 <echo file="${installDir}/etc/usage.txt"></echo>
160
161 <echo>Creating installation properties file</echo>
162 <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
163
164 </target>
165
166</project>
Note: See TracBrowser for help on using the repository browser.