1 | <?xml version="1.0" encoding="utf-8" ?>
|
---|
2 |
|
---|
3 | <!--
|
---|
4 | ..........................................................
|
---|
5 | September 2007
|
---|
6 | Greenstone3 'release maker' script
|
---|
7 | Oran Fry
|
---|
8 | ..........................................................
|
---|
9 | -->
|
---|
10 |
|
---|
11 | <project name="lirk3-create-installer" default="create-installer">
|
---|
12 |
|
---|
13 | <target name="create-installer">
|
---|
14 | <addressedcall target="setup-for-installer-creation"/>
|
---|
15 | <addressedcall target="compile-installer"/>
|
---|
16 | <addressedcall target="clean-up-after-installer-creation"/>
|
---|
17 | </target>
|
---|
18 |
|
---|
19 | <target name="setup-for-installer-creation">
|
---|
20 | <if><bool><istrue value="${execute}"/></bool>
|
---|
21 |
|
---|
22 | <!-- get the size of packages -->
|
---|
23 | <exec executable="du" dir="${basedir}/distribution/greenstone3/packages" outputproperty="du.tomcat"><arg line="-hs tomcat"/></exec>
|
---|
24 | <exec executable="sed" inputstring="${du.tomcat}" outputproperty="component.size.tomcat"><arg line="-e 's/^\(.*\)\s.*$/\1b/g'"/></exec>
|
---|
25 |
|
---|
26 | <exec executable="du" dir="${basedir}/distribution/greenstone3/packages" outputproperty="du.ant"><arg line="-hs ant"/></exec>
|
---|
27 | <exec executable="sed" inputstring="${du.ant}" outputproperty="component.size.ant"><arg line="-e 's/^\(.*\)\s.*$/\1b/g'"/></exec>
|
---|
28 |
|
---|
29 | <echo>Project Path: ${basedir}/distribution/greenstone3</echo>
|
---|
30 | <mkdir dir="${basedir}/installer"/>
|
---|
31 | <copy todir="${basedir}/installer" file="${lirk3.home}/installer/antinstall-config.xml"/>
|
---|
32 | <copy todir="${basedir}/installer" file="${lirk3.home}/installer/build.xml"/>
|
---|
33 | <copy todir="${basedir}/installer/cp"><fileset dir="${lirk3.home}/installer/cp"/></copy>
|
---|
34 |
|
---|
35 | <!-- put the concrete values of things in the config -->
|
---|
36 | <rsr file="${basedir}/installer/antinstall-config.xml" pattern="@version@" replacement="${version}"/>
|
---|
37 | <rsr file="${basedir}/installer/antinstall-config.xml" pattern="@component.size.java@" replacement="${component.size.java}"/>
|
---|
38 | <rsr file="${basedir}/installer/antinstall-config.xml" pattern="@component.size.tomcat@" replacement="${component.size.tomcat}"/>
|
---|
39 | <rsr file="${basedir}/installer/antinstall-config.xml" pattern="@component.size.ant@" replacement="${component.size.ant}"/>
|
---|
40 |
|
---|
41 | <rsr file="${basedir}/installer/build.xml" pattern="@java.min.version@" replacement="${java.min.version}"/>
|
---|
42 | <rsr file="${basedir}/installer/build.xml" pattern="@java.extracted@" replacement="${java.extracted}"/>
|
---|
43 |
|
---|
44 |
|
---|
45 | <!-- put the concrete values of things in the text -->
|
---|
46 |
|
---|
47 | <!-- default -->
|
---|
48 | <rsr file="${basedir}/installer/cp/resources/LanguagePack.properties" pattern="@version@" replacement="${version}"/>
|
---|
49 | <rsr file="${basedir}/installer/cp/resources/LanguagePack.properties" pattern="@java.min.version@" replacement="${java.min.version}"/>
|
---|
50 | <rsr file="${basedir}/installer/cp/resources/LanguagePack.properties" pattern="@bundled.version.java@" replacement="${bundled.version.java}"/>
|
---|
51 | <rsr file="${basedir}/installer/cp/resources/LanguagePack.properties" pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
|
---|
52 | <rsr file="${basedir}/installer/cp/resources/LanguagePack.properties" pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
|
---|
53 |
|
---|
54 | <!-- chinese -->
|
---|
55 | <rsr file="${basedir}/installer/cp/resources/LanguagePack_zh_CN.properties" pattern="@version@" replacement="${version}"/>
|
---|
56 | <rsr file="${basedir}/installer/cp/resources/LanguagePack_zh_CN.properties" pattern="@java.min.version@" replacement="${java.min.version}"/>
|
---|
57 | <rsr file="${basedir}/installer/cp/resources/LanguagePack_zh_CN.properties" pattern="@bundled.version.java@" replacement="${bundled.version.java}"/>
|
---|
58 | <rsr file="${basedir}/installer/cp/resources/LanguagePack_zh_CN.properties" pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
|
---|
59 | <rsr file="${basedir}/installer/cp/resources/LanguagePack_zh_CN.properties" pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
|
---|
60 |
|
---|
61 | </if>
|
---|
62 | </target>
|
---|
63 |
|
---|
64 | <target name="compile-installer">
|
---|
65 | <if><bool><istrue value="${execute}"/></bool>
|
---|
66 |
|
---|
67 | <installer file="${basedir}/installer/greenstone3-with-java.jar"
|
---|
68 | compress="true"
|
---|
69 | extractType="NonExtractor"
|
---|
70 | installConfig="${basedir}/installer/antinstall-config.xml"
|
---|
71 | buildFile="${basedir}/installer/build.xml"
|
---|
72 | antInstallLib="${lirk3.home}/bin/ant-installer/lib"
|
---|
73 | antLib="${lirk3.home}/bin/ant-installer/antlib"
|
---|
74 | validateConfig="true"
|
---|
75 | failOnError="false"
|
---|
76 | icons="bluecurve">
|
---|
77 |
|
---|
78 | <!-- copy all the important files into the archive to be extracted for install -->
|
---|
79 | <zipfileset dir="${basedir}/installer/cp" includes="resources/*"/>
|
---|
80 | <zipfileset dir="${lirk3.home}/ant-scripts/tasks/orans"><include name="RegexSearchReplace.class"/></zipfileset>
|
---|
81 |
|
---|
82 |
|
---|
83 | <zipfileset dir="${basedir}/distribution/greenstone3" includes="*"/>
|
---|
84 | <zipfileset dir="${basedir}/distribution/greenstone3/bin" prefix="bin"><include name="**/*"/></zipfileset>
|
---|
85 | <zipfileset dir="${basedir}/distribution/greenstone3/docs" prefix="docs"><include name="**/*"/></zipfileset>
|
---|
86 | <zipfileset dir="${basedir}/distribution/greenstone3/gli" prefix="gli"><include name="**/*"/></zipfileset>
|
---|
87 | <zipfileset dir="${basedir}/distribution/greenstone3/gs2build" prefix="gs2build"><include name="**/*"/></zipfileset>
|
---|
88 | <zipfileset dir="${basedir}/distribution/greenstone3/lib" prefix="lib"><include name="**/*"/></zipfileset>
|
---|
89 | <zipfileset dir="${basedir}/distribution/greenstone3/web" prefix="web"><include name="**/*"/></zipfileset>
|
---|
90 | <zipfileset dir="${basedir}/distribution/greenstone3/packages" prefix="packages"><include name="**/*"/></zipfileset>
|
---|
91 | <zipfileset dir="${basedir}/distribution/greenstone3/resources" prefix="resources"><include name="**/*"/></zipfileset>
|
---|
92 | <zipfileset dir="${basedir}/distribution/greenstone3/src" prefix="src"><include name="**/*"/></zipfileset>
|
---|
93 |
|
---|
94 | </installer>
|
---|
95 |
|
---|
96 | <!-- delete the 'bundled java only' lines from the installer config -->
|
---|
97 | <rsr file="${basedir}/installer/antinstall-config.xml" pattern=".*<!-- bundled java only -->" replacement=""/>
|
---|
98 |
|
---|
99 | <installer file="${basedir}/installer/greenstone3.jar"
|
---|
100 | compress="true"
|
---|
101 | extractType="NonExtractor"
|
---|
102 | installConfig="${basedir}/installer/antinstall-config.xml"
|
---|
103 | buildFile="${basedir}/installer/build.xml"
|
---|
104 | antInstallLib="${lirk3.home}/bin/ant-installer/lib"
|
---|
105 | antLib="${lirk3.home}/bin/ant-installer/antlib"
|
---|
106 | validateConfig="true"
|
---|
107 | icons="bluecurve">
|
---|
108 |
|
---|
109 | <zipfileset dir="${basedir}/installer/cp" includes="resources/*"/>
|
---|
110 | <zipfileset dir="${lirk3.home}/ant-scripts/tasks/orans"><include name="RegexSearchReplace.class"/></zipfileset>
|
---|
111 |
|
---|
112 | <zipfileset dir="${basedir}/distribution/greenstone3" includes="*"/>
|
---|
113 | <zipfileset dir="${basedir}/distribution/greenstone3/bin" prefix="bin"><include name="**/*"/></zipfileset>
|
---|
114 | <zipfileset dir="${basedir}/distribution/greenstone3/docs" prefix="docs"><include name="**/*"/></zipfileset>
|
---|
115 | <zipfileset dir="${basedir}/distribution/greenstone3/gli" prefix="gli"><include name="**/*"/></zipfileset>
|
---|
116 | <zipfileset dir="${basedir}/distribution/greenstone3/gs2build" prefix="gs2build"><include name="**/*"/></zipfileset>
|
---|
117 | <zipfileset dir="${basedir}/distribution/greenstone3/lib" prefix="lib"><include name="**/*"/></zipfileset>
|
---|
118 | <zipfileset dir="${basedir}/distribution/greenstone3/web" prefix="web"><include name="**/*"/></zipfileset>
|
---|
119 | <zipfileset dir="${basedir}/distribution/greenstone3/packages" prefix="packages"><include name="**/*"/></zipfileset>
|
---|
120 | <zipfileset dir="${basedir}/distribution/greenstone3/resources" prefix="resources"><include name="**/*"/></zipfileset>
|
---|
121 | <zipfileset dir="${basedir}/distribution/greenstone3/src" prefix="src"><include name="**/*"/></zipfileset>
|
---|
122 | </installer>
|
---|
123 | </if>
|
---|
124 | </target>
|
---|
125 |
|
---|
126 | <target name="clean-up-after-installer-creation">
|
---|
127 | <if><bool><istrue value="${execute}"/></bool>
|
---|
128 | <delete file="${basedir}/installer/antinstall-config.xml"/>
|
---|
129 | <delete file="${basedir}/installer/build.xml"/>
|
---|
130 | </if>
|
---|
131 | </target>
|
---|
132 |
|
---|
133 |
|
---|
134 | </project>
|
---|