From 39d9ce2bb56be502e453320b5672f4c0482a54fa Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 8 Feb 2018 05:43:15 +0000 Subject: [PATCH] Debian: Add support for older versions on which dpkg-buildpackage neither supports -ui nor -jauto git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7369 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- Makefile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8e150cf69..9f664620d 100644 --- a/Makefile +++ b/Makefile @@ -510,10 +510,20 @@ dpkg: ../scst_$(VERSION).orig.tar.xz ../scst_$(VERSION)-$(DEBIAN_REVISION)_amd64.changes \ ) && \ rm -f "$${output_files[@]}" && \ - if false; then \ - dpkg-buildpackage -uc -us -ui -jauto; \ + buildopts=(-uc -us) && \ + if dpkg-buildpackage --help 2>&1 | grep -- '-ui'; then \ + buildopts+=(-ui); \ + fi && \ + if dpkg-buildpackage --help 2>&1 | \ + grep -q -- '--jobs\[=|auto\]'; then \ + buildopts+=(-jauto); \ else \ - debuild -uc -us -ui -jauto --lintian-opts --profile debian; \ + buildopts+=(-j4); \ + fi && \ + if false; then \ + dpkg-buildpackage "$${buildopts[@]}"; \ + else \ + debuild "$${buildopts[@]}" --lintian-opts --profile debian; \ fi && \ mkdir -p dpkg && \ for f in "$${output_files[@]}" ../scst_$(VERSION).orig.tar.xz; do\