From 6b767d07d6af8573b779ea38121fc85b0dc94e07 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 20 Jun 2024 13:33:21 +0200 Subject: [PATCH] build system upgrade and detect upload-distro... Signed-off-by: Wolfgang Bumiller --- Makefile | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3ce6692..19d8adc 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,13 @@ +include /usr/share/dpkg/architecture.mk +include /usr/share/dpkg/pkg-info.mk + +SRCPACKAGE=rust-pxar +PACKAGE=lib$(SRCPACKAGE)-dev +ARCH := $(DEB_BUILD_ARCH) + +DEB=$(PACKAGE)_$(DEB_VERSION)_$(ARCH).deb +DSC=$(SRCPACKAGE)_$(DEB_VERSION)_$(ARCH).deb + .PHONY: all all: check @@ -9,7 +19,6 @@ check: dinstall: deb sudo -k dpkg -i build/librust-*.deb -.PHONY: build build: rm -rf build rm -f debian/control @@ -27,7 +36,10 @@ build: cp build/pxar/debian/control debian/control .PHONY: deb -deb: build +deb: + rm -rf build + $(MAKE) build/$(DEB) +build/$(DEB): build (cd build/pxar && CARGO=/usr/bin/cargo RUSTC=/usr/bin/rustc dpkg-buildpackage -b -uc -us) lintian build/*.deb @@ -36,9 +48,11 @@ clean: rm -rf build *.deb *.buildinfo *.changes *.orig.tar.gz cargo clean -upload: deb +.PHONY: upload +upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) +upload: build/$(DEB) cd build; \ dcmd --deb rust-pxar_*.changes \ | grep -v '.changes$$' \ | tar -cf- -T- \ - | ssh -X repoman@repo.proxmox.com upload --product devel --dist bullseye + | echo ssh -X repoman@repo.proxmox.com upload --product devel --dist $(UPLOAD_DIST)