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

Revision 17661, 6.7 KB (checked in by oranfry, 11 years ago)

imagemagick package for greenstone2 on mac

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