summaryrefslogtreecommitdiffstats
path: root/mktarball.sh
blob: 378e7c2b54c2c7a7600c8d01659aeaa54c6bfbd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

dir=".."
spec="samba4.spec"
samba_version="4.0.0"

if test $# -gt 0; then
    dir="$1"
fi

rm -f samba-${samba_version}.tar.bz2

git archive --remote ${dir} --prefix=samba-${samba_version}/ origin/master | bzip2 >  samba-${samba_version}.tar.bz2

md5sum samba-${samba_version}.tar.bz2 > sources

talloc_version=`grep ^VERSION ${dir}/lib/talloc/wscript | cut -d "'" -f 2`
tevent_version=`grep ^VERSION ${dir}/lib/tevent/wscript | cut -d "'" -f 2`
tdb_version=`grep ^VERSION ${dir}/lib/tdb/wscript | cut -d "'" -f 2`
ldb_version=`grep ^VERSION ${dir}/lib/ldb/wscript | cut -d "'" -f 2`

sed --in-place s/^%define\ talloc_version.*/%define\ talloc_version\ $talloc_version/ $spec
sed --in-place s/^%define\ tevent_version.*/%define\ tevent_version\ $tevent_version/ $spec
sed --in-place s/^%define\ tdb_version.*/%define\ tdb_version\ $tdb_version/ $spec
sed --in-place s/^%define\ ldb_version.*/%define\ ldb_version\ $ldb_version/ $spec