Generalize prepare-wheezy-tree for other distributions.

Add support for jessie backports
This commit is contained in:
Oliver Jowett 2018-06-21 17:13:57 -05:00
parent 60c762c843
commit 9101d5017d
2 changed files with 58 additions and 23 deletions

58
prepare-build.sh Executable file
View file

@ -0,0 +1,58 @@
#!/bin/sh
# This script prepares a package tree for building on different target
# distributions
if [ $# -lt 1 ]
then
echo "Syntax: $0 <distribution> [target]" >&2
echo "" >&2
echo "Prepares a package tree in <target> (default package-<distribution>) ready for building" >&2
exit 1
fi
TOP=`dirname $0`
DIST=$1
OUT=$2
if [ -n "$OUT" ]
then
OUT=$(realpath $OUT)
else
OUT=$(realpath package-$DIST)
fi
if [ -e $OUT ]
then
echo "$OUT already exists, refusing to overwrite it" >&2
exit 1
fi
FILES=$(find $TOP -mindepth 1 -maxdepth 1 -name .git -prune -o -name 'debian*' -prune -o -print)
mkdir -p $OUT
cp -a $FILES $OUT
cp -a $TOP/debian $OUT
case "$DIST" in
wheezy)
cp -a $TOP/debian-wheezy/* $OUT/debian/
echo "Updating changelog for wheezy backport build" >&2
dch --changelog $OUT/debian/changelog --local ~bpo7+ --force-distribution --distribution wheezy-backports "Automated backport build for wheezy"
echo "Cloning rtl-sdr source"
git clone git://git.osmocom.org/rtl-sdr.git $OUT/rtl-sdr
;;
jessie)
echo "Updating changelog for jessie backport build" >&2
dch --changelog $OUT/debian/changelog --local ~bpo8+ --force-distribution --distribution jessie-backports "Automated backport build for jessie"
;;
stretch)
;;
*)
echo "Don't know how to build for a distribution named $DIST" >&2
exit 1
esac
echo "Package tree prepared in $OUT" >&2

View file

@ -1,23 +0,0 @@
#!/bin/sh
# This is a nasty hack that prepares a separate package tree suitable for
# building the package for wheezy
TOP=`dirname $0`
OUT=$TOP/package-wheezy
rm -fr $OUT
FILES=$(find $TOP -mindepth 1 -maxdepth 1 -name .git -prune -o -name 'debian-wheezy' -prune -o -print)
mkdir $OUT
cp -a $FILES $OUT
cp -a $TOP/debian-wheezy/* $OUT/debian/
echo "Updating changelog for wheezy backport build"
dch --changelog $OUT/debian/changelog --bpo --distribution wheezy-backports "Automated backport build for wheezy"
echo "Cloning rtl-sdr source"
git clone git://git.osmocom.org/rtl-sdr.git $OUT/rtl-sdr
echo "OK, ready to go in $OUT"