forked from ceph/ceph-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_snapshot_native.sh
executable file
·60 lines (41 loc) · 1.16 KB
/
build_snapshot_native.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh -ex
bindir=`dirname $0`
keyid="03C3951A"
usage() {
echo "usage: $0 outdir dist"
}
outdir=$1
dist=$2
[ -z "$dist" ] && usage && exit 1
srcdir=`pwd`
numproc=`cat /proc/cpuinfo |grep -c processor`
[ -z "$numproc" ] && numproc=1
#numproc=$(($numproc * 2))
cephver=`git describe | cut -c 2-`
echo current version $cephver
rm ceph-*.tar.gz || true
make dist
tarver=`ls ceph-*.tar.gz | cut -c 6- | sed 's/.tar.gz//'`
echo tarball vers $tarver
echo extracting
mkdir -p $outdir
cd $outdir
tar zxf $srcdir/ceph-$tarver.tar.gz
[ "$tarver" != "$cephver" ] && mv ceph-$tarver ceph-$cephver
cd ceph-$cephver
cp -av $srcdir/debian debian
debver="$cephver-1$dist"
echo $debver > ../version
# add to changelog?
chver=`head -1 debian/changelog | perl -ne 's/.*\(//; s/\).*//; print'`
if [ "$chver" != "$debver" ]; then
DEBEMAIL="[email protected]" dch -D $dist --force-distribution -b -v "$debver" "autobuilt"
fi
# remove missing wheezy deps?
if [ "$dist" = "wheezy" ]; then
echo removing libbabeltrace for wheezy
grep -v libbabeltrace debian/control > debian/control.new
mv debian/control.new debian/control
fi
# build
dpkg-buildpackage -j$numproc -k$keyid