]> git.proxmox.com Git - proxmox-websocket-tunnel.git/commitdiff
build: makefile improvements
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 24 May 2023 13:09:11 +0000 (15:09 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 24 May 2023 13:10:09 +0000 (15:10 +0200)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Makefile

index 6452a8b53648a6156aef79f34df5d1b49bc765d5..6c9dc1059859f5a37539634c586b837a5542b241 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,8 @@
+include /usr/share/dpkg/default.mk
+
+PACKAGE := proxmox-websocket-tunnel
+ARCH := $(DEB_BUILD_ARCH)
+
 .PHONY: all
 all: check
 
@@ -18,22 +23,22 @@ build:
            --config "$(PWD)/debian/debcargo.toml" \
            --changelog-ready \
            --no-overlay-write-back \
-           --directory "$(PWD)/build/proxmox-websocket-tunnel" \
-           "proxmox-websocket-tunnel" \
+           --directory "$(PWD)/build/$(PACKAGE)" \
+           "$(PACKAGE)" \
            "$$(dpkg-parsechangelog -l "debian/changelog" -SVersion | sed -e 's/-.*//')"
        echo system >build/rust-toolchain
-       rm -f build/proxmox-websocket-tunnel/Cargo.lock
-       find build/proxmox-websocket-tunnel/debian -name '*.hint' -delete
-       cp build/proxmox-websocket-tunnel/debian/control debian/control
+       rm -f build/$(PACKAGE)/Cargo.lock
+       find build/$(PACKAGE)/debian -name '*.hint' -delete
+       cp build/$(PACKAGE)/debian/control debian/control
 
 .PHONY: dsc
 dsc: build
-       (cd build/proxmox-websocket-tunnel && dpkg-buildpackage -S -uc -us)
+       (cd build/$(PACKAGE) && dpkg-buildpackage -S -uc -us)
        lintian build/*.dsc
 
 .PHONY: deb
 deb: build
-       (cd build/proxmox-websocket-tunnel && dpkg-buildpackage -b -uc -us)
+       (cd build/$(PACKAGE) && dpkg-buildpackage -b -uc -us)
        lintian build/*.deb
 
 .PHONY: clean
@@ -41,9 +46,11 @@ clean:
        rm -rf build *.deb *.buildinfo *.changes *.orig.tar.gz
        cargo clean
 
+.PHONY: upload
+upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
 upload: deb
        cd build; \
-           dcmd --deb rust-proxmox-websocket-tunnel_*.changes \
+           dcmd --deb rust-$(PACKAGE)_*.changes \
            | grep -v '.changes$$' \
            | tar -cf- -T- \
-           | ssh -X repoman@repo.proxmox.com upload --product pve --dist bullseye
+           | ssh -X repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST)