forked from ceph/ceph-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_debs.sh
executable file
·73 lines (57 loc) · 1.89 KB
/
build_debs.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash -x
set -e
bindir=`dirname $0`
usage() {
echo "usage: $0 releasedir pbuilddir ver [dists]"
}
releasedir=$1
pbuilddir=$2
cephver=$3
dists=$4
[ -z "$releasedir" ] && echo specify release dir && usage && exit 1
[ -z "$pbuilddir" ] && echo specify pbuilder image dir && usage && exit 1
[ -z "$cephver" ] && echo specify version && usage && exit 1
start_time=`date`
echo version $cephver
whoami=`whoami`
[ "$whoami" != "root" ] && echo "must run as root not $whoami" && usage && exit 1
[ -z "$dists" ] && dists=`cat $releasedir/$cephver/debian_dists`
dvers=`cat $releasedir/$cephver/debian_version`
echo deb vers $dvers
echo dists $dists
for dist in $dists
do
pbuilder --clean
bpvers=`$bindir/gen_debian_version.sh $dvers $dist`
echo deb vers $bpvers
#[ "$dist" = "sid" ] && dist="wheezy"
$bindir/update_pbuilder.sh $pbuilddir $dist
echo building debs for $dist
if [ `dpkg-architecture -qDEB_BUILD_ARCH` = "i386" ] ; then
# Architecture dependent, independent and source
pbuilder build \
--distribution $dist \
--basetgz $pbuilddir/$dist.tgz \
--buildresult $releasedir/$cephver \
--debbuildopts "-j`grep -c processor /proc/cpuinfo`" \
$releasedir/$cephver/ceph_$bpvers.dsc
else
# Binary only architecture dependent
pbuilder build \
--binary-arch \
--distribution $dist \
--basetgz $pbuilddir/$dist.tgz \
--buildresult $releasedir/$cephver \
--debbuildopts "-j`grep -c processor /proc/cpuinfo`" \
$releasedir/$cephver/ceph_$bpvers.dsc
fi
done
# do lintian checks
for dist in $dists
do
bpvers=`$bindir/gen_debian_version.sh $dvers $dist`
echo lintian checks for $bpvers
echo lintian --allow-root $releasedir/$cephver/*$bpvers*.deb
done
echo "Start Time = $start_time"
echo " End Time = $(date)"