From 32d813ce44b5531f05f3c5378dd3b519e1cecffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 20 Jun 2024 10:27:13 +0200 Subject: [PATCH] build: properly use cargo wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit to actually get debug symbols with rustc >= 1.77 Signed-off-by: Fabian Grünbichler --- Makefile | 2 +- debian/rules | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9b8da67..3ac0f8b 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ cargo-build: install: cargo-build install -dm755 $(DESTDIR)/usr/bin - install -m4755 -o root -g root $(COMPILEDIR)/proxmox-mail-forward $(DESTDIR)/usr/bin/proxmox-mail-forward + $(CARGO) install .PHONY: upload upload: $(DEBS) diff --git a/debian/rules b/debian/rules index dcc43be..c9fa5cd 100755 --- a/debian/rules +++ b/debian/rules @@ -3,21 +3,26 @@ #DH_VERBOSE = 1 include /usr/share/dpkg/pkg-info.mk +include /usr/share/rustc/architecture.mk export BUILD_MODE=release -CARGO=/usr/share/cargo/bin/cargo - export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE + +export CARGO=/usr/share/cargo/bin/cargo export CARGO_HOME = $(CURDIR)/debian/cargo_home +export DEB_CARGO_CRATE=proxmox-mail-forward_$(DEB_VERSION_UPSTREAM) +export DEB_CARGO_PACKAGE=proxmox-mail-forward + %: dh $@ override_dh_auto_configure: @perl -ne 'if (/^version\s*=\s*"(\d+(?:\.\d+)+)"/) { my $$v_cargo = $$1; my $$v_deb = "$(DEB_VERSION_UPSTREAM)"; \ die "ERROR: d/changelog <-> Cargo.toml version mismatch: $$v_cargo != $$v_deb\n" if $$v_cargo ne $$v_deb; exit(0); }' Cargo.toml + $(CARGO) prepare-debian $(CURDIR)/debian/cargo_registry --link-from-system dh_auto_configure override_dh_fixperms: