root/release-kits/lirk2/ant-scripts/create-distribution.xml @ 17898

Revision 17898, 5.8 KB (checked in by oranfry, 11 years ago)

Standardised names of directories used in release kits

  • gsdl and greenstone3 -> compiled
  • distribution and distributions -> distributions
  • greenstone3 and web -> web

And, expect more specifically named properties files, e.g., lirk3-build.properties, wirk2-build.properties

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