source: release-kits/lirk2/ant-scripts/create-distribution.xml@ 16459

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

changing target name

File size: 6.9 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="lirk2-create-distribution" default="create-distribution">
3
4
5 <target name="create-distribution">
6 <addressedcall target="export-gsdl-gli" />
7 <addressedcall target="dist-set-version" />
8 <addressedcall target="dist-set-gli-version" />
9 <addressedcall target="drop-in-binaries" />
10 <addressedcall target="drop-in-demo-collection" />
11 <addressedcall target="drop-in-docs" />
12 <addressedcall target="compile-gli" />
13 <addressedcall target="create-gli-client-zip" />
14 <addressedcall target="tweak-files" />
15
16 </target>
17
18 <target name="export-gsdl-gli">
19 <if><bool><istrue value="${execute}"/></bool>
20
21 <mkdir dir="distributions"/>
22 <delete dir="distributions/web"/>
23 <svn>
24 <export srcurl="${svn.root}/gsdl/${branch.path}" destPath="distributions/web"/>
25 <export srcurl="${svn.root}/gli/${branch.path}" destPath="distributions/web/gli"/>
26 </svn>
27
28 </if>
29 </target>
30
31 <target name="dist-set-version">
32 <if><bool><istrue value="${execute}"/></bool>
33
34 <echo level="info">Setting version in src/lib/gsdlconf.h</echo>
35 <rsr file="${basedir}/distributions/web/src/lib/gsdlconf.h" pattern="(#define GSDL_VERSION) &quot;.*&quot;" replacement="$1 &quot;${version}&quot;" />
36
37 <echo level="info">Setting version in Install.sh</echo>
38 <rsr file="${basedir}/distributions/web/Install.sh" pattern="(echo &quot;Version: ).*(&quot; .*)" replacement="$1${version}$2" />
39
40 <echo level="info">Setting version in etc/VERSION</echo>
41 <rsr file="${basedir}/distributions/web/etc/VERSION" pattern="(gsdl version: ).*" replacement="$1${version}" />
42
43 </if>
44 </target>
45
46 <target name="dist-set-gli-version">
47 <if><bool><istrue value="${execute}"/></bool>
48 <ant antfile="${lirk2.home}/ant-scripts/shared-ant-scripts/operations-on-gli.xml" dir="${basedir}/distributions/web/gli" target="set-version-numbers"/>
49 </if>
50 </target>
51
52 <target name="drop-in-binaries">
53 <if><bool><istrue value="${execute}"/></bool>
54 <echo level="info">Dropping compiled binaries into distribution</echo>
55 <delete dir="distributions/web/bin/linux" />
56 <exec dir="${basedir}" executable="cp"><arg line="-r gsdl/bin/linux distributions/web/bin"/></exec>
57 <exec dir="${basedir}" executable="cp"><arg line="gsdl/cgi-bin/library distributions/web/cgi-bin"/></exec>
58 <exec dir="${basedir}" executable="cp"><arg line="gsdl/cgi-bin/oaiserver distributions/web/cgi-bin"/></exec>
59 </if>
60 </target>
61
62 <target name="drop-in-demo-collection">
63 <if><bool><istrue value="${execute}"/></bool>
64 <echo level="info">Dropping rebuilt demo collection into distribution</echo>
65 <delete dir="distributions/web/collect/demo" />
66 <exec dir="${basedir}" executable="cp"><arg line="-r gsdl/collect/demo distributions/web/collect"/></exec>
67 </if>
68 </target>
69
70 <target name="drop-in-docs">
71 <if><bool><istrue value="${execute}"/></bool>
72 <echo level="info">Dropping gsdl docs into distribution</echo>
73 <copy todir="${basedir}/distributions/web" overwrite="true">
74 <fileset dir="${lirk2.home}/greenstone2/docs"/>
75 </copy>
76 </if>
77 </target>
78
79 <target name="compile-gli">
80 <if><bool><istrue value="${execute}"/></bool>
81
82 <echo>Compiling gli...</echo>
83 <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makegli.sh"/>
84
85 <echo>Creating jar...</echo>
86 <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makejar.sh"/>
87
88 <echo>Cleaning up intermediate files...</echo>
89 <delete dir="${basedir}/distributions/web/gli/jar"/>
90 <delete dir="${basedir}/distributions/web/gli/classes/org"/>
91
92 <echo>Putting gli server jar in a better place</echo>
93 <exec dir="${basedir}/distributions/web" executable="mv" failonerror="true">
94 <arg line="gli/GLIServer.jar bin/java" />
95 </exec>
96
97 </if>
98 </target>
99
100 <target name="create-gli-client-zip">
101 <if><bool><istrue value="${execute}"/></bool>
102 <!--
103 # take a copy of GLI directory
104 &util::cp_r(&util::filename_cat($tmpdir, "gsdl", "gli"), $tmpdir);
105
106 my $client_dirname = "gli-client-" . $version_num;
107 rename ("gli", $client_dirname);
108 chdir(&util::filename_cat($tmpdir, $client_dirname));
109
110
111 # delete unnecessary stuff
112 `rm -rf clean.* document.* gems.* gli*.sh gli*.bat make*.sh make*.bat lib src`;
113 # make sure permissions are ok
114 `chmod a+x client-gli.sh client-gli.bat`;
115 chdir($tmpdir);
116
117 # zip up the client
118 &zip($client_dirname, $client_dirname, $tmpdir, 1);
119 -->
120 </if>
121 </target>
122
123
124 <target name="tweak-files">
125 <if><bool><istrue value="${execute}"/></bool>
126
127 <echo level="info">Changing Install.sh to web release</echo>
128 <rsr file="${basedir}/distributions/web/Install.sh" pattern="^(iscdrom=).*" replacement="$1&quot;no&quot;" />
129
130
131 <echo level="info">Changing date and version in the docs</echo>
132 <!-- ar -->
133 <rsr file="${basedir}/distributions/web/READMEar.txt" pattern="(التاريخ : \s*)(.*)" replacement="$1${month.ar} ${current.year}" />
134 <rsr file="${basedir}/distributions/web/READMEar.txt" pattern="(النسخه : \s*)(.*)" replacement="$1${version}" />
135
136 <!-- es -->
137 <rsr file="${basedir}/distributions/web/READMEes.txt" pattern="^(Fecha\s*)(.*)" replacement="$1${month.es} de ${current.year}" />
138 <rsr file="${basedir}/distributions/web/READMEes.txt" pattern="^(Versi.?n\s*)(.*)" replacement="$1${version}" />
139 <!-- fr -->
140 <rsr file="${basedir}/distributions/web/READMEfr.txt" pattern="^(Date\s*)(.*)" replacement="$1${month.fr} ${current.year}" />
141 <rsr file="${basedir}/distributions/web/READMEfr.txt" pattern="^(Version\s*)(.*)" replacement="$1${version}" />
142 <!-- ru -->
143 <rsr file="${basedir}/distributions/web/READMEru.txt" pattern="^(Дата\s*)(.*)" replacement="$1${month.ru} ${current.year}" />
144 <rsr file="${basedir}/distributions/web/READMEru.txt" pattern="^(ВерсОя\s*)(.*)" replacement="$1${version}" />
145 <!-- en -->
146 <rsr file="${basedir}/distributions/web/READMEen.txt" pattern="^(Date\s*)(.*)" replacement="$1${month.default} ${current.year}" />
147 <rsr file="${basedir}/distributions/web/READMEen.txt" pattern="^(Version\s*)(.*)" replacement="$1${version}" />
148
149 <!-- Support.htm -->
150 <rsr file="${basedir}/distributions/web/Support.htm" pattern="^(\s*Greenstone Digital Library version: ).*(&lt;br&gt;.*)" replacement="$1${version}$2"/>
151 <rsr file="${basedir}/distributions/web/Support.htm" pattern="^(\s*&lt;input.* name=&quot;gsdl version&quot;.* value=&quot;).*(&quot;.*&gt;)" replacement="$1${version}$2"/>
152
153 <echo level="info">Removing signed gatherer</echo>
154 <delete file="${basedir}/distributions/web/bin/java/SignedGatherer.jar" />
155
156 <echo level="info">Removing some unneeded stuff</echo>
157 <delete file="${basedir}/distributions/web/gli/.greenstonestore" />
158 <delete file="${basedir}/distributions/web/gli/gli4gs3.sh" />
159 <delete><fileset dir="${basedir}/distributions/web/gli" includes="*.bat"/></delete>
160 <delete><fileset dir="${basedir}/distributions/web" includes="*.bat"/></delete>
161
162 </if>
163 </target>
164
165</project>
Note: See TracBrowser for help on using the repository browser.