root/release-kits/mark2/ant-scripts/create-distribution.xml @ 17652

Revision 17652, 6.1 KB (checked in by oranfry, 11 years ago)

started source releases

Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="mark2-create-distribution" default="create-distribution">
3
4    <target name="create-distribution">
5
6        <antcall target="export-gsdl-gli" />
7        <antcall target="dist-set-version" />
8        <antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/distributions/web/gli"/></antcall>
9        <antcall target="drop-in-docs" />
10        <antcall target="tweak-files" />
11        <antcall target="remove-unneeded-files-1" />
12
13        <antcall target="copy-web-to-source" /> <!-- from init -->
14
15        <antcall target="drop-in-binaries" />
16        <antcall target="drop-in-demo-collection" />
17        <antcall target="insert-uninstaller"><param name="script-format" value="sh"/></antcall> <!-- from rk2-targets -->
18        <antcall target="insert-export-to-cd-package"/>     <!-- from rk2-targets -->
19        <antcall target="export-imagemagick-linux-binaries" />
20        <antcall target="compile-gli" />
21        <antcall target="remove-unneeded-files-2" />
22
23    </target>
24
25    <target name="export-gsdl-gli">
26        <mkdir dir="distributions"/>
27        <delete dir="distributions/web"/>
28        <svn javahl="false">
29            <export srcurl="${svn.root}/gsdl/${branch.path}" destPath="distributions/web"/>
30            <export srcurl="${svn.root}/gli/${branch.path}" destPath="distributions/web/gli"/>
31        </svn>
32        <copy todir="distributions/source"><fileset dir="distributions/web"/></copy>
33    </target>
34
35    <target name="dist-set-version">
36        <echo level="info">Setting version in common-src/src/lib/gsdlconf.h</echo>
37        <rsr file="${basedir}/distributions/web/common-src/src/lib/gsdlconf.h" pattern="(#define GSDL_VERSION) &quot;.*&quot;" replacement="$1 &quot;${version}&quot;" />
38
39        <echo level="info">Setting version in Install.sh</echo>
40        <rsr file="${basedir}/distributions/web/Install.sh" pattern="(echo &quot;Version: ).*(&quot; .*)" replacement="$1${version}$2" />
41
42        <echo level="info">Setting version in etc/VERSION</echo>
43        <rsr file="${basedir}/distributions/web/etc/VERSION" pattern="(gsdl version: ).*" replacement="$1${version}" />
44    </target>
45
46    <target name="dist-set-gli-version">
47
48    </target>
49
50    <target name="drop-in-binaries">
51        <echo level="info">Dropping compiled binaries into distribution</echo>
52        <delete dir="distributions/web/bin/linux" />
53        <delete dir="distributions/web/bin/darwin" />
54        <exec dir="${basedir}" executable="cp"><arg line="-r gsdl/bin/darwin distributions/web/bin"/></exec>
55        <exec dir="${basedir}" executable="cp"><arg line="gsdl/cgi-bin/library distributions/web/cgi-bin"/></exec>
56        <exec dir="${basedir}" executable="cp"><arg line="gsdl/cgi-bin/oaiserver distributions/web/cgi-bin"/></exec>
57    </target>
58
59    <target name="drop-in-demo-collection">
60        <echo level="info">Dropping rebuilt demo collection into distribution</echo>
61        <delete dir="distributions/web/collect/demo" />
62        <exec dir="${basedir}" executable="cp"><arg line="-r gsdl/collect/demo distributions/web/collect"/></exec>
63    </target>
64
65    <target name="drop-in-docs">
66        <echo level="info">Dropping gsdl docs  into distribution</echo>
67        <copy todir="${basedir}/distributions/web" overwrite="true">
68            <fileset dir="${mark2.home}/greenstone2/docs"/>
69        </copy>
70    </target>
71
72    <target name="compile-gli">
73        <echo>Compiling gli...</echo>
74        <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makegli.sh"/>
75
76        <echo>Creating jar...</echo>
77        <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makejar.sh"/>
78
79        <echo>Cleaning up intermediate files...</echo>
80        <delete dir="${basedir}/distributions/web/gli/jar"/>
81        <delete dir="${basedir}/distributions/web/gli/classes/org"/>
82
83        <echo>Putting gli server jar in a better place</echo>
84        <exec dir="${basedir}/distributions/web" executable="mv" failonerror="true">
85            <arg line="gli/GLIServer.jar bin/java" />
86        </exec>
87    </target>
88
89    <target name="tweak-files">
90        <echo level="info">Changing Install.sh to web release</echo>
91        <rsr file="${basedir}/distributions/web/Install.sh" pattern="^(iscdrom=).*" replacement="$1&quot;no&quot;" />
92
93        <echo level="info">Changing date and version in the docs</echo>
94        <!-- ar -->
95        <rsr file="${basedir}/distributions/web/READMEar.txt" pattern="(التاريخ : \s*)(.*)" replacement="$1${month.ar} ${current.year}" />
96        <rsr file="${basedir}/distributions/web/READMEar.txt" pattern="(النسخه : \s*)(.*)" replacement="$1${version}" />
97        <!-- es -->
98        <rsr file="${basedir}/distributions/web/READMEes.txt" pattern="^(Fecha\s*)(.*)" replacement="$1${month.es} de ${current.year}" />
99        <rsr file="${basedir}/distributions/web/READMEes.txt" pattern="^(Versi.?n\s*)(.*)" replacement="$1${version}" />
100        <!-- fr -->
101        <rsr file="${basedir}/distributions/web/READMEfr.txt" pattern="^(Date\s*)(.*)" replacement="$1${month.fr} ${current.year}" />
102        <rsr file="${basedir}/distributions/web/READMEfr.txt" pattern="^(Version\s*)(.*)" replacement="$1${version}" />
103        <!-- ru -->
104        <rsr file="${basedir}/distributions/web/READMEru.txt" pattern="^(Дата\s*)(.*)" replacement="$1${month.ru} ${current.year}" />
105        <rsr file="${basedir}/distributions/web/READMEru.txt" pattern="^(ВерсОя\s*)(.*)" replacement="$1${version}" />
106        <!-- en -->
107        <rsr file="${basedir}/distributions/web/READMEen.txt" pattern="^(Date\s*)(.*)" replacement="$1${month.default} ${current.year}" />
108        <rsr file="${basedir}/distributions/web/READMEen.txt" pattern="^(Version\s*)(.*)" replacement="$1${version}" />
109
110        <!-- Support.htm -->
111        <rsr file="${basedir}/distributions/web/Support.htm" pattern="^(\s*Greenstone Digital Library version: ).*(&lt;br&gt;.*)" replacement="$1${version}$2"/>
112        <rsr file="${basedir}/distributions/web/Support.htm" pattern="^(\s*&lt;input.* name=&quot;gsdl version&quot;.* value=&quot;).*(&quot;.*&gt;)" replacement="$1${version}$2"/>
113
114    </target>
115
116    <target name="remove-unneeded-files-1">
117        <delete file="${basedir}/distributions/web/gli/.greenstonestore" />
118        <delete><fileset dir="${basedir}/distributions/web/gli" includes="*.bat"/></delete>
119        <delete><fileset dir="${basedir}/distributions/web" includes="*.bat"/></delete>
120        <delete dir="${basedir}/distributions/web/common-src/packages/windows"/>
121    </target>
122
123    <target name="remove-unneeded-files-2">
124        <delete file="${basedir}/distributions/web/bin/java/SignedGatherer.jar" />
125    </target>
126
127
128</project>
Note: See TracBrowser for help on using the browser.