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

Revision 17786, 6.6 KB (checked in by oranfry, 11 years ago)

shifted the responsibility for the source release to the linux release kit. Made the source release contain a single component with the core and sourcecode mixed together

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