From: Viktor Malik <vmalik@xxxxxxxxxx> redhat/spec: Update bpftool versioning scheme The upstream has changed the versioning scheme of bpftool [1]. Instead of following the kernel version, it is now deduced from the libbpf version by adding +6 to the libbpf major version number. This appropriately updates the bpftool sub-package version number. The version is deduced automatically from the libbpf version, which can be retrieved from tools/lib/bpf/libbpf.map. One problem is that even though RPM allows to override sub-package version, doing that overrides the internal %{version} macro. The macro is used later throughout the specfile, so we reset it to its default value (%{specversion}) at the end of the bpftool sub-package definition. [1] https://lore.kernel.org/bpf/20220210104237.11649-3-quentin@xxxxxxxxxxxxx/ Signed-off-by: Viktor Malik <vmalik@xxxxxxxxxx> diff --git a/redhat/Makefile b/redhat/Makefile index blahblah..blahblah 100644 --- a/redhat/Makefile +++ b/redhat/Makefile @@ -281,6 +281,12 @@ KABI_TARBALL:=$(SOURCES)/kernel-abi-stablelists-$(SPECKABIVERSION).tar.bz2 KABIDW := $(REDHAT)/kabi-dwarf KABIDW_TARBALL:=$(SOURCES)/kernel-kabi-dw-$(SPECKABIVERSION).tar.bz2 +# Taken from tools/lib/bpf/Makefile +SPECBPFTOOLVERSION:=$(shell \ + grep -oE '^LIBBPF_([0-9.]+)' $(TOPDIR)/tools/lib/bpf/libbpf.map | \ + sort -rV | head -n1 | cut -d'_' -f2 | \ + awk -F. -v OFS=. '{$$1 += 6 ; print}') + # load Makefile variable settings from user-specified configuration file, # ~/.rhpkg.mk or $TOPDIR/.rhpkg.mk ifeq ("$(RHDISTGIT_CACHE)", "") diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index blahblah..blahblah 100755 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -1091,23 +1091,31 @@ and root causes of unexpected results. %if %{with_bpftool} +%define bpftoolversion %%SPECBPFTOOLVERSION%% + %package -n bpftool Summary: Inspection and simple manipulation of eBPF programs and maps License: GPLv2 +Version: %{bpftoolversion} %description -n bpftool This package contains the bpftool, which allows inspection and simple manipulation of eBPF programs and maps. %package -n bpftool-debuginfo Summary: Debug information for package bpftool +Version: %{bpftoolversion} Group: Development/Debug -Requires: %{name}-debuginfo-common-%{_target_cpu} = %{version}-%{release} +Requires: %{name}-debuginfo-common-%{_target_cpu} = %{specversion}-%{release} AutoReqProv: no %description -n bpftool-debuginfo This package provides debug information for the bpftool package. %{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%%{_sbindir}/bpftool(\.debug)?|XXX' -o bpftool-debuginfo.list} +# Setting "Version:" above overrides the internal {version} macro, +# need to restore it here +%define version %{specversion} + # with_bpftool %endif diff --git a/redhat/scripts/genspec/genspec.sh b/redhat/scripts/genspec/genspec.sh index blahblah..blahblah 100755 --- a/redhat/scripts/genspec/genspec.sh +++ b/redhat/scripts/genspec/genspec.sh @@ -55,6 +55,7 @@ test -f "$SOURCES/$SPECFILE" && s/%%SPECPATCHLIST_CHANGELOG%%/$SPECPATCHLIST_CHANGELOG/ s/%%SPECVERSION%%/$SPECVERSION/ s/%%SPECKABIVERSION%%/$SPECKABIVERSION/ + s/%%SPECBPFTOOLVERSION%%/$SPECBPFTOOLVERSION/ s/%%SPECTARFILE_RELEASE%%/$SPECTARFILE_RELEASE/ s/%%SPECSELFTESTS_MUST_BUILD%%/$SPECSELFTESTS_MUST_BUILD/" "$SOURCES/$SPECFILE" test -n "$RHSELFTESTDATA" && test -f "$SOURCES/$SPECFILE" && sed -i -e " diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7 b/redhat/self-test/data/centos-2585cf9dfaad.el7 index blahblah..blahblah 100644 --- a/redhat/self-test/data/centos-2585cf9dfaad.el7 +++ b/redhat/self-test/data/centos-2585cf9dfaad.el7 @@ -63,6 +63,7 @@ RPM=../redhat/rpm RPMBUILD=rpmbuild SNAPSHOT=0 SOURCES=../redhat/rpm/SOURCES +SPECBPFTOOLVERSION=7.2.0 SPECBUILD=0.rc5.6.test SPECCHANGELOG=kernel.changelog-9.99 SPECFILE=kernel.spec diff --git a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-2585cf9dfaad.el7.spec +++ b/redhat/self-test/data/centos-2585cf9dfaad.el7.spec @@ -12,4 +12,5 @@ %define specrelease 0.rc5.6%{?buildid}%{?dist} %define kabiversion 5.16.0-0.rc5.6.test.el7 %define selftests_must_build 0 +%define bpftoolversion 7.2.0 Mon Mar 28 2022 Fedora Kernel Team <kernel-team@xxxxxxxxxxxxxxxxx> [5.16.0-0.rc5.6.test] diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25 b/redhat/self-test/data/centos-2585cf9dfaad.fc25 index blahblah..blahblah 100644 --- a/redhat/self-test/data/centos-2585cf9dfaad.fc25 +++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25 @@ -63,6 +63,7 @@ RPM=../redhat/rpm RPMBUILD=rpmbuild SNAPSHOT=0 SOURCES=../redhat/rpm/SOURCES +SPECBPFTOOLVERSION=7.2.0 SPECBUILD=0.rc5.6.test SPECCHANGELOG=kernel.changelog-9.99 SPECFILE=kernel.spec diff --git a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec +++ b/redhat/self-test/data/centos-2585cf9dfaad.fc25.spec @@ -12,4 +12,5 @@ %define specrelease 0.rc5.6%{?buildid}%{?dist} %define kabiversion 5.16.0-0.rc5.6.test.fc25 %define selftests_must_build 0 +%define bpftoolversion 7.2.0 Mon Mar 28 2022 Fedora Kernel Team <kernel-team@xxxxxxxxxxxxxxxxx> [5.16.0-0.rc5.6.test] diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7 b/redhat/self-test/data/centos-78e36f3b0dae.el7 index blahblah..blahblah 100644 --- a/redhat/self-test/data/centos-78e36f3b0dae.el7 +++ b/redhat/self-test/data/centos-78e36f3b0dae.el7 @@ -63,6 +63,7 @@ RPM=../redhat/rpm RPMBUILD=rpmbuild SNAPSHOT=1 SOURCES=../redhat/rpm/SOURCES +SPECBPFTOOLVERSION=7.2.0 SPECBUILD=0.rc0.78e36f3b0dae.6.test SPECCHANGELOG=kernel.changelog-9.99 SPECFILE=kernel.spec diff --git a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-78e36f3b0dae.el7.spec +++ b/redhat/self-test/data/centos-78e36f3b0dae.el7.spec @@ -12,4 +12,5 @@ %define specrelease 0.rc0.78e36f3b0dae.6%{?buildid}%{?dist} %define kabiversion 5.17.0-0.rc0.78e36f3b0dae.6.test.el7 %define selftests_must_build 0 +%define bpftoolversion 7.2.0 Mon Mar 28 2022 Fedora Kernel Team <kernel-team@xxxxxxxxxxxxxxxxx> [5.17.0-0.rc0.78e36f3b0dae.6.test] diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25 b/redhat/self-test/data/centos-78e36f3b0dae.fc25 index blahblah..blahblah 100644 --- a/redhat/self-test/data/centos-78e36f3b0dae.fc25 +++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25 @@ -63,6 +63,7 @@ RPM=../redhat/rpm RPMBUILD=rpmbuild SNAPSHOT=1 SOURCES=../redhat/rpm/SOURCES +SPECBPFTOOLVERSION=7.2.0 SPECBUILD=0.rc0.78e36f3b0dae.6.test SPECCHANGELOG=kernel.changelog-9.99 SPECFILE=kernel.spec diff --git a/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec b/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec +++ b/redhat/self-test/data/centos-78e36f3b0dae.fc25.spec @@ -12,4 +12,5 @@ %define specrelease 0.rc0.78e36f3b0dae.6%{?buildid}%{?dist} %define kabiversion 5.17.0-0.rc0.78e36f3b0dae.6.test.fc25 %define selftests_must_build 0 +%define bpftoolversion 7.2.0 Mon Mar 28 2022 Fedora Kernel Team <kernel-team@xxxxxxxxxxxxxxxxx> [5.17.0-0.rc0.78e36f3b0dae.6.test] diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7 b/redhat/self-test/data/centos-df0cc57e057f.el7 index blahblah..blahblah 100644 --- a/redhat/self-test/data/centos-df0cc57e057f.el7 +++ b/redhat/self-test/data/centos-df0cc57e057f.el7 @@ -63,6 +63,7 @@ RPM=../redhat/rpm RPMBUILD=rpmbuild SNAPSHOT=0 SOURCES=../redhat/rpm/SOURCES +SPECBPFTOOLVERSION=7.2.0 SPECBUILD=6.test SPECCHANGELOG=kernel.changelog-9.99 SPECFILE=kernel.spec diff --git a/redhat/self-test/data/centos-df0cc57e057f.el7.spec b/redhat/self-test/data/centos-df0cc57e057f.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-df0cc57e057f.el7.spec +++ b/redhat/self-test/data/centos-df0cc57e057f.el7.spec @@ -12,4 +12,5 @@ %define specrelease 6%{?buildid}%{?dist} %define kabiversion 5.16.0-6.test.el7 %define selftests_must_build 0 +%define bpftoolversion 7.2.0 Mon Mar 28 2022 Fedora Kernel Team <kernel-team@xxxxxxxxxxxxxxxxx> [5.16.0-6.test] diff --git a/redhat/self-test/data/centos-df0cc57e057f.fc25 b/redhat/self-test/data/centos-df0cc57e057f.fc25 index blahblah..blahblah 100644 --- a/redhat/self-test/data/centos-df0cc57e057f.fc25 +++ b/redhat/self-test/data/centos-df0cc57e057f.fc25 @@ -63,6 +63,7 @@ RPM=../redhat/rpm RPMBUILD=rpmbuild SNAPSHOT=0 SOURCES=../redhat/rpm/SOURCES +SPECBPFTOOLVERSION=7.2.0 SPECBUILD=6.test SPECCHANGELOG=kernel.changelog-9.99 SPECFILE=kernel.spec diff --git a/redhat/self-test/data/centos-df0cc57e057f.fc25.spec b/redhat/self-test/data/centos-df0cc57e057f.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-df0cc57e057f.fc25.spec +++ b/redhat/self-test/data/centos-df0cc57e057f.fc25.spec @@ -12,4 +12,5 @@ %define specrelease 6%{?buildid}%{?dist} %define kabiversion 5.16.0-6.test.fc25 %define selftests_must_build 0 +%define bpftoolversion 7.2.0 Mon Mar 28 2022 Fedora Kernel Team <kernel-team@xxxxxxxxxxxxxxxxx> [5.16.0-6.test] diff --git a/redhat/self-test/data/centos-fce15c45d3fb.el7 b/redhat/self-test/data/centos-fce15c45d3fb.el7 index blahblah..blahblah 100644 --- a/redhat/self-test/data/centos-fce15c45d3fb.el7 +++ b/redhat/self-test/data/centos-fce15c45d3fb.el7 @@ -63,6 +63,7 @@ RPM=../redhat/rpm RPMBUILD=rpmbuild SNAPSHOT=1 SOURCES=../redhat/rpm/SOURCES +SPECBPFTOOLVERSION=7.2.0 SPECBUILD=0.rc5.fce15c45d3fb.6.test SPECCHANGELOG=kernel.changelog-9.99 SPECFILE=kernel.spec diff --git a/redhat/self-test/data/centos-fce15c45d3fb.el7.spec b/redhat/self-test/data/centos-fce15c45d3fb.el7.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-fce15c45d3fb.el7.spec +++ b/redhat/self-test/data/centos-fce15c45d3fb.el7.spec @@ -12,4 +12,5 @@ %define specrelease 0.rc5.fce15c45d3fb.6%{?buildid}%{?dist} %define kabiversion 5.16.0-0.rc5.fce15c45d3fb.6.test.el7 %define selftests_must_build 0 +%define bpftoolversion 7.2.0 Mon Mar 28 2022 Fedora Kernel Team <kernel-team@xxxxxxxxxxxxxxxxx> [5.16.0-0.rc5.fce15c45d3fb.6.test] diff --git a/redhat/self-test/data/centos-fce15c45d3fb.fc25 b/redhat/self-test/data/centos-fce15c45d3fb.fc25 index blahblah..blahblah 100644 --- a/redhat/self-test/data/centos-fce15c45d3fb.fc25 +++ b/redhat/self-test/data/centos-fce15c45d3fb.fc25 @@ -63,6 +63,7 @@ RPM=../redhat/rpm RPMBUILD=rpmbuild SNAPSHOT=1 SOURCES=../redhat/rpm/SOURCES +SPECBPFTOOLVERSION=7.2.0 SPECBUILD=0.rc5.fce15c45d3fb.6.test SPECCHANGELOG=kernel.changelog-9.99 SPECFILE=kernel.spec diff --git a/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec b/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec index blahblah..blahblah 100755 --- a/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec +++ b/redhat/self-test/data/centos-fce15c45d3fb.fc25.spec @@ -12,4 +12,5 @@ %define specrelease 0.rc5.fce15c45d3fb.6%{?buildid}%{?dist} %define kabiversion 5.16.0-0.rc5.fce15c45d3fb.6.test.fc25 %define selftests_must_build 0 +%define bpftoolversion 7.2.0 Mon Mar 28 2022 Fedora Kernel Team <kernel-team@xxxxxxxxxxxxxxxxx> [5.16.0-0.rc5.fce15c45d3fb.6.test] diff --git a/redhat/self-test/data/fedora-2585cf9dfaad.el7 b/redhat/self-test/data/fedora-2585cf9dfaad.el7 index blahblah..blahblah 100644 --- a/redhat/self-test/data/fedora-2585cf9dfaad.el7 +++ b/redhat/self-test/data/fedora-2585cf9dfaad.el7 @@ -63,6 +63,7 @@ RPM=../redhat/rpm RPMBUILD=rpmbuild SNAPSHOT=0 SOURCES=../redhat/rpm/SOURCES +SPECBPFTOOLVERSION=7.2.0 SPECBUILD=0.rc5.6.test SPECCHANGELOG=kernel.changelog-9.99 SPECFILE=kernel.spec -- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2295 _______________________________________________ kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue