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

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

fixes to lirk and mark

File size: 6.5 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
25 <!-- core system -->
26 <target name="Installing Core System">
27
28 <echo>basedir: ${basedir}</echo>
29 <echo>installDir: ${installDir}</echo>
30 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
31
32 <echo>Creating Installation directory</echo>
33 <mkdir dir="${installDir}"/>
34
35 <echo>Installing Core Files</echo>
36 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
37 <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
38 <delete file="core.lzma"/>
39 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
40 <delete file="core.comp"/>
41
42 <echo message="Installing Servers"/>
43 <copy tofile="${installDir}/cgi-bin/oaiserver" file="${installDir}/bin/linux/oaiserver"/>
44 <copy tofile="${installDir}/cgi-bin/library" file="${installDir}/bin/linux/library"/>
45
46 <!-- jre -->
47 <copy todir="${installDir}/packages/jre" failonerror="false">
48 <fileset dir="../@linux-java.extracted@"/>
49 </copy>
50 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
51
52 <echo>Setting Binaries to Executable</echo>
53 <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
54 <chmod dir="${installDir}/bin/linux" includes="*" perm="775"/>
55 <chmod dir="${installDir}/bin/linux/imagemagick" includes="*" perm="775"/>
56 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
57 <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
58 <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
59 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
60 <echo/>
61
62 <echo>Filling in concrete values in config files</echo>
63 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
64 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
65 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
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>Creating installation properties file</echo>
99 <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
100
101 <echo message="Finished"/>
102
103 </target>
104
105 <!-- sourcecode core system -->
106 <target name="Installing Source Code Core">
107
108 <echo>Installing Source Code Core</echo>
109 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode-core.lzma"/></patternset></unzip>
110 <sevenzip task="decode" input="${basedir}/sourcecode-core.lzma" output="${basedir}/sourcecode-core.comp"/>
111 <delete file="sourcecode-core.lzma"/>
112 <unzip src="${basedir}/sourcecode-core.comp" dest="${installDir}"/>
113 <delete file="sourcecode-core.comp"/>
114
115 <echo>Set the installation locale in config files</echo>
116 <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
117 <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
118 <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
119
120 <rsr
121 file="${installDir}/gli/classes/xml/config.xml"
122 pattern="(&lt;Argument name=&quot;general.locale&quot;&gt;).*(&lt;/Argument&gt;)"
123 replacement="$1${language}$2"/>
124
125 <echo file="${installDir}/etc/main.cfg" append="true"
126 >cgiarg shortname=l argdefault=${language}</echo>
127
128 <rsr file="${installDir}/etc/main.cfg" pattern="^status .*" replacement="status enabled"/>
129
130 <echo>Creating installation properties file</echo>
131 <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
132
133 </target>
134
135
136 <!-- source code -->
137 <target name="Installing Source Code">
138 <echo>Installing Source Code</echo>
139 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
140 <sevenzip task="decode" input="${basedir}/sourcecode.lzma" output="${basedir}/sourcecode.comp"/>
141 <delete file="sourcecode.lzma"/>
142 <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
143 <delete file="sourcecode.comp"/>
144 </target>
145
146 <!-- imagemagick -->
147 <target name="Installing ImageMagick">
148 <echo>Installing ImageMagick</echo>
149 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
150 <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
151 <delete file="imagemagick.lzma"/>
152 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/linux"/>
153 <delete file="imagemagick.comp"/>
154 </target>
155
156</project>
Note: See TracBrowser for help on using the repository browser.