zfs/debian: embed downstream revision in META file

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@proxmox.com>
This commit is contained in:
Stoiko Ivanov 2019-05-23 23:11:31 +02:00 committed by Thomas Lamprecht
parent e4f11a69e8
commit 5dccc94923
2 changed files with 11 additions and 2 deletions

View File

@ -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}

View File

@ -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: