diff --git a/prepare-build.sh b/prepare-build.sh new file mode 100755 index 0000000..aa43a65 --- /dev/null +++ b/prepare-build.sh @@ -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 [target]" >&2 + echo "" >&2 + echo "Prepares a package tree in (default package-) 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 diff --git a/prepare-wheezy-tree.sh b/prepare-wheezy-tree.sh deleted file mode 100755 index 48300ac..0000000 --- a/prepare-wheezy-tree.sh +++ /dev/null @@ -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"