root/release-kits/wirk2/ant-scripts/create-distribution.xml @ 17882

Revision 17882, 7.6 KB (checked in by max, 11 years ago)

Adding LuceneWrapper? and unzipping some packages for GS2

Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="wirk2-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="insert-uninstaller"><param name="script-format" value="bat"/></antcall> <!-- from rk2-targets -->
12        <antcall target="remove-unneeded-files-1" />
13        <antcall target="dist-unzip-packages"/>
14       
15        <antcall target="copy-web-to-source" /> <!-- from init -->
16   
17        <antcall target="drop-in-binaries" />
18        <antcall target="drop-in-demo-collection" />
19        <antcall target="drop-in-misc" />
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="dist-set-version">
35        <echo level="info">Setting version in src/lib/gsdlconf.h</echo>
36        <rsr file="${basedir}/distributions/web/common-src/src/lib/gsdlconf.h" pattern="(#define GSDL_VERSION) &quot;.*&quot;" replacement="$1 &quot;${version}&quot;" />
37        <echo level="info">Setting version in etc/VERSION</echo>
38        <rsr file="${basedir}/distributions/web/etc/VERSION" pattern="(gsdl version: ).*" replacement="$1${version}" />
39    </target>
40   
41    <target name="drop-in-binaries">
42        <echo level="info">Dropping compiled binaries into distribution</echo>
43        <delete dir="${basedir}/distributions/web/bin/windows" />
44        <copy todir="${basedir}/distributions/web/bin/windows">
45            <fileset dir="${basedir}/gsdl/bin/windows" includes="**/*"/>
46        </copy>
47        <copy todir="${basedir}/distributions/web" file="${basedir}/gsdl/bin/windows/server.exe"/>
48       
49        <echo level="info">Dropping LuceneWrapper.jar in place</echo>
50        <copy file="${basedir}/gsdl/bin/java/LuceneWrapper.jar" todir="${basedir}/distributions/web/bin/java" />
51    </target>
52
53    <target name="drop-in-demo-collection">
54        <echo level="info">Dropping rebuilt demo collection into distribution</echo>
55        <delete dir="${basedir}/distributions/web/collect/demo" />
56        <copy todir="${basedir}/distributions/web/collect/demo">
57            <fileset dir="${basedir}/gsdl/collect/demo" includes="**/*"/>
58        </copy>
59    </target>
60
61    <target name="drop-in-docs">
62        <echo level="info">Dropping gsdl docs  into distribution</echo>
63        <copy todir="${basedir}/distributions/web" overwrite="true">
64            <fileset dir="${wirk2.home}/greenstone2/docs"/>
65        </copy>
66    </target>
67
68    <target name="drop-in-misc">
69        <echo level="info">Putting the default gsdlsite.cfg at the root of the distribution</echo>
70        <copy todir="${basedir}/distributions/web" file="${wirk2.home}/resources/gsdlsite.cfg" overwrite="true"/>
71    </target>
72   
73    <target name="compile-gli">
74        <echo>Compiling gli...</echo>
75        <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makegli.bat"/>
76       
77        <echo>Creating jar...</echo>
78        <exec dir="${basedir}/distributions/web/gli" executable="${basedir}/distributions/web/gli/makejar.bat"/>
79       
80        <echo>Cleaning up intermediate files...</echo>
81        <delete dir="${basedir}/distributions/web/gli/jar"/>
82        <delete dir="${basedir}/distributions/web/gli/classes/org"/>
83       
84        <echo>Putting gli server jar in a better place</echo>
85        <move file="${basedir}/distributions/web/gli/GLIServer.jar" todir="${basedir}/distributions/web/bin/java" />
86    </target>
87
88    <target name="tweak-files">
89        <echo level="info">Changing date and version in the docs</echo>
90        <!-- ar -->
91        <rsr file="${basedir}/distributions/web/READMEar.txt" pattern="(التاريخ : \s*)(.*)" replacement="$1${month.ar} ${current.year}" />
92        <rsr file="${basedir}/distributions/web/READMEar.txt" pattern="(النسخه : \s*)(.*)" replacement="$1${version}" />
93        <!-- es -->
94        <rsr file="${basedir}/distributions/web/READMEes.txt" pattern="^(Fecha\s*)(.*)" replacement="$1${month.es} de ${current.year}" />
95        <rsr file="${basedir}/distributions/web/READMEes.txt" pattern="^(Versi.?n\s*)(.*)" replacement="$1${version}" />
96        <!-- fr -->
97        <rsr file="${basedir}/distributions/web/READMEfr.txt" pattern="^(Date\s*)(.*)" replacement="$1${month.fr} ${current.year}" />
98        <rsr file="${basedir}/distributions/web/READMEfr.txt" pattern="^(Version\s*)(.*)" replacement="$1${version}" />
99        <!-- ru -->
100        <rsr file="${basedir}/distributions/web/READMEru.txt" pattern="^(Дата\s*)(.*)" replacement="$1${month.ru} ${current.year}" />
101        <rsr file="${basedir}/distributions/web/READMEru.txt" pattern="^(ВерсОя\s*)(.*)" replacement="$1${version}" />
102        <!-- en -->
103        <rsr file="${basedir}/distributions/web/READMEen.txt" pattern="^(Date\s*)(.*)" replacement="$1${month.default} ${current.year}" />
104        <rsr file="${basedir}/distributions/web/READMEen.txt" pattern="^(Version\s*)(.*)" replacement="$1${version}" />
105
106        <!-- Support.htm -->
107        <rsr file="${basedir}/distributions/web/Support.htm" pattern="^(\s*Greenstone Digital Library version: ).*(&lt;br&gt;.*)" replacement="$1${version}$2"/>
108        <rsr file="${basedir}/distributions/web/Support.htm" pattern="^(\s*&lt;input.* name=&quot;gsdl version&quot;.* value=&quot;).*(&quot;.*&gt;)" replacement="$1${version}$2"/>
109
110    </target>
111
112    <target name="remove-unneeded-files-1">
113        <delete file="${basedir}/distributions/web/gli/.greenstonestore" />
114        <!-- delete non-windows source stuff -->
115        <delete><fileset dir="${basedir}/distributions/web" includes="*.bash,*.sh,*.csh,install-sh,configure,configure.in,config.sub,config.guess,config.h.in,configtest.pl,Makefile.in,aclocal.m4,acconfig.h,micotest.cpp"/></delete>
116    </target>
117
118    <target name="remove-unneeded-files-2">
119        <delete dir="${basedir}/distributions/web/bin/linux" />
120        <delete><fileset dir="${basedir}/distributions/web" includes="*.bash,*.sh,*.csh,install-sh,configure,configure.in,config.sub,config.guess,config.h.in,configtest.pl,Makefile.in,aclocal.m4,acconfig.h,micotest.cpp,win32.mak,WIN32cfg.h,Install.txt"/></delete>
121        <delete><fileset dir="${basedir}/distributions/web/gli" includes="*.sh,*4gs3.bat"/></delete>
122        <delete file="${basedir}/distributions/web/bin/java/SignedGatherer.jar" />
123    </target>   
124
125    <target name="dist-unzip-packages">
126        <unzip src="${basedir}/distributions/web/common-src/indexers/packages/windows/iconv/iconv.zip" dest="${basedir}/distributions/web/common-src/indexers/packages/windows/iconv"/>
127        <delete file="${basedir}/distributions/web/common-src/indexers/packages/windows/iconv/iconv.zip"/>
128       
129        <unzip src="${basedir}/distributions/web/common-src/packages/windows/crypt/crypt.zip" dest="${basedir}/distributions/web/common-src/packages/windows/crypt"/>
130        <delete file="${basedir}/distributions/web/common-src/packages/windows/crypt/crypt.zip"/>
131       
132        <unzip src="${basedir}/distributions/web/common-src/packages/windows/expat/expat.zip" dest="${basedir}/distributions/web/common-src/packages/windows/expat"/>
133        <delete file="${basedir}/distributions/web/common-src/packages/windows/expat/expat.zip"/>
134       
135        <unzip src="${basedir}/distributions/web/common-src/packages/windows/gdbm/gdbm.zip" dest="${basedir}/distributions/web/common-src/packages/windows/gdbm"/>
136        <delete file="${basedir}/distributions/web/common-src/packages/windows/gdbm/gdbm.zip"/>
137       
138        <unzip src="${basedir}/distributions/web/common-src/packages/windows/stlport/stlport.zip" dest="${basedir}/distributions/web/common-src/packages/windows/stlport"/>
139        <delete file="${basedir}/distributions/web/common-src/packages/windows/stlport/stlport.zip"/>
140    </target>
141   
142</project>
Note: See TracBrowser for help on using the browser.