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

Revision 18008, 5.2 KB (checked in by oranfry, 12 years ago)

little fixes to catch every file

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"><param name="dest" value="distributions/web"/></antcall>
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"><param name="gsdl.basedir" value="distributions/web"/></antcall> <!-- from rk2-targets -->
14        <antcall target="drop-in-binaries" />
15        <antcall target="export-imagemagick-linux-binaries" />
16        <antcall target="compile-gli" />
17        <antcall target="remove-unneeded-files" />
18
19        <antcall target="create-binary-zip-linux"/>
20
21    </target>
22
23    <target name="tweak-files">
24        <echo level="info">Changing Install.sh to web release</echo>
25        <rsr file="${basedir}/distributions/web/Install.sh" pattern="^(iscdrom=).*" replacement="$1&quot;no&quot;" />
26
27        <echo level="info">Changing date and version in the docs</echo>
28        <!-- ar -->
29        <rsr file="${basedir}/distributions/web/READMEar.txt" pattern="(التاريخ : \s*)(.*)" replacement="$1${month.ar} ${current.year}" />
30        <rsr file="${basedir}/distributions/web/READMEar.txt" pattern="(النسخه : \s*)(.*)" replacement="$1${version}" />
31
32        <!-- es -->
33        <rsr file="${basedir}/distributions/web/READMEes.txt" pattern="^(Fecha\s*)(.*)" replacement="$1${month.es} de ${current.year}" />
34        <rsr file="${basedir}/distributions/web/READMEes.txt" pattern="^(Versi.?n\s*)(.*)" replacement="$1${version}" />
35        <!-- fr -->
36        <rsr file="${basedir}/distributions/web/READMEfr.txt" pattern="^(Date\s*)(.*)" replacement="$1${month.fr} ${current.year}" />
37        <rsr file="${basedir}/distributions/web/READMEfr.txt" pattern="^(Version\s*)(.*)" replacement="$1${version}" />
38        <!-- ru -->
39        <rsr file="${basedir}/distributions/web/READMEru.txt" pattern="^(Дата\s*)(.*)" replacement="$1${month.ru} ${current.year}" />
40        <rsr file="${basedir}/distributions/web/READMEru.txt" pattern="^(ВерсОя\s*)(.*)" replacement="$1${version}" />
41        <!-- en -->
42        <rsr file="${basedir}/distributions/web/READMEen.txt" pattern="^(Date\s*)(.*)" replacement="$1${month.default} ${current.year}" />
43        <rsr file="${basedir}/distributions/web/READMEen.txt" pattern="^(Version\s*)(.*)" replacement="$1${version}" />
44
45    </target>
46
47
48    <target name="drop-in-docs">
49        <echo level="info">Dropping gsdl docs  into distribution</echo>
50        <copy todir="${basedir}/distributions/web" overwrite="true">
51            <fileset dir="${lirk2.home}/greenstone2/docs"/>
52        </copy>
53    </target>
54
55    <target name="drop-in-binaries">
56        <echo level="info">Dropping compiled binaries into distribution</echo>
57        <delete dir="distributions/web/bin/linux" />
58        <exec dir="${basedir}" executable="cp"><arg line="-r compiled/bin/linux distributions/web/bin"/></exec>
59        <exec dir="${basedir}" executable="cp"><arg line="compiled/cgi-bin/library distributions/web/cgi-bin"/></exec>
60        <exec dir="${basedir}" executable="cp"><arg line="compiled/cgi-bin/oaiserver distributions/web/cgi-bin"/></exec>
61        <copy file="${basedir}/compiled/bin/java/LuceneWrapper.jar" todir="${basedir}/distributions/web/bin/java" />
62    </target>
63
64    <target name="drop-in-demo-collection">
65        <echo level="info">Dropping rebuilt demo collection into distribution</echo>
66        <delete dir="distributions/web/collect/demo" />
67        <exec dir="${basedir}" executable="cp"><arg line="-r compiled/collect/demo distributions/web/collect"/></exec>
68    </target>
69
70    <target name="export-imagemagick-linux-binaries">
71        <delete dir="distributions/web/bin/linux/imagemagick"/>
72        <svn>
73            <export srcurl="${svn.root}/other-projects/trunk/linux-binaries/imagemagick" destPath="distributions/web/bin/linux/imagemagick"/>
74        </svn>
75    </target>
76
77    <target name="compile-gli">
78        <echo>Compiling gli...</echo>
79        <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makegli.sh"/>
80
81        <echo>Creating jar...</echo>
82        <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makejar.sh"/>
83
84        <echo>Cleaning up intermediate files...</echo>
85        <delete dir="${basedir}/distributions/web/gli/jar"/>
86        <delete dir="${basedir}/distributions/web/gli/classes/org"/>
87
88        <echo>Putting gli server jar in a better place</echo>
89        <exec dir="${basedir}/distributions/web" executable="mv" failonerror="true">
90            <arg line="gli/GLIServer.jar bin/java" />
91        </exec>
92    </target>
93
94    <target name="remove-unneeded-files">
95        <delete file="${basedir}/distributions/web/gli/.greenstonestore" />
96        <delete><fileset dir="${basedir}/distributions/web" includes="win32.mak,win32cfg.h,Install.sh"/></delete>
97        <delete file="${basedir}/distributions/web/bin/java/SignedGatherer.jar" />
98        <delete><fileset dir="${basedir}/distributions/web/gli" includes="*.bat"/></delete>
99        <delete><fileset dir="${basedir}/distributions/web" includes="*.bat"/></delete>
100        <delete dir="${basedir}/distributions/web/common-src/packages/windows"/>
101    </target>
102
103</project>
Note: See TracBrowser for help on using the browser.