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

Last change on this file since 17437 was 17437, checked in by oranfry, 16 years ago

changes to the way binaries are stored in the cgi-bin and bin/(os) directories

File size: 4.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
25 <target name="install-core-components" depends="">
26
27 <echo>basedir: ${basedir}</echo>
28 <echo>installDir: ${installDir}</echo>
29 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
30
31 <echo>Creating Installation directory</echo>
32 <mkdir dir="${installDir}"/>
33
34 <echo>Installing Core Files</echo>
35 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
36 <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
37 <delete file="core.lzma"/>
38 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
39 <delete file="core.comp"/>
40
41 <echo message="Installing Servers"/>
42 <copy tofile="${installDir}/cgi-bin/oaiserver" file="${installDir}/bin/linux/oaiserver"/>
43 <copy tofile="${installDir}/cgi-bin/library" file="${installDir}/bin/linux/library"/>
44
45
46 <echo>Setting Binaries to Executable</echo>
47 <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
48 <chmod dir="${installDir}/bin/linux" includes="*" perm="775"/>
49 <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
50 <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
51 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
52 <echo/>
53
54 <echo>Filling in concrete values in config files</echo>
55 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
56 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
57 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
58 <echo/>
59
60 <echo>Creating admin and demo users</echo>
61 <adduser txt2db="${installDir}/bin/linux/txt2db"
62 usersDb="${installDir}/etc/users.db"
63 username="admin"
64 password="${admin.password}"
65 groups="administrator,colbuilder"
66 comment="created at install time"/>
67 <adduser
68 txt2db="${installDir}/bin/linux/txt2db"
69 usersDb="${installDir}/etc/users.db"
70 username="demo"
71 password="demo"
72 groups="demo"
73 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
74
75 <echo>Set the installation locale in config files</echo>
76 <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
77 <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
78 <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
79
80 <rsr
81 file="${installDir}/gli/classes/xml/config.xml"
82 pattern="(&lt;Argument name=&quot;general.locale&quot;&gt;).*(&lt;/Argument&gt;)"
83 replacement="$1${language}$2"/>
84
85 <echo file="${installDir}/etc/main.cfg" append="true"
86 >cgiarg shortname=l argdefault=${language}</echo>
87
88 <rsr file="${installDir}/etc/main.cfg" pattern="^status .*" replacement="status enabled"/>
89
90 <echo>Deleting some unneeded files</echo>
91 <delete dir="${installDir}/resources/icons"/>
92 <delete file="${installDir}/resources/*.png"/>
93
94 <echo>Creating installation properties file</echo>
95 <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
96
97
98 <echo message="Finished"/>
99
100 </target>
101
102 <!-- Source -->
103 <target name="install-source-code" depends="">
104 <echo>Installing Source Code</echo>
105 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
106 <sevenzip task="decode" input="${basedir}/sourcecode.lzma" output="${basedir}/sourcecode.comp"/>
107 <delete file="sourcecode.lzma"/>
108 <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
109 <delete file="sourcecode.comp"/>
110 </target>
111
112 <target name="install-linux-jre">
113 <echo>Installing bundled java</echo>
114 <copy todir="${installDir}/packages/jre">
115 <fileset dir="../@linux-java.extracted@"/>
116 </copy>
117 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
118 </target>
119
120 <target name="cleanuptarget"></target>
121
122
123</project>
Note: See TracBrowser for help on using the repository browser.