build system upgrade

and detect upload-distro...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2024-06-20 13:33:21 +02:00
parent 9a57a081f3
commit 6b767d07d6

View File

@ -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 .PHONY: all
all: check all: check
@ -9,7 +19,6 @@ check:
dinstall: deb dinstall: deb
sudo -k dpkg -i build/librust-*.deb sudo -k dpkg -i build/librust-*.deb
.PHONY: build
build: build:
rm -rf build rm -rf build
rm -f debian/control rm -f debian/control
@ -27,7 +36,10 @@ build:
cp build/pxar/debian/control debian/control cp build/pxar/debian/control debian/control
.PHONY: deb .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) (cd build/pxar && CARGO=/usr/bin/cargo RUSTC=/usr/bin/rustc dpkg-buildpackage -b -uc -us)
lintian build/*.deb lintian build/*.deb
@ -36,9 +48,11 @@ clean:
rm -rf build *.deb *.buildinfo *.changes *.orig.tar.gz rm -rf build *.deb *.buildinfo *.changes *.orig.tar.gz
cargo clean cargo clean
upload: deb .PHONY: upload
upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
upload: build/$(DEB)
cd build; \ cd build; \
dcmd --deb rust-pxar_*.changes \ dcmd --deb rust-pxar_*.changes \
| grep -v '.changes$$' \ | grep -v '.changes$$' \
| tar -cf- -T- \ | 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)