commit 678c0dae57ad1a6aff80334d36b53e12f9165834ed35d7340a5e49d6c21a74f0 Author: Adam Majer Date: Sun Oct 20 11:27:25 2019 +0000 Accepting request 741294 from home:mrostecki Initial release OBS-URL: https://build.opensuse.org/request/show/741294 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libbpf?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-makefile-Fix-install-target.patch b/0001-makefile-Fix-install-target.patch new file mode 100644 index 0000000..03a04c9 --- /dev/null +++ b/0001-makefile-Fix-install-target.patch @@ -0,0 +1,47 @@ +From dc3d79cff48b9a2034e8b0378bca221b57f4e300 Mon Sep 17 00:00:00 2001 +From: Michal Rostecki +Date: Tue, 1 Oct 2019 13:09:00 +0200 +Subject: [PATCH] makefile: Fix install target + +Before this change, the install target was failing with the following +error: + + make: Entering directory '/home/mrostecki/repos/libbpf/src' + if [ ! -d '/usr/include/bpf' ]; then install -d -m 755 '/usr/include/bpf'; fi; install bpf.h libbpf.h btf.h xsk.h libbpf_util.h -m 644 '/usr/include/bpf' + if [ ! -d '/usr/lib64/pkgconfig' ]; then install -d -m 755 '/usr/lib64/pkgconfig'; fi; install ./libbpf.pc -m 644 '/usr/lib64/pkgconfig' + if [ ! -d '/usr/lib64' ]; then install -d -m 755 '/usr/lib64'; fi; cp -fpR '/usr/lib64' + cp: missing destination file operand after '/usr/lib64' + Try 'cp --help' for more information. + make: *** [Makefile:119: install] Error 1 + make: Leaving directory '/home/mrostecki/repos/libbpf/src' + +That error occured due to usage of non-existing variable $(LIBS). After +this change, $(SHARED_LIBS) and $(STATIC_LIBS) are used instead, which +fixes the behavior of the install target. + +Fixes: 8b2782a1f250 ("makefile: support libbpf symbol versioning in shared library mode") +Signed-off-by: Michal Rostecki +--- + src/Makefile | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index 57510ca..28a470f 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -116,7 +116,11 @@ define do_s_install + endef + + install: all install_headers install_pkgconfig +- $(call do_s_install,$(LIBS),$(LIBDIR)) ++ifndef BUILD_STATIC_ONLY ++ $(call do_s_install,$(SHARED_LIBS) $(STATIC_LIBS),$(LIBDIR)) ++else ++ ${call do_s_install,$(STATIC_LIBS),$(LIBDIR)) ++endif + + install_headers: + $(call do_install,$(HEADERS),$(INCLUDEDIR)/bpf,644) +-- +2.23.0 + diff --git a/_service b/_service new file mode 100644 index 0000000..e0655e3 --- /dev/null +++ b/_service @@ -0,0 +1,16 @@ + + + https://github.com/libbpf/libbpf + git + libbpf + @PARENT_TAG@ + v(.*) + v0.0.5 + + + + *.tar + xz + + + diff --git a/libbpf-0.0.5.obscpio b/libbpf-0.0.5.obscpio new file mode 100644 index 0000000..fd758e0 --- /dev/null +++ b/libbpf-0.0.5.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a757f3cdff12dc0b2d7b1ef3e44a4796a5aa9905c50b383525d9867633952828 +size 632332 diff --git a/libbpf.changes b/libbpf.changes new file mode 100644 index 0000000..5db2e1f --- /dev/null +++ b/libbpf.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Tue Oct 1 09:15:18 UTC 2019 - MichaƂ Rostecki + +- Initial release diff --git a/libbpf.obsinfo b/libbpf.obsinfo new file mode 100644 index 0000000..c215d86 --- /dev/null +++ b/libbpf.obsinfo @@ -0,0 +1,5 @@ +name: libbpf +version: 0.0.5 +mtime: 1569904962 +commit: 8b2782a1f250f58aafe38b2cd718aa3dc8ad58ed + diff --git a/libbpf.spec b/libbpf.spec new file mode 100644 index 0000000..2286181 --- /dev/null +++ b/libbpf.spec @@ -0,0 +1,74 @@ +# +# spec file for package libbpf +# +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +%define sover_major 0 +%define libname libbpf%{sover_major} + +Name: libbpf +Version: 0.0.5 +Release: 0 +Summary: C library for managing eBPF programs and maps +License: LGPL-2.1 +Group: Development/Languages/C and C++ +Url: https://github.com/libbpf/libbpf +Source: %{name}-%{version}.tar.xz +Patch0: 0001-makefile-Fix-install-target.patch +BuildRequires: libelf-devel + +%description +libbpf is a C library which provides API for managing eBPF programs and maps. + +%package -n %{libname} +Summary: C library for managing eBPF programs and maps +Group: System/Libraries + +%description -n %{libname} +libbpf is a C library which provides API for managing eBPF programs and maps. + +%package devel +Summary: Development files for libbpf +Group: Development/Libraries/C and C++ +Requires: %{libname} = %{version} + +%description devel +libbpf is a C library which provides API for managing eBPF programs and maps. + +%prep +%setup -q +%patch0 -p1 + +%build +%make_build -C src/ + +%install +%make_install -C src/ +rm -f %{buildroot}%{_libdir}/%{name}.a + +%post -n %{libname} -p /sbin/ldconfig +%postun -n %{libname} -p /sbin/ldconfig + +%files -n %{libname} +%{_libdir}/%{name}.so.%{sover_major}* + +%files devel +%{_includedir}/bpf +%{_libdir}/%{name}.so +%{_libdir}/pkgconfig/%{name}.pc + +%changelog +