Makefile: Build debian packages in own directory.

Message ID 20191211154912.2130-1-stefan.schantl@ipfire.org
State Dropped
Headers
Series Makefile: Build debian packages in own directory. |

Commit Message

Stefan Schantl Dec. 11, 2019, 3:49 p.m. UTC
  This helps to keep a much cleaner environment.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 Makefile.am | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Patch

diff --git a/Makefile.am b/Makefile.am
index 1b9d90e..bf1dde1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -421,4 +421,8 @@  $(DEBIAN_TARBALL_NAME): dist
 
 .PHONY: debian
 debian: $(DEBIAN_TARBALL_NAME)
-	debuild -i -us -uc -b
+	mkdir -pv debian-build/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/debian
+	cp -avf $(DEBIAN_TARBALL_NAME) debian-build
+	cp -avf debian/* debian-build/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/debian
+	cd debian-build && tar -xvf $(DEBIAN_TARBALL_NAME)
+	cd debian-build/$(PACKAGE_NAME)-$(PACKAGE_VERSION) && debuild -us -uc