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

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

documented examples are now a component of cdrom installations

File size: 6.1 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 <or>
22 <available file="../@linux-java.extracted@/bin/java"/>
23 <available file="${orig.dir}/Java/Linux/jre"/>
24 </or>
25 </condition>
26
27 <target name="Initialising" if="bundled.java.exists">
28 <mkdir dir="${installDir}/packages"/>
29 <!-- start web -->
30 <copy todir="${installDir}/packages/jre" failonerror="false">
31 <fileset dir="../@linux-java.extracted@"/>
32 </copy>
33 <!-- end web -->
34
35 <!-- start cdrom -->
36 <copy todir="${installDir}/packages/jre" failonerror="false">
37 <fileset dir="${orig.dir}/Java/Linux/jre"/>
38 </copy>
39 <!-- end cdrom -->
40
41 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
42 </target>
43
44 <!-- core system -->
45 <target name="Installing Core System">
46
47 <mkdir dir="${installDir}"/>
48
49 <echo>Installing Core Files</echo>
50
51 <!-- web copies from compressed lzma files, cdrom copies from folders -->
52
53 <!-- start web -->
54 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
55 <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
56 <delete file="core.lzma"/>
57 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
58 <delete file="core.comp"/>
59 <!-- end web -->
60
61 <!-- start cdrom -->
62 <copy todir="${installDir}">
63 <fileset dir="${orig.dir}/Software/core/all"/>
64 <fileset dir="${orig.dir}/Software/core/linux"/>
65 </copy>
66 <!-- end cdrom -->
67
68 <echo>Setting Binaries to Executable</echo>
69 <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
70 <chmod dir="${installDir}/bin/linux" includes="**/*" perm="775"/>
71 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
72 <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
73 <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
74 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
75 <chmod dir="${installDir}/apache-httpd/linux/bin" includes="*" perm="775"/>
76 <chmod dir="${installDir}/apache-httpd/linux" includes="*.sh" perm="775"/>
77 <echo/>
78
79 <echo>Filling in concrete values in config files</echo>
80 <copy file="${installDir}/cgi-bin/gsdlsite.cfg.in" tofile="${installDir}/cgi-bin/gsdlsite.cfg"/>
81 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
82
83 <echo>Correcting perl shebangs in perl scripts</echo>
84 <exec executable="which" outputproperty="perl.executable"><arg value="perl"/></exec>
85 <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
86 <echo/>
87
88 <echo>Creating the english dictionary</echo>
89 <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
90 <echo/>
91
92
93 <echo>Set the installation locale in config files</echo>
94 <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
95 <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
96 <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
97
98 <rsr
99 file="${installDir}/gli/classes/xml/config.xml"
100 pattern="(&lt;Argument name=&quot;general.locale&quot;&gt;).*(&lt;/Argument&gt;)"
101 replacement="$1${language}$2"/>
102
103 <echo file="${installDir}/etc/main.cfg" append="true"
104 >cgiarg shortname=l argdefault=${language}</echo>
105
106 <echo>Setting up apache web server</echo>
107 <exec dir="${installDir}" executable="${installDir}/apache-httpd/linux/install-bindist.sh">
108 <arg value="${installDir}/apache-httpd/linux"/>
109 </exec>
110
111 <echo>Creating installation properties file</echo>
112 <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
113
114 <echo message="Finished"/>
115
116 </target>
117
118 <!-- imagemagick -->
119 <target name="Installing ImageMagick">
120 <echo>Installing ImageMagick</echo>
121 <!-- start web -->
122 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
123 <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
124 <delete file="imagemagick.lzma"/>
125 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/linux"/>
126 <delete file="imagemagick.comp"/>
127 <!-- end web -->
128
129 <!-- start cdrom -->
130 <copy todir="${installDir}/bin/linux">
131 <fileset dir="${orig.dir}/Software/imagemagick/linux"/>
132 </copy>
133 <!-- end cdrom -->
134
135 <echo>Setting ImageMagick Binaries to Executable</echo>
136 <chmod dir="${installDir}/bin/linux/imagemagick/bin" includes="*" perm="775"/>
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>Creating admin and demo users</echo>
144 <adduser txt2db="${installDir}/bin/linux/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/linux/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 <target name="Installing Documented Examples">
160 <copy todir="${installDir}/collect">
161 <fileset dir="${orig.dir}/Documented Examples" includes="documented-examples/**/*"/>
162 </copy>
163 </target>
164
165
166</project>
Note: See TracBrowser for help on using the repository browser.