From ccf50bd6529df0d32b1c6e6aa7694e5b2aada25a Mon Sep 17 00:00:00 2001 From: "M. Vefa Bicakci" Date: Wed, 27 Oct 2021 15:50:29 -0400 Subject: [PATCH] Add libbpf v0.5.0 This commit adds libbpf-0.5.0, because recent versions of iproute depend on it. 0.5.0 is the latest released version as of this writing. Verification: - Successfully built in a monolithic build environment. - In conjunction with I63d557112c653d59b88ac3a4798dee0e89246612, the sample eBPF test programs and scripts in the v5.10 kernel's source tree were successfully executed. Partial-Bug: #1949217 Signed-off-by: M. Vefa Bicakci Change-Id: I24bb7c60e353643add5e63ae7ea7c6516d07c7bf --- centos_pkg_dirs | 1 + centos_tarball-dl.lst | 1 + tools/libbpf/centos/build_srpm.data | 2 + tools/libbpf/centos/libbpf.spec | 109 ++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 tools/libbpf/centos/build_srpm.data create mode 100644 tools/libbpf/centos/libbpf.spec diff --git a/centos_pkg_dirs b/centos_pkg_dirs index 53369f28d..2625e74bc 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -95,4 +95,5 @@ base/inih base/pf-bb-config gpu/gpu-operator tools/kexec-tools +tools/libbpf networking/iproute diff --git a/centos_tarball-dl.lst b/centos_tarball-dl.lst index e4da861fc..1e6b5bb0f 100644 --- a/centos_tarball-dl.lst +++ b/centos_tarball-dl.lst @@ -48,6 +48,7 @@ kubernetes-v1.20.9.tar.gz#kubernetes-1.20.9#https://github.com/kubernetes/kubern kubernetes-v1.21.3.tar.gz#kubernetes-1.21.3#https://github.com/kubernetes/kubernetes/archive/refs/tags/v1.21.3.tar.gz#http## kvm-unit-tests.git-4ea7633.tar.bz2#kvm-unit-tests#https://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git/snapshot/kvm-unit-tests-20171020.tar.gz#http## ldapscripts-2.0.8.tgz#ldapscripts-2.0.8#https://sourceforge.net/projects/ldapscripts/files/ldapscripts/ldapscripts-2.0.8/ldapscripts-2.0.8.tgz/download#http## +libbpf-0.5.0.tar.gz#libbpf-0.5.0#https://github.com/libbpf/libbpf/archive/v0.5.0.tar.gz#https## libtpms-0.6.0-4f0d59d.tar.gz#libtpms-0.6.0#https://github.com/stefanberger/libtpms/tarball/c421ca0f4d00c0caceeda8d62c1efb2b7e47db04#http## lldpd-0.9.0.tar.gz#lldpd-0.9.0#https://media.luffy.cx/files/lldpd/lldpd-0.9.0.tar.gz#http## lua-1fce39c6397056db645718b8f5821571d97869a4.tar.gz#lua#https://api.github.com/repos/ceph/lua/tarball/1fce39c6397056db645718b8f5821571d97869a4#https## diff --git a/tools/libbpf/centos/build_srpm.data b/tools/libbpf/centos/build_srpm.data new file mode 100644 index 000000000..13c6948c2 --- /dev/null +++ b/tools/libbpf/centos/build_srpm.data @@ -0,0 +1,2 @@ +COPY_LIST="$STX_BASE/downloads/libbpf-0.5.0.tar.gz" +TIS_PATCH_VER=PKG_GITREVCOUNT diff --git a/tools/libbpf/centos/libbpf.spec b/tools/libbpf/centos/libbpf.spec new file mode 100644 index 000000000..34290a8b7 --- /dev/null +++ b/tools/libbpf/centos/libbpf.spec @@ -0,0 +1,109 @@ +%global githubname libbpf +%global githubver 0.5.0 +%global githubfull %{githubname}-%{githubver} + +Name: %{githubname} +Version: %{githubver} +Release: 1%{?_tis_dist}.%{tis_patch_ver} +Summary: Libbpf library + +License: LGPLv2 or BSD +URL: https://github.com/%{githubname}/%{githubname} +Source: %{githubname}-%{githubver}.tar.gz +BuildRequires: gcc elfutils-libelf-devel elfutils-devel +BuildRequires: make +%if 0%{?rhel} == 7 +BuildRequires: devtoolset-8-build +BuildRequires: devtoolset-8-binutils +BuildRequires: devtoolset-8-gcc +BuildRequires: devtoolset-8-make +%endif + +# This package supersedes libbpf from kernel-tools, +# which has default Epoch: 0. By having Epoch: > 0 +# this libbpf will take over smoothly +Epoch: 2 + +%description +A mirror of bpf-next linux tree bpf-next/tools/lib/bpf directory plus its +supporting header files. The version of the package reflects the version of +ABI. + +%package devel +Summary: Development files for %{name} +Requires: %{name} = 2:%{version}-%{release} +Requires: kernel-headers >= 5.10.0 +Requires: zlib + +%description devel +The %{name}-devel package contains libraries header files for +developing applications that use %{name} + +%package static +Summary: Static library for libbpf development +Requires: %{name}-devel = 2:%{version}-%{release} + +%description static +The %{name}-static package contains static library for +developing applications that use %{name} + +%define _lto_cflags %{nil} + +%global make_flags DESTDIR=%{buildroot} OBJDIR=%{_builddir} CFLAGS="%{build_cflags} -fPIC" LDFLAGS="%{build_ldflags} -Wl,--no-as-needed" LIBDIR=/%{_libdir} NO_PKG_CONFIG=1 + +%prep +%if 0%{?rhel} == 7 +source scl_source enable devtoolset-8 || : +%endif + +%autosetup -n %{githubfull} + +%build +%if 0%{?rhel} == 7 +source scl_source enable devtoolset-8 || : +%endif + +%make_build -C ./src %{make_flags} + +%install +%if 0%{?rhel} == 7 +source scl_source enable devtoolset-8 || : +%endif + +%make_install -C ./src %{make_flags} + +%files +%{_libdir}/libbpf.so.%{version} +%{_libdir}/libbpf.so.0 + +%files devel +%{_libdir}/libbpf.so +%{_includedir}/bpf/ +%{_libdir}/pkgconfig/libbpf.pc + +%files static +%{_libdir}/libbpf.a + +%changelog +* Wed Oct 27 2021 M. Vefa Bicakci - 2:0.5.0-1.tis +- Adapt to StarlingX. The base spec file was acquired from: + https://src.fedoraproject.org/rpms/libbpf/blob/main/f/libbpf.spec +- Change the kernel-headers requirement from 5.14.0 to 5.10.0. This should + not be an issue, as libbpf advertises itself to be kernel-version agnostic. +- Add build-time dependency on devtoolset-8 and make the build use it. +- Trim all changelog entries belonging to years before 2021. + +* Fri Sep 10 2021 Jiri Olsa - 2:0.5.0-1 +- release 0.5.0-1 + +* Thu Jul 22 2021 Fedora Release Engineering - 2:0.4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed May 26 2021 Jiri Olsa - 2:0.4.0-1 +- release 0.4.0-1 + +* Tue Jan 26 2021 Fedora Release Engineering - 2:0.3.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Fri Jan 22 2021 Jiri Olsa - 2:0.3.0-1 +- release 0.3.0-1