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

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