@@ -1,4 +1,4 @@
-Source: linux-restricted-modules
+Source: LRM_SOURCE
Section: utils
Priority: optional
Maintainer: Canonical Kernel Team <kernel-team@lists.ubuntu.com>
@@ -8,7 +8,7 @@ arch = $(shell dpkg-architecture -qDEB_HOST_ARCH)
# Work out the source package name and version. We assume the source package
# is the name of this package with -restricted-modules stripped. The version
# is identical to this package less any rebuild suffix (+lrmN).
-src_package := $(shell LC_ALL=C dpkg-parsechangelog | grep ^Source: | cut -d ' ' -f 2 | sed -e 's/-restricted-modules//')
+src_package := $(shell LC_ALL=C dpkg-parsechangelog -S Source)
src_fullversion = $(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
src_abi = $(shell echo "$(src_fullversion)" | sed -ne 's/\([0-9]*\.[0-9]*\.[0-9]*\-[0-9]*\)\..*/\1/p')
src_version = $(shell echo $(src_fullversion) | sed -e 's/+[0-9][0-9]*//')
@@ -24,6 +24,7 @@ test:
# we have no binary files and we will not run the appropriate targets.
pre-clean:
sed <debian/control.stub >debian/control \
+ -e 's/LRM_SOURCE/$(src_package)/g' \
-e "s/ABI/$(src_abi)/g" \
-e "s/VERSION/$(src_version)/g" \
-e "s/@SERIES@/$(series)/g"
To ease transitioning the source package name, set the name in the control file from the name in the topmost changelog entry. Since the src_package variable in debian/rules is unused, change it to be the source package name from the changelog. While there, simplify getting the source package name from the changelog. Signed-off-by: Seth Forshee <seth.forshee@canonical.com> --- debian/control.stub | 2 +- debian/rules | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)