SHA256
1
0
forked from pool/libbpf

Accepting request 772910 from home:mrostecki:branches:devel:libraries:c_c++

- Build libbpf from kernel sources, not from github sources, for
  consistency with bpftool package.

OBS-URL: https://build.opensuse.org/request/show/772910
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libbpf?expand=0&rev=3
This commit is contained in:
Michał Rostecki 2020-02-10 15:01:06 +00:00 committed by Git OBS Bridge
parent a53a02a589
commit d17435cca4
3 changed files with 27 additions and 9 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Feb 2 19:50:55 UTC 2020 - Michał Rostecki <mrostecki@opensuse.org>
- Build libbpf from kernel sources, not from github sources, for
consistency with bpftool package.
-------------------------------------------------------------------
Tue Jan 7 14:36:44 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>

View File

@ -19,13 +19,14 @@
%define sover_major 0
%define libname libbpf%{sover_major}
Name: libbpf
Version: 0.0.6
%define version %(rpm -q --qf '%%{VERSION}' kernel-source)
Version: %{version}
Release: 0
Summary: C library for managing eBPF programs and maps
License: LGPL-2.1-only
URL: https://github.com/libbpf/libbpf
Source: https://github.com/libbpf/libbpf/archive/v%{version}.tar.gz
URL: http://www.kernel.org/
BuildRequires: libelf-devel
BuildRequires: kernel-source
%description
libbpf is a C library which provides API for managing eBPF programs and maps.
@ -44,13 +45,27 @@ Requires: %{libname} = %{version}
libbpf is a C library which provides API for managing eBPF programs and maps.
%prep
%setup -q
(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
%build
%make_build -C src/ CFLAGS="%{optflags}"
cd tools/lib/bpf
%if %{__isa_bits} == 64
%make_build CFLAGS="%{optflags}" LP64=1
%else
%make_build CFLAGS="%{optflags}"
%endif
%install
%make_install -C src/
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
rm -f %{buildroot}%{_libdir}/%{name}.a
%post -n %{libname} -p /sbin/ldconfig

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dbed8304077699fd59b0271545ac5923a6e0581db4ef90d6124efa6fe9df84c1
size 213791