]> git.proxmox.com Git - proxmox-perl-rs.git/commitdiff
buildsys: both: check crate vs debian version
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 5 Jul 2023 11:44:48 +0000 (13:44 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 5 Jul 2023 11:50:17 +0000 (13:50 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
pmg-rs/debian/rules
pve-rs/debian/rules

index 0f5be05bd075cdcfd2ec2b2ead4af94908373c98..2993715302c01671f7af9257add5626d6f85866d 100755 (executable)
@@ -1,7 +1,25 @@
 #!/usr/bin/make -f
 
+include /usr/share/dpkg/pkg-info.mk
+include /usr/share/rustc/architecture.mk
+
 #export DH_VERBOSE=1
 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_HOME = $(CURDIR)/debian/cargo_home
+
+export DEB_CARGO_CRATE=pmg-rs_$(DEB_VERSION_UPSTREAM)
+export DEB_CARGO_PACKAGE=pmg-rs
+
 %:
        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
index 0f5be05bd075cdcfd2ec2b2ead4af94908373c98..bddb889a5214aa5cd1e6b30923c3ec2faf8d2226 100755 (executable)
@@ -1,7 +1,25 @@
 #!/usr/bin/make -f
 
+include /usr/share/dpkg/pkg-info.mk
+include /usr/share/rustc/architecture.mk
+
 #export DH_VERBOSE=1
 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_HOME = $(CURDIR)/debian/cargo_home
+
+export DEB_CARGO_CRATE=pve-rs_$(DEB_VERSION_UPSTREAM)
+export DEB_CARGO_PACKAGE=pve-rs
+
 %:
        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