public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: rpm-pkg: fix rpmbuild warnings for kernel.spec
@ 2024-06-10 16:38 Rafael Aquini
  2024-06-11 15:00 ` Masahiro Yamada
  0 siblings, 1 reply; 21+ messages in thread
From: Rafael Aquini @ 2024-06-10 16:38 UTC (permalink / raw)
  To: linux-kbuild
  Cc: linux-kernel, Masahiro Yamada, Nathan Chancellor, Nicolas Schier

Newer revisions of rpmbuild are throwing warnings about the current
kernel.spec template having an unversioned kernel-headers in the
'Obsoletes:' field and not being able to source the epoch's date from
the spec's missing '%changelog' section:

  $ make srcrpm-pkg
    UPD     include/config/kernel.release
    GEN     rpmbuild/SPECS/kernel.spec
    UPD     .tmp_HEAD
    ARCHIVE linux.tar.gz
  rpmbuild -bs rpmbuild/SPECS/kernel.spec --define='_topdir /mnt/nfs/work/kernel/linux/rpmbuild'
  warning: line 34: It's not recommended to have unversioned Obsoletes: Obsoletes: kernel-headers
  warning: source_date_epoch_from_changelog set but %changelog is missing
  Wrote: /mnt/nfs/work/kernel/linux/rpmbuild/SRPMS/kernel-6.10.0_rc3-1.src.rpm

  RPM build warnings:
      line 34: It's not recommended to have unversioned Obsoletes: Obsoletes: kernel-headers
      source_date_epoch_from_changelog set but %changelog is missing

This patch addresses both RPM build warnings.

Signed-off-by: Rafael Aquini <aquini@redhat.com>
---
 scripts/package/kernel.spec | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec
index e095eb1e290e..4d58b29c03ad 100644
--- a/scripts/package/kernel.spec
+++ b/scripts/package/kernel.spec
@@ -1,3 +1,5 @@
+%global source_date_epoch_from_changelog 0
+
 # _arch is undefined if /usr/lib/rpm/platform/*/macros was not included.
 %{!?_arch: %define _arch dummy}
 %{!?make: %define make make}
@@ -27,7 +29,7 @@ The Linux Kernel, the operating system core itself
 %package headers
 Summary: Header files for the Linux kernel for use by glibc
 Group: Development/System
-Obsoletes: kernel-headers
+Obsoletes: kernel-headers < %{version}
 Provides: kernel-headers = %{version}
 %description headers
 Kernel-headers includes the C header files that specify the interface
-- 
2.45.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-07-17 20:49 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-10 16:38 [PATCH] kbuild: rpm-pkg: fix rpmbuild warnings for kernel.spec Rafael Aquini
2024-06-11 15:00 ` Masahiro Yamada
2024-06-11 16:03   ` Rafael Aquini
2024-06-11 16:33     ` Masahiro Yamada
2024-06-11 21:11       ` [PATCH 0/2] " Rafael Aquini
2024-06-11 21:11       ` [PATCH 1/2] kbuild: rpm-pkg: make sure to have versioned 'Obsoletes' " Rafael Aquini
2024-06-13 19:01         ` Nathan Chancellor
2024-07-04 13:58         ` Masahiro Yamada
2024-06-11 21:11       ` [PATCH 2/2] kbuild: rpm-pkg: introduce a simple changelog section " Rafael Aquini
2024-07-04 15:28         ` Rafael Aquini
2024-07-04 15:52         ` Masahiro Yamada
2024-07-04 18:16           ` Rafael Aquini
2024-07-04 19:36           ` [PATCH v2 " Rafael Aquini
2024-07-06  3:40             ` Masahiro Yamada
2024-07-06 16:44               ` [PATCH v3 " Rafael Aquini
2024-07-15 16:32                 ` Masahiro Yamada
2024-07-15 21:21                   ` Rafael Aquini
2024-07-16  8:40                     ` Masahiro Yamada
2024-07-16 12:25                       ` [PATCH v4 " Rafael Aquini
2024-07-17 17:10                         ` Masahiro Yamada
2024-07-17 20:49                           ` Rafael Aquini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox