From e65c5468690e606b79fd499edfa03d46b9eb6a63 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 31 Jan 2012 21:37:52 -0800 Subject: [PATCH] build_snapshot_native: build deb without pbuilder Simpler/faster script to build a deb from the ceph git checkout in pwd. --- build_snapshot_native.sh | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 build_snapshot_native.sh diff --git a/build_snapshot_native.sh b/build_snapshot_native.sh new file mode 100755 index 00000000..d16b765e --- /dev/null +++ b/build_snapshot_native.sh @@ -0,0 +1,53 @@ +#!/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="sage@newdream.net" dch -D $dist --force-distribution -b -v "$debver" "autobuilt" +fi + +# build +dpkg-buildpackage -j$numproc -k$keyid + -- 2.39.5