root/release-kits/mark2/ant-scripts/create-components.xml @ 18008

Revision 18008, 5.1 KB (checked in by oranfry, 12 years ago)

little fixes to catch every file

Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="mark2-create-components" default="create-components">
3
4    <!-- create components from the distribution folder -->
5
6    <!-- 1st level -->
7    <target name="create-components">
8        <antcall target="prepare-components" />
9        <antcall target="compress-components" />
10    </target>
11
12    <!-- 2nd level -->
13    <target name="prepare-components">
14        <antcall target="prepare-core-component" />
15        <antcall target="prepare-imagemagick-component" />
16        <antcall target="prepare-ghostscript-component" />
17
18        <antcall target="prepare-sourcecode-component" />
19
20    </target>
21   
22    <target name="compress-components">
23        <antcall target="compress-core-component" />
24        <antcall target="compress-imagemagick-component" />
25        <antcall target="compress-ghostscript-component" />
26
27        <antcall target="compress-zipped-binary-release" /> <!-- from init -->
28    </target>
29
30    <!-- 3rd level -->
31    <target name="create-core-component">
32        <antcall target="prepare-core-component" />
33        <antcall target="compress-core-component" />
34    </target>
35
36    <target name="create-sourcecode-component">
37        <antcall target="prepare-sourcecode-component" />
38        <antcall target="compress-sourcecode-component" /> 
39    </target>
40   
41    <!-- core -->
42    <target name="prepare-core-component">
43
44        <delete dir="components/tmp/core"/>
45        <mkdir dir="components/tmp/core"/>
46
47        <copy todir="components/tmp/core" overwrite="true">
48            <fileset dir="distributions/web">
49                <include name="**/*"/>
50
51                <!-- exclude sourcecode + imagemagick + build files -->
52                <exclude name="common-src"/>
53                <exclude name="common-src/**/*"/>
54                <exclude name="runtime-src"/>
55                <exclude name="runtime-src/**/*"/>
56                <exclude name="build-src"/>
57                <exclude name="build-src/**/*"/>
58                <exclude name="bin/darwin/imagemagick"/>
59                <exclude name="bin/darwin/imagemagick/**/*"/>
60                <exclude name="bin/darwin/ghostscript"/>
61                <exclude name="bin/darwin/ghostscript/**/*"/>
62
63                <exclude name="acconfig.h"/>
64                <exclude name="aclocal.m4"/>
65                <exclude name="config.sub"/>
66                <exclude name="configtest.pl"/>
67                <exclude name="configure"/>
68                <exclude name="configure.in"/>
69                <exclude name="install-sh"/>
70                <exclude name="Makefile.in"/>
71                <exclude name="micotest.cpp"/>
72                <exclude name="config.h.in"/>
73
74                <exclude name="README*.txt"/>
75                <include name="READMEen.txt"/>
76
77
78            </fileset>
79        </copy>
80        <zip destfile="components/core.comp" basedir="components/tmp/core" compress="false" includes="**/*"/>
81    </target>
82   
83    <target name="compress-core-component">
84        <sevenzip task="encode" input="components/core.comp" output="components/core.lzma" dictionnary="26"/>
85    </target>
86
87    <!-- sourcecode -->
88    <target name="prepare-sourcecode-component">
89
90        <delete dir="components/tmp/sourcecode"/>
91        <mkdir dir="components/tmp/sourcecode"/>
92
93        <exec dir="${basedir}" executable="cp">
94            <arg line="-r distributions/web/common-src distributions/web/build-src distributions/web/runtime-src components/tmp/sourcecode"/>
95        </exec>
96        <exec dir="distributions/web" executable="cp">
97            <arg line="acconfig.h aclocal.m4 config.guess config.sub configtest.pl configure configure.in install-sh Makefile.in micotest.cpp config.h.in ${basedir}/components/tmp/sourcecode"/>
98        </exec>
99               
100        <mkdir dir="products"/>
101
102        <!-- create a script to create the tar -->
103        <echo output="create-sourcecode-component.sh">
104        tar -czf ../../../products/Greenstone-${version}-${os.suffix}-sourcecode-component.tar.gz *
105        </echo>
106        <chmod perm="+x" file="create-sourcecode-component.sh"/>
107
108        <!-- run it -->
109        <exec dir="components/tmp/sourcecode" executable="/bin/bash">
110            <arg line="${basedir}/create-sourcecode-component.sh"/>
111        </exec>
112
113        <!-- remove it -->
114        <delete file="create-sourcecode-component.sh"/>
115
116    </target>
117
118    <target name="compress-sourcecode-component">
119        <sevenzip task="encode" input="components/sourcecode.comp" output="components/sourcecode.lzma" dictionnary="26"/>
120    </target>
121
122    <!-- imagemagick -->
123    <target name="prepare-imagemagick-component">
124
125        <delete dir="components/tmp/imagemagick"/>
126        <mkdir dir="components/tmp/imagemagick"/>
127
128        <copy todir="components/tmp/imagemagick" overwrite="true">
129            <fileset dir="distributions/web/bin/darwin">
130                <include name="imagemagick/**/*"/>
131            </fileset>
132        </copy>
133               
134        <zip destfile="components/imagemagick.comp" basedir="components/tmp/imagemagick" compress="false" includes="**/*"/>
135    </target>
136       
137    <target name="compress-imagemagick-component">
138        <sevenzip task="encode" input="components/imagemagick.comp" output="components/imagemagick.lzma" dictionnary="26"/>
139    </target>
140   
141    <!-- ghostscript -->
142    <target name="prepare-ghostscript-component">
143
144        <delete dir="components/tmp/ghostscript"/>
145        <mkdir dir="components/tmp/ghostscript"/>
146
147        <copy todir="components/tmp/ghostscript" overwrite="true">
148            <fileset dir="distributions/web/bin/darwin">
149                <include name="ghostscript/**/*"/>
150            </fileset>
151        </copy>
152               
153        <zip destfile="components/ghostscript.comp" basedir="components/tmp/ghostscript" compress="false" includes="**/*"/>
154    </target>
155       
156    <target name="compress-ghostscript-component">
157        <sevenzip task="encode" input="components/ghostscript.comp" output="components/ghostscript.lzma" dictionnary="26"/>
158    </target>
159
160</project>
Note: See TracBrowser for help on using the browser.