diff mbox series

[3/7,G,L-R-M] UBUNTU: [Packaging] rules -- expose nvidia-kernel-common dependency data

Message ID 20200716133951.1164893-2-alberto.milone@canonical.com
State New
Headers show
Series Add the new NVIDIA 450 and the new server series | expand

Commit Message

Alberto Milone July 16, 2020, 1:39 p.m. UTC
Export the dependency data for use in control templates.

BugLink: https://bugs.launchpad.net/bugs/1881137

Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
---
 debian/rules | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/debian/rules b/debian/rules
index 81f8a59..95586cd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -20,6 +20,10 @@  dkms_nvidia_390_version=$(shell gawk '/^nvidia-graphics-drivers-390/ { print $$2
 dkms_nvidia_435_version=$(shell gawk '/^nvidia-graphics-drivers-435/ { print $$2; }' debian/dkms-versions)
 dkms_nvidia_440_version=$(shell gawk '/^nvidia-graphics-drivers-440/ { print $$2; }' debian/dkms-versions)
 
+nvidia_390_upstream_version=$(shell echo "$(dkms_nvidia_390_version)" | cut -d '-' -f 1)
+nvidia_435_upstream_version=$(shell echo "$(dkms_nvidia_435_version)" | cut -d '-' -f 1)
+nvidia_440_upstream_version=$(shell echo "$(dkms_nvidia_440_version)" | cut -d '-' -f 1)
+
 # Get variants, assumng primary if debian/variants is not present
 variants = --
 ifneq (,$(wildcard debian/variants))
@@ -154,5 +158,9 @@  gencontrol_flags  = -Vdkms:nvidia-390-modules="nvidia-dkms-390 (= $(dkms_nvidia_
 gencontrol_flags  = -Vdkms:nvidia-435-modules="nvidia-dkms-435 (= $(dkms_nvidia_435_version))"
 gencontrol_flags += -Vdkms:nvidia-440-modules="nvidia-dkms-440 (= $(dkms_nvidia_440_version))"
 
+gencontrol_flags += -Vnvk:nvidia-390="nvidia-kernel-common-390 (<= $(nvidia_390_upstream_version)-1), nvidia-kernel-common-390 (>= $(nvidia_390_upstream_version))"
+gencontrol_flags += -Vnvk:nvidia-435="nvidia-kernel-common-435 (<= $(nvidia_435_upstream_version)-1), nvidia-kernel-common-435 (>= $(nvidia_435_upstream_version))"
+gencontrol_flags += -Vnvk:nvidia-440="nvidia-kernel-common-440 (<= $(nvidia_440_upstream_version)-1), nvidia-kernel-common-440 (>= $(nvidia_440_upstream_version))"
+
 override_dh_gencontrol:
 	dh_gencontrol -- $(gencontrol_flags)