]> git.proxmox.com Git - proxmox-backup.git/commitdiff
build: inject repoid into build environment
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 4 Jan 2023 14:13:09 +0000 (15:13 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 21 May 2023 12:55:06 +0000 (14:55 +0200)
to support building outside of the git tree, e.g. via sbuild.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Makefile
debian/rules

index 1d04eb65ea0a9c4f94ad37a3e673f39fc717a36c..e8a541a34d387f55e60eae74ed1d88e7ca28f003 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -89,6 +89,7 @@ doc:
 build:
        rm -rf build
        mkdir build
+       git rev-parse HEAD > build/.repoid
        cp -a debian \
          Cargo.toml src \
          $(SUBCRATES) \
index cf94692ecfe0403568f949b3c98e203c086470b8..ff85b241d8bd0c591e226ffc20c8bae6852aa2bb 100755 (executable)
@@ -17,6 +17,10 @@ export CARGO_HOME = $(CURDIR)/debian/cargo_home
 export DEB_CARGO_CRATE=proxmox-backup_$(DEB_VERSION_UPSTREAM)
 export DEB_CARGO_PACKAGE=proxmox-backup
 
+ifneq ("$(wildcard .repoid)","")
+       export REPOID=$(shell cat .repoid)
+endif
+
 %:
        dh $@ --with=bash-completion