source: release-kits/mark2/ant-scripts/create-distribution.xml@ 17457

Last change on this file since 17457 was 17457, checked in by oranfry, 13 years ago

put Uninstall.sh into the releases now

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