diff --git a/libbpf-0.4.0.tar.gz b/libbpf-0.4.0.tar.gz new file mode 100644 index 0000000..1eaa833 --- /dev/null +++ b/libbpf-0.4.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21cbee4df093e7fd29e76ed429650d3f3abe3a893f35e346ab9bc3484f6e68c0 +size 1015782 diff --git a/libbpf.changes b/libbpf.changes index a05541a..92cc661 100644 --- a/libbpf.changes +++ b/libbpf.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sat Jul 17 15:38:52 UTC 2021 - Michal Suchanek + +- libbpf is now a separate project, stop building from the kernel + (bsc#1188419 jsc#SLE-17288 jsc#SLE-18805). +- Fix LIBSUBDIR + + libdir.patch + ------------------------------------------------------------------- Mon Jun 8 23:52:39 UTC 2020 - MichaƂ Rostecki diff --git a/libbpf.spec b/libbpf.spec index 5e4be69..07368df 100644 --- a/libbpf.spec +++ b/libbpf.spec @@ -1,7 +1,7 @@ # # spec file for package libbpf # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,15 +19,17 @@ %define sover_major 0 %define libname libbpf%{sover_major} Name: libbpf -%define version %(rpm -q --qf '%%{VERSION}' kernel-source) -Version: %{version} +Version: 0.4.0 Release: 0 Summary: C library for managing eBPF programs and maps License: LGPL-2.1-only -URL: http://www.kernel.org/ -BuildRequires: kernel-source +URL: https://github.com/libbpf/libbpf +Source: https://github.com/libbpf/libbpf/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/libbpf/libbpf/issues/337 +Patch: libdir.patch BuildRequires: libelf-devel BuildRequires: python3 +BuildRequires: zlib-devel %description libbpf is a C library which provides API for managing eBPF programs and maps. @@ -46,27 +48,15 @@ Requires: %{libname} = %{version} libbpf is a C library which provides API for managing eBPF programs and maps. %prep -(cd /usr/src/linux ; tar -cf - COPYING CREDITS README tools include scripts Kbuild Makefile arch/*/{include,lib,Makefile} kernel/bpf lib) | tar -xf - -cp /usr/src/linux/LICENSES/preferred/GPL-2.0 . -sed -i -e 's/CFLAGS += -O2/CFLAGS = $(RPM_OPT_FLAGS)/' Makefile +%setup -q %build -cd tools/lib/bpf -%if %{__isa_bits} == 64 -%make_build CFLAGS="%{optflags}" LP64=1 -%else -%make_build CFLAGS="%{optflags}" -%endif +cd src +%make_build V=1 CFLAGS="%{optflags} -fno-lto" %install -cd tools/lib/bpf -%if %{__isa_bits} == 64 -%make_install prefix=/usr LP64=1 -%else -%make_install prefix=/usr -%endif -make install_headers prefix=%{buildroot}/usr - +cd src +%make_install V=1 LIBDIR=%{_libdir} rm -f %{buildroot}%{_libdir}/%{name}.a %post -n %{libname} -p /sbin/ldconfig @@ -76,6 +66,8 @@ rm -f %{buildroot}%{_libdir}/%{name}.a %{_libdir}/%{name}.so.%{sover_major}* %files devel +%license LICENSE LICENSE.BSD-2-Clause LICENSE.LGPL-2.1 +%doc README.md %{_includedir}/bpf %{_libdir}/%{name}.so %{_libdir}/pkgconfig/%{name}.pc diff --git a/libdir.patch b/libdir.patch new file mode 100644 index 0000000..2cf0dd1 --- /dev/null +++ b/libdir.patch @@ -0,0 +1,33 @@ +From 60ab75597d2735e8f7bf91e4423feab87568d1e7 Mon Sep 17 00:00:00 2001 +From: Michal Suchanek +Date: Sun, 18 Jul 2021 22:05:01 +0200 +Subject: [PATCH] Makefile: Default LIBSUBDIR to lib64 on 64bit architectures. + +commit a82a66e ("Extend build and add install rules to Makefile") adds +special handling for LIBSUBDIR on x86_64. Expand this to all +architectures with 64 in name which suggests a 32bit variant exists, and +s390x which is 64bit extension of s390. + +Fixes: #337 +Fixes: a82a66e ("Extend build and add install rules to Makefile") +Signed-off-by: Michal Suchanek +--- + src/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index 8161fec..8bf1d8a 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -60,7 +60,7 @@ INSTALL = install + + DESTDIR ?= + +-ifeq ($(shell uname -m),x86_64) ++ifeq ($(filter-out %64 %64be %64eb %64le %64el s390x, $(shell uname -m)),) + LIBSUBDIR := lib64 + else + LIBSUBDIR := lib +-- +2.32.0 +