[pve-devel] [PATCH zfsonlinux 04/15] zfs/debian: embed downstream revision in META file

Stoiko Ivanov s.ivanov at proxmox.com
Thu May 23 23:11:31 CEST 2019


taken from spl/debian/rules
Additionally refactor the actual change into a separate target.
This is needed when building the kernel-modules from an rc-tag (e.g. 0.8.0-rc5)

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 Makefile         |  1 +
 zfs/debian/rules | 12 ++++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 2c0ab01..a434795 100644
--- a/Makefile
+++ b/Makefile
@@ -46,6 +46,7 @@ dsc: ${DSCS}
 kernel: dsc
 	dpkg-source -x ${SPL_DSC} ../pkg-spl
 	dpkg-source -x ${ZFS_DSC} ../pkg-zfs
+	$(MAKE) -C ../pkg-zfs -f debian/rules adapt_meta_file
 
 .PHONY: dinstall
 dinstall: ${DEBS}
diff --git a/zfs/debian/rules b/zfs/debian/rules
index 8a31d07..8f002c9 100755
--- a/zfs/debian/rules
+++ b/zfs/debian/rules
@@ -2,15 +2,23 @@
 
 include /usr/share/dpkg/default.mk
 
+VERSION := $(DEB_VERSION_UPSTREAM)
+REVISION := $(shell echo $(DEB_VERSION) | cut -d- -f2)
+
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
 %:
 	dh $@ --with autoreconf,python3,systemd --parallel
 
-override_dh_autoreconf:
+adapt_meta_file:
 	@# Embed the downstream version in the module.
-	@sed -e 's/^Version:.*/Version:      $(DEB_VERSION_UPSTREAM)/' -i.orig META
+	@sed \
+	  -e 's/^Version:.*/Version:      $(VERSION)/' \
+	  -e 's/^Release:.*/Release:      $(REVISION)/' \
+	  -i.orig META
+
 
+override_dh_autoreconf: adapt_meta_file
 	dh_autoreconf
 
 override_dh_auto_configure:
-- 
2.11.0





More information about the pve-devel mailing list