root/release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml @ 18774

Revision 18774, 5.4 KB (checked in by oranfry, 11 years ago)

protect from a needless error while changing dates in readmes

Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<!--
3        ..........................................................
4        August 2008
5        Targets for Greenstone2 release kits
6        Oran Fry
7        ..........................................................
8-->
9
10<project name="rk2-targets">
11
12    <property name="version.major" value="2"/>
13
14    <target name="export-gsdl-gli">
15        <delete dir="${dest}"/>
16        <svn>
17            <export srcurl="${svn.root}/gsdl/${branch.path}" destPath="${dest}"/>
18            <export srcurl="${svn.root}/gli/${branch.path}" destPath="${dest}/gli"/>
19        </svn>
20    </target>
21
22    <target name="drop-in-docs">
23        <echo level="info">Dropping gsdl docs into distribution</echo>
24        <copy todir="${gsdl.basedir}" overwrite="true">
25            <fileset dir="${rk.home}/greenstone2/docs"/>
26        </copy>
27    </target>
28
29    <target name="gsdl-set-version-numbers">
30
31        <echo level="info">Setting version in common-src/src/lib/gsdlconf.h</echo>
32        <rsr file="${gsdl.basedir}/common-src/src/lib/gsdlconf.h" pattern="(#define GSDL_VERSION) &quot;.*&quot;" replacement="$1 &quot;${version}&quot;" />
33
34        <echo level="info">Setting version in Install.sh</echo>
35        <rsr file="${gsdl.basedir}/Install.sh" pattern="(echo &quot;Version: ).*(&quot; .*)" replacement="$1${version}$2" />
36
37        <echo level="info">Setting version in etc/VERSION</echo>
38        <rsr file="${gsdl.basedir}/etc/VERSION" pattern="(gsdl version: ).*" replacement="$1${version}" />
39
40        <antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${gsdl.basedir}"/></antcall>
41
42    </target>
43
44    <target name="gsdl-set-dates-in-readmes">
45        <echo level="info">Changing date and version in the docs</echo>
46
47        <!-- en -->
48        <if><bool><available file="${gsdl.basedir}/READMEen.txt"/></bool>
49            <rsr file="${gsdl.basedir}/READMEen.txt">
50                <job pattern="^(Date\s*)(.*)" replacement="$1${month.default} ${current.year}" />
51                <job pattern="^(Version\s*)(.*)" replacement="$1${version}" />
52            </rsr>
53        </if>
54
55        <!-- ar -->
56        <if><bool><available file="${gsdl.basedir}/READMEar.txt"/></bool>
57            <rsr file="${gsdl.basedir}/READMEar.txt">
58                <job pattern="(التاريخ : \s*)(.*)" replacement="$1${month.ar} ${current.year}"/>
59                <job pattern="(النسخه : \s*)(.*)" replacement="$1${version}"/>
60            </rsr>
61        </if>
62
63        <!-- es -->
64        <if><bool><available file="${gsdl.basedir}/READMEes.txt"/></bool>
65            <rsr file="${gsdl.basedir}/READMEes.txt">
66                <job pattern="^(Fecha\s*)(.*)" replacement="$1${month.es} de ${current.year}"/>
67                <job pattern="^(Versi.?n\s*)(.*)" replacement="$1${version}"/>
68            </rsr>
69        </if>
70
71        <!-- fr -->
72        <if><bool><available file="${gsdl.basedir}/READMEfr.txt"/></bool>
73            <rsr file="${gsdl.basedir}/READMEfr.txt">
74                <job pattern="^(Date\s*)(.*)" replacement="$1${month.fr} ${current.year}"/>
75                <job pattern="^(Version\s*)(.*)" replacement="$1${version}"/>
76            </rsr>
77        </if>
78
79        <!-- ru -->
80        <if><bool><available file="${gsdl.basedir}/READMEru.txt"/></bool>
81            <rsr file="${gsdl.basedir}/READMEru.txt">
82                <job pattern="^(Дата\s*)(.*)" replacement="$1${month.ru} ${current.year}"/>
83                <job pattern="^(ВерсОя\s*)(.*)" replacement="$1${version}"/>
84            </rsr>
85        </if>
86
87    </target>
88
89
90    <target name="insert-export-to-cd-package">
91        <mkdir dir="${gsdl.basedir}/bin/windows"/>
92        <get src="http://greenstone.org/release-snapshots/server.exe" dest="${gsdl.basedir}/bin/windows/server.exe"/>
93        <get src="http://svn.greenstone.org/other-projects/trunk/winbin/bin/Setup.exe" dest="${gsdl.basedir}/bin/windows/Setup.exe"/>
94        <get src="http://svn.greenstone.org/other-projects/trunk/winbin/bin/gssetup.exe" dest="${gsdl.basedir}/bin/windows/gssetup.exe"/>
95    </target>
96
97    <target name="create-binary-zip-linux">
98        <property name="binzip.dir" value="distributions/Greenstone-${version}-${os.suffix}-binary"/>
99        <exec dir="${basedir}" executable="cp"><arg line="-r distributions/web ${binzip.dir}"/></exec>
100        <exec dir="${basedir}" executable="cp"><arg line="${binzip.dir}/bin/${shell.os}/library distributions/Greenstone-${version}-${os.suffix}-binary/cgi-bin"/></exec>
101        <exec dir="${basedir}" executable="cp"><arg line="${binzip.dir}/bin/${shell.os}/oaiserver distributions/Greenstone-${version}-${os.suffix}-binary/cgi-bin"/></exec>
102
103        <!-- delete sourcecode -->
104        <delete dir="${binzip.dir}/common-src"/>
105        <delete dir="${binzip.dir}/build-src"/>
106        <delete dir="${binzip.dir}/runtime-src"/>
107
108        <!-- delete loose files -->
109        <delete>
110            <fileset
111                dir="${binzip.dir}"
112                includes="README*.txt,Uninstall.sh,uninst.jar,acconfig.h,aclocal.m4,config.guess,config.sub,configtest.pl,configure,configure.in,install-sh,Makefile.in,micotest.cpp,config.h.in"
113                excludes="READMEen.txt"/>
114        </delete>
115
116    </target>
117
118    <target name="create-binary-zip-windows">
119        <property name="binzip.dir" value="distributions/Greenstone-${version}-${os.suffix}-binary"/>
120        <copy todir="${binzip.dir}">
121            <fileset dir="distributions/web"/>
122        </copy>
123        <copy todir="${binzip.dir}/cgi-bin">
124            <fileset dir="${binzip.dir}/bin/${shell.os}" includes="library.exe,oaiserver.exe"/>
125        </copy>
126
127        <!-- delete sourcecode -->
128        <delete dir="${binzip.dir}/common-src"/>
129        <delete dir="${binzip.dir}/build-src"/>
130        <delete dir="${binzip.dir}/runtime-src"/>
131
132        <!-- delete loose files -->
133        <delete>
134            <fileset dir="${binzip.dir}" includes="README*.txt,Uninstall.bat,Uninst.bat,uninst.jar,win32.mak,win32cfg.h,makegs2.bat" excludes="READMEen.txt"/>
135        </delete>
136    </target>
137
138    <target name="create-needed-empty-files">
139        <mkdir dir="${gsdl.basedir}/tmp"/>
140        <chmod dir="${gsdl.basedir}/tmp" perm="a+rwx"/>
141        <echo file="${gsdl.basedir}/etc/usage.txt"></echo>
142    </target>
143
144</project>
145   
Note: See TracBrowser for help on using the browser.