1 | <?xml version="1.0"?>
|
---|
2 | <!--
|
---|
3 | This 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}/packages"/>
|
---|
26 | <!-- start web -->
|
---|
27 | <copy todir="${installDir}/packages/jre" failonerror="false">
|
---|
28 | <fileset dir="../@linux-java.extracted@"/>
|
---|
29 | </copy>
|
---|
30 | <!-- end web -->
|
---|
31 |
|
---|
32 | <!-- start cdrom -->
|
---|
33 | <copy todir="${installDir}/packages/jre" failonerror="false">
|
---|
34 | <fileset dir="${orig.dir}/Java/Linux/jre"/>
|
---|
35 | </copy>
|
---|
36 | <!-- end cdrom -->
|
---|
37 | <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
|
---|
38 | </target>
|
---|
39 |
|
---|
40 | <!-- core system -->
|
---|
41 | <target name="Installing Core System">
|
---|
42 |
|
---|
43 | <mkdir dir="${installDir}"/>
|
---|
44 |
|
---|
45 | <echo>Installing Core Files</echo>
|
---|
46 |
|
---|
47 | <!-- web copies from compressed lzma files, cdrom copies from folders -->
|
---|
48 |
|
---|
49 | <!-- start web -->
|
---|
50 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
|
---|
51 | <sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
|
---|
52 | <delete file="core.lzma"/>
|
---|
53 | <unzip src="${basedir}/core.comp" dest="${installDir}"/>
|
---|
54 | <delete file="core.comp"/>
|
---|
55 | <!-- end web -->
|
---|
56 |
|
---|
57 | <!-- start cdrom -->
|
---|
58 | <copy todir="${installDir}">
|
---|
59 | <fileset dir="${orig.dir}/Software/core/all"/>
|
---|
60 | <fileset dir="${orig.dir}/Software/core/linux"/>
|
---|
61 | </copy>
|
---|
62 | <!-- end cdrom -->
|
---|
63 |
|
---|
64 | <echo>Setting Binaries to Executable</echo>
|
---|
65 | <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
|
---|
66 | <chmod dir="${installDir}/bin/linux" includes="**/*" perm="775"/>
|
---|
67 | <chmod dir="${installDir}/bin" includes="*" perm="775"/>
|
---|
68 | <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
|
---|
69 | <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
|
---|
70 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
71 | <chmod dir="${installDir}/apache-httpd/linux/bin" includes="*" perm="775"/>
|
---|
72 | <chmod dir="${installDir}/apache-httpd/linux" includes="*.sh" perm="775"/>
|
---|
73 | <echo/>
|
---|
74 |
|
---|
75 | <echo>Filling in concrete values in config files</echo>
|
---|
76 | <copy file="${installDir}/cgi-bin/gsdlsite.cfg.in" tofile="${installDir}/cgi-bin/gsdlsite.cfg"/>
|
---|
77 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
78 |
|
---|
79 | <echo>Correcting perl shebangs in perl scripts</echo>
|
---|
80 | <exec executable="which" outputproperty="perl.executable"><arg value="perl"/></exec>
|
---|
81 | <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
|
---|
82 | <echo/>
|
---|
83 |
|
---|
84 | <echo>Creating the english dictionary</echo>
|
---|
85 | <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
|
---|
86 | <echo/>
|
---|
87 |
|
---|
88 |
|
---|
89 | <echo>Set the installation locale in config files</echo>
|
---|
90 | <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
|
---|
91 | <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
92 | <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
93 |
|
---|
94 | <rsr
|
---|
95 | file="${installDir}/gli/classes/xml/config.xml"
|
---|
96 | pattern="(<Argument name="general.locale">).*(</Argument>)"
|
---|
97 | replacement="$1${language}$2"/>
|
---|
98 |
|
---|
99 | <echo file="${installDir}/etc/main.cfg" append="true"
|
---|
100 | >cgiarg shortname=l argdefault=${language}</echo>
|
---|
101 |
|
---|
102 | <echo>Setting up apache web server</echo>
|
---|
103 | <exec dir="${installDir}" executable="${installDir}/apache-httpd/linux/install-bindist.sh">
|
---|
104 | <arg value="${installDir}/apache-httpd/linux"/>
|
---|
105 | </exec>
|
---|
106 |
|
---|
107 | <echo>Creating installation properties file</echo>
|
---|
108 | <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
|
---|
109 |
|
---|
110 | <echo message="Finished"/>
|
---|
111 |
|
---|
112 | </target>
|
---|
113 |
|
---|
114 | <!-- imagemagick -->
|
---|
115 | <target name="Installing ImageMagick">
|
---|
116 | <echo>Installing ImageMagick</echo>
|
---|
117 | <!-- start web -->
|
---|
118 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
|
---|
119 | <sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
|
---|
120 | <delete file="imagemagick.lzma"/>
|
---|
121 | <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/linux"/>
|
---|
122 | <delete file="imagemagick.comp"/>
|
---|
123 | <!-- end web -->
|
---|
124 |
|
---|
125 | <!-- start cdrom -->
|
---|
126 | <copy todir="${installDir}/bin/linux">
|
---|
127 | <fileset dir="${orig.dir}/Software/imagemagick/linux"/>
|
---|
128 | </copy>
|
---|
129 | <!-- end cdrom -->
|
---|
130 |
|
---|
131 | <echo>Setting ImageMagick Binaries to Executable</echo>
|
---|
132 | <chmod dir="${installDir}/bin/linux/imagemagick/bin" includes="*" perm="775"/>
|
---|
133 |
|
---|
134 | </target>
|
---|
135 |
|
---|
136 | <target name="Configuring Administration Pages" if="enable.admin.pages">
|
---|
137 | <echo>Enabling Admin Pages</echo>
|
---|
138 | <rsr file="${installDir}/etc/main.cfg" pattern="^\s*status\s+.*" replacement="status enabled"/>
|
---|
139 | <echo>Creating admin and demo users</echo>
|
---|
140 | <adduser txt2db="${installDir}/bin/linux/txt2db"
|
---|
141 | usersDb="${installDir}/etc/users.gdb"
|
---|
142 | username="admin"
|
---|
143 | password="${admin.password}"
|
---|
144 | groups="administrator,colbuilder,all-collections-editor"
|
---|
145 | comment="created at install time"/>
|
---|
146 | <adduser
|
---|
147 | txt2db="${installDir}/bin/linux/txt2db"
|
---|
148 | usersDb="${installDir}/etc/users.gdb"
|
---|
149 | username="demo"
|
---|
150 | password="demo"
|
---|
151 | groups="demo"
|
---|
152 | comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
|
---|
153 | </target>
|
---|
154 |
|
---|
155 | </project>
|
---|