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 |
|
---|
19 | <condition property="bundled.java.exists">
|
---|
20 | <available file="../@java.extracted@/bin/java"/>
|
---|
21 | </condition>
|
---|
22 |
|
---|
23 |
|
---|
24 | <target name="install-core-components" depends="">
|
---|
25 |
|
---|
26 | <echo>basedir: ${basedir}</echo>
|
---|
27 | <echo>installDir: ${installDir}</echo>
|
---|
28 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
29 |
|
---|
30 | <echo>Creating Installation directory</echo>
|
---|
31 | <mkdir dir="${installDir}"/>
|
---|
32 |
|
---|
33 | <echo>Installing Core Files</echo>
|
---|
34 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
35 | <patternset>
|
---|
36 | <include name="gli/**/*"/>
|
---|
37 | <include name="bin/**/*"/>
|
---|
38 | <include name="cgi-bin/**/*"/>
|
---|
39 | <include name="etc/**/*"/>
|
---|
40 | <include name="mappings/**/*"/>
|
---|
41 | <include name="images/**/*"/>
|
---|
42 | <include name="perllib/**/*"/>
|
---|
43 | <include name="indexers/**/*"/>
|
---|
44 | <include name="macros/**/*"/>
|
---|
45 | <include name="collect/**/*"/>
|
---|
46 |
|
---|
47 | <include name="Install.sh"/>
|
---|
48 | <include name="setup.bash"/>
|
---|
49 | <include name="setup.csh"/>
|
---|
50 | <include name="LICENSE.txt"/>
|
---|
51 | <include name="READMEar.txt"/>
|
---|
52 | <include name="READMEen.txt"/>
|
---|
53 | <include name="READMEes.txt"/>
|
---|
54 | <include name="READMEfr.txt"/>
|
---|
55 | <include name="READMEes.txt"/>
|
---|
56 | <include name="Support.htm"/>
|
---|
57 | <include name="Uninstall.jar"/>
|
---|
58 | </patternset>
|
---|
59 | </unzip>
|
---|
60 | <echo/>
|
---|
61 |
|
---|
62 | <echo>Setting Binaries to Executable</echo>
|
---|
63 | <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
|
---|
64 | <chmod dir="${installDir}/bin/linux" includes="*" perm="775"/>
|
---|
65 | <chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
|
---|
66 | <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
|
---|
67 | <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
|
---|
68 | <echo/>
|
---|
69 |
|
---|
70 | <echo>Filling in concrete values in config files</echo>
|
---|
71 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
72 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
|
---|
73 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
|
---|
74 | <echo/>
|
---|
75 |
|
---|
76 | <echo>Creating admin and demo users</echo>
|
---|
77 | <adduser txt2db="${installDir}/bin/linux/txt2db"
|
---|
78 | usersDb="${installDir}/etc/users.db"
|
---|
79 | username="admin"
|
---|
80 | password="${admin.password}"
|
---|
81 | groups="administrator,colbuilder"
|
---|
82 | comment="created at install time"/>
|
---|
83 | <adduser
|
---|
84 | txt2db="${installDir}/bin/linux/txt2db"
|
---|
85 | usersDb="${installDir}/etc/users.db"
|
---|
86 | username="demo"
|
---|
87 | password="demo"
|
---|
88 | groups="demo"
|
---|
89 | comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
|
---|
90 |
|
---|
91 | <echo>Set the installation locale in config files</echo>
|
---|
92 | <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
|
---|
93 | <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
94 | <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
|
---|
95 |
|
---|
96 | <rsr
|
---|
97 | file="${installDir}/gli/classes/xml/config.xml"
|
---|
98 | pattern="(<Argument name="general.locale">).*(</Argument>)"
|
---|
99 | replacement="$1${language}$2"/>
|
---|
100 |
|
---|
101 | <echo file="${installDir}/etc/main.cfg" append="true"
|
---|
102 | >cgiarg shortname=l argdefault=${language}</echo>
|
---|
103 |
|
---|
104 | <rsr file="${installDir}/etc/main.cfg" pattern="^status .*" replacement="status enabled"/>
|
---|
105 |
|
---|
106 | <echo>Deleting some unneeded files</echo>
|
---|
107 | <delete dir="${installDir}/resources/icons"/>
|
---|
108 | <delete file="${installDir}/resources/*.png"/>
|
---|
109 |
|
---|
110 | <echo>Creating installation properties file</echo>
|
---|
111 | <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
|
---|
112 |
|
---|
113 |
|
---|
114 | <echo message="Finished"/>
|
---|
115 |
|
---|
116 | </target>
|
---|
117 |
|
---|
118 | <!-- Source -->
|
---|
119 | <target name="install-source-code" depends="">
|
---|
120 | <echo>Installing Source Code</echo>
|
---|
121 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
122 | <patternset>
|
---|
123 | <include name="common-src/**/*"/>
|
---|
124 | <include name="runtime-src/**/*"/>
|
---|
125 | <include name="build-src/**/*"/>
|
---|
126 | <include name="packages/**/*"/>
|
---|
127 | </patternset>
|
---|
128 | </unzip>
|
---|
129 | </target>
|
---|
130 |
|
---|
131 | <target name="install-java">
|
---|
132 | <echo>Installing bundled java</echo>
|
---|
133 | <copy todir="${installDir}/packages/jre">
|
---|
134 | <fileset dir="../@java.extracted@"/>
|
---|
135 | </copy>
|
---|
136 | <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
|
---|
137 | </target>
|
---|
138 |
|
---|
139 | <target name="cleanuptarget"></target>
|
---|
140 |
|
---|
141 |
|
---|
142 | </project>
|
---|