Update to RHEL packaging and rebuild for RHEL
Resolves: RHEL-30627 RHEL packaging of libbpf differs from the Fedora one as in RHEL, we are building libbpf directly from the kernel source tree (not GitHub repo). Therefore, the "source" is the corresponding kernel tarball. The reason for this difference is that BPF selftests (the only way of testing libbpf) are not able to work with system-wide libbpf (i.e. the one we would build from GitHub). The changes to specfile are mostly taken from the c9s specfile, with some minor changes. Signed-off-by: Viktor Malik <vmalik@redhat.com>
This commit is contained in:
parent
1730ed48fd
commit
b3cd568953
1
.gitignore
vendored
1
.gitignore
vendored
@ -15,3 +15,4 @@
|
|||||||
/libbpf-Fix-null-pointer-dereference-in-find_prog_by_.patch
|
/libbpf-Fix-null-pointer-dereference-in-find_prog_by_.patch
|
||||||
/v1.1.0.tar.gz
|
/v1.1.0.tar.gz
|
||||||
/v1.2.0.tar.gz
|
/v1.2.0.tar.gz
|
||||||
|
/linux-6.9.0-0.rc6.4.test.el10.tar.xz
|
||||||
|
44
libbpf.spec
44
libbpf.spec
@ -1,17 +1,20 @@
|
|||||||
%global githubname libbpf
|
# We build libbpf from RHEL kernel sources, that's why we use
|
||||||
%global githubver 1.2.0
|
# directly kernel tar for RHEL kernel build.
|
||||||
%global githubfull %{githubname}-%{githubver}
|
# We update libbpf's 'sources' file with proper hash that's
|
||||||
%global libver 1.2.0
|
# used as kernel tar.
|
||||||
|
|
||||||
Name: %{githubname}
|
# RHEL kernel version-release
|
||||||
Version: %{githubver}
|
%define kver 6.9.0-0.rc6.4.test
|
||||||
Release: 3%{?dist}
|
%define source linux-%{kver}%{?dist}
|
||||||
|
|
||||||
|
Name: libbpf
|
||||||
|
Version: 1.4.0
|
||||||
|
Release: 1%{?dist}
|
||||||
Summary: Libbpf library
|
Summary: Libbpf library
|
||||||
|
|
||||||
License: LGPL-2.1-only OR BSD-2-Clause
|
License: LGPL-2.1-only OR BSD-2-Clause
|
||||||
URL: https://github.com/%{githubname}/%{githubname}
|
Source0: %{source}.tar.xz
|
||||||
Source: https://github.com/%{githubname}/%{githubname}/archive/v%{githubver}.tar.gz
|
BuildRequires: gcc elfutils-libelf-devel elfutils-devel python3
|
||||||
BuildRequires: gcc elfutils-libelf-devel elfutils-devel
|
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
|
|
||||||
# This package supersedes libbpf from kernel-tools,
|
# This package supersedes libbpf from kernel-tools,
|
||||||
@ -27,7 +30,7 @@ ABI.
|
|||||||
%package devel
|
%package devel
|
||||||
Summary: Development files for %{name}
|
Summary: Development files for %{name}
|
||||||
Requires: %{name} = 2:%{version}-%{release}
|
Requires: %{name} = 2:%{version}-%{release}
|
||||||
Requires: kernel-headers >= 5.16.0
|
Requires: kernel-headers >= %{kver}
|
||||||
Requires: zlib
|
Requires: zlib
|
||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
@ -44,21 +47,22 @@ developing applications that use %{name}
|
|||||||
|
|
||||||
%define _lto_cflags %{nil}
|
%define _lto_cflags %{nil}
|
||||||
|
|
||||||
%global make_flags PREFIX=%{_prefix} INCLUDEDIR=%{_includedir} DESTDIR=%{buildroot} \
|
%global libbpf_make \
|
||||||
OBJDIR=%{_builddir} CFLAGS="%{build_cflags} -fPIC" LDFLAGS="%{build_ldflags} \
|
make prefix=%{_prefix} DESTDIR=%{buildroot} OBJDIR=%{_builddir} CFLAGS="%{build_cflags} -fPIC" LDFLAGS="%{build_ldflags} -Wl,--no-as-needed" LIBDIR=/%{_libdir} NO_PKG_CONFIG=1
|
||||||
-Wl,--no-as-needed" LIBDIR=/%{_libdir} NO_PKG_CONFIG=1
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{githubfull} -p1
|
%setup -n %{source}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%make_build -C ./src %{make_flags}
|
pushd tools/lib/bpf
|
||||||
|
%{libbpf_make}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install -C ./src %{make_flags}
|
pushd tools/lib/bpf
|
||||||
|
%{libbpf_make} install
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%{_libdir}/libbpf.so.%{libver}
|
%{_libdir}/libbpf.so.%{version}
|
||||||
%{_libdir}/libbpf.so.1
|
%{_libdir}/libbpf.so.1
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
@ -70,6 +74,10 @@ developing applications that use %{name}
|
|||||||
%{_libdir}/libbpf.a
|
%{_libdir}/libbpf.a
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue May 07 2024 Viktor Malik <vmalik@redhat.com> - 2:1.4.0-1
|
||||||
|
- Rebuild from latest RHEL 10.0 Beta source tree
|
||||||
|
- Resolves: RHEL-30627
|
||||||
|
|
||||||
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2:1.2.0-3
|
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2:1.2.0-3
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||||
|
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (v1.2.0.tar.gz) = b5291e807a3c83cb80a47e3518a3ab5ad0b0e6157842117c0684c32e525dce0cca199c3c9028390b94a73ff968391aa023312d3b8bd7472aff1c9ee5206c424e
|
SHA512 (linux-6.9.0-0.rc6.4.test.el10.tar.xz) = e688250dcb4035f3a70e4b7eff1855368dd65457543506d5f4abe340da904e0340139395e40e679fcdf61280163f9231ac89a90afb564d95f5814ac46a0711bf
|
||||||
|
Loading…
Reference in New Issue
Block a user