redhat: Create unique debuginfo packages for kmods 77/12977/3
authorStephan Wiesand <stephan.wiesand@desy.de>
Mon, 26 Mar 2018 18:21:19 +0000 (20:21 +0200)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 30 Mar 2018 13:54:35 +0000 (09:54 -0400)
Commit 443dd5367e0cd9050ad39a6594c5be521271b4e9 ("redhat:
separate debuginfo package for kmod rpm") introduced the
creation of separate debuginfo packages for the kmod packages.
As such, this is useful, but all debuginfo packages for a given
OpenAFS release ended up with the same name/version/release for
the kmod debuginfo package, no matter which kernel release or
variant the kmod was built for.

Move the additional black magic from the spec into the kmodtool
script where we have the means to do better: Use the same naming
and versioning conventions as for the kmod-openafs packages
themselves.

Change-Id: Ibcb34e4c8efde13d0600005772751d8aeb8154aa
Reviewed-on: https://gerrit.openafs.org/12977
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/packaging/RedHat/openafs-kmodtool
src/packaging/RedHat/openafs.spec.in

index b6dee32..6721b79 100644 (file)
@@ -92,6 +92,9 @@ get_rpmtemplate ()
     esac
 
     cat <<EOF
+
+%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*openafs.ko(\.debug)?' -o kmod-debuginfo.list
+
 %package       -n kmod-${kmod_name}${dashvariant}
 Summary:          ${kmod_name} kernel module(s)
 Group:            System Environment/Kernel
@@ -107,6 +110,16 @@ BuildRequires:    kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}
 %description   -n kmod-${kmod_name}${dashvariant}
 This package provides the ${kmod_name} kernel modules built for the Linux
 kernel ${kname} for the %{_target_cpu} family of processors.
+
+%package       -n kmod-%{kmod_name}${dashvariant}-debuginfo
+Summary:          Debug information for %{kmod_name} kernel modules
+Group:            Development/Debug
+Release:          %{pkgrel}.%(echo ${verrel} | tr - _)
+AutoReqProv:      no
+%description   -n kmod-%{kmod_name}${dashvariant}-debuginfo
+This package provides debug information for the %{kmod_name} kernel modules
+built for the Linux kernel ${kname} for the %{_target_cpu} family of processors.
+
 %post          -n kmod-${kmod_name}${dashvariant}
 ${depmod} -aeF /boot/System.map-${kname} ${kname} > /dev/null || :
 %postun        -n kmod-${kmod_name}${dashvariant}
@@ -115,6 +128,9 @@ ${depmod} -aF /boot/System.map-${kname} ${kname} &> /dev/null || :
 %defattr(644,root,root,755)
 /lib/modules/${kname}/extra/${kmod_name}/
 
+%files -f kmod-debuginfo.list -n kmod-%{kmod_name}${dashvariant}-debuginfo
+%defattr(-,root,root)
+
 EOF
 }
 
index 7559923..71e4625 100644 (file)
@@ -403,17 +403,6 @@ krb4 lookalike services.
 ##############################################################################
 %if %{build_modules}
 
-# Make debuginfo for the kernel components into their own package
-# so we can upgrade kernel and userspace seperately and still debug each
-%package -n %{name}-kernel-debuginfo
-Summary: Debug information for %{name} kernel modules
-Group: Development/Debug
-AutoReqProv: no
-%description -n %{name}-kernel-debuginfo
-This package provides debug information for %{name} kernel modules.
-
-%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*openafs.ko(\.debug)?' -o kmod-debuginfo.list}
-
 %{expand:%(%{kmodtool} rpmtemplate %{kmod_name} %{kverrel} %{depmod} %{kvariants} 2>/dev/null)}
 
 %endif
@@ -1466,11 +1455,6 @@ dkms remove -m %{name} -v %{dkms_version} --rpm_safe_upgrade --all ||:
 %endif
 %endif  # build_userspace
 
-%if %{build_modules}
-%files -f kmod-debuginfo.list -n %{name}-kernel-debuginfo
-%defattr(-,root,root)
-%endif
-
 ##############################################################################
 ###
 ### openafs.spec change log