source: release-kits/mark2/installer/build.xml@ 17716

Last change on this file since 17716 was 17716, checked in by max, 15 years ago

Changing the permissions of the right folders at the right time.

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