diff options
author | David Lamparter <equinox@diac24.net> | 2018-12-14 22:51:37 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2019-02-19 21:34:06 +0100 |
commit | 3e662ed3f1d22555be5ebd505610329009ed74f9 (patch) | |
tree | 2b25f419b47dcf88f554173bc27b0a410ba841fa /tools | |
parent | debian: keep working nicely with split config (diff) | |
download | frr-3e662ed3f1d22555be5ebd505610329009ed74f9.tar.xz frr-3e662ed3f1d22555be5ebd505610329009ed74f9.zip |
tools: update build-debian-package.sh
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/build-debian-package.sh | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/tools/build-debian-package.sh b/tools/build-debian-package.sh index 73231f0ae..d21f468bf 100755 --- a/tools/build-debian-package.sh +++ b/tools/build-debian-package.sh @@ -2,39 +2,26 @@ # # Written by Daniil Baturin, 2018 # This file is public domain +set -e -git diff-index --quiet HEAD || echo "Warning: git working directory is not clean!" - -# Set the defaults -if [ "$EXTRA_VERSION" = "" ]; then - EXTRA_VERSION="-MyDebPkgVersion" -fi +cd "`dirname $0`" +cd .. -if [ "$WANT_SNMP" = "" ]; then - WANT_SNMP=0 +if [ "`id -u`" = 0 ]; then + echo "Running as root - installing dependencies" + apt-get install fakeroot debhelper devscripts + mk-build-deps --install debian/control + exit 0 fi -if [ "$WANT_CUMULUS_MODE" = "" ]; then - WANT_CUMULUS_MODE=0 -fi +git diff-index --quiet HEAD || echo "Warning: git working directory is not clean!" echo "Preparing the build" -./bootstrap.sh -./configure --with-pkg-extra-version=$EXTRA_VERSION -make dist - -echo "Preparing Debian source package" -mv debianpkg debian -make -f debian/rules backports - -echo "Unpacking the source to frrpkg/" -mkdir frrpkg -cd frrpkg -tar xf ../frr_*.orig.tar.gz -cd frr* -. /etc/os-release -tar xf ../../frr_*${ID}${VERSION_ID}*.debian.tar.xz +tools/tarsource.sh -V echo "Building the Debian package" -debuild --no-lintian --set-envvar=WANT_SNMP=$WANT_SNMP --set-envvar=WANT_CUMULUS_MODE=$WANT_CUMULUS_MODE -b -uc -us - +if test $# -eq 0; then + dpkg-buildpackage -b -uc -us +else + dpkg-buildpackage "$@" +fi |