libbpf/libbpf.spec
2023-04-28 20:08:01 +08:00

119 lines
4.7 KiB
RPMSpec

%global githubname libbpf
%global githubver 0.3
%global githubfull %{githubname}-%{githubver}
Name: %{githubname}
Version: %{githubver}
Release: 6
Summary: Libbpf library
License: LGPLv2 or BSD
URL: https://github.com/%{githubname}/%{githubname}
Source: https://github.com/%{githubname}/%{githubname}/archive/v%{githubver}.tar.gz
BuildRequires: gcc elfutils-libelf-devel elfutils-devel
Patch6000: backport-libbpf-Support-detecting-and-attaching-of-writable-t.patch
Patch6001: backport-libbpf-Ensure-functions-with-always_inline-attribute-are-inline.patch
Patch6002: backport-libbpf-Fix-the-name-of-a-reused-map.patch
Patch6003: backport-libbpf-preserve-errno-across-pr_warn-pr_info-pr_debug.patch
Patch6004: backport-libbpf-Fix-determine_ptr_size-guessing.patch
Patch6005: backport-libbpf-Avoid-unused-function-warning-on-bpf_tail_call_static.patch
Patch6006: backport-libbpf-Fix-crash-if-SEC-freplace-programs-don-t-have.patch
Patch6007: backport-libbpf-Fix-the-case-of-running-as-non-root-with-capa.patch
Patch6008: backport-libbpf-Fix-overrun-in-netlink-attribute-iteration.patch
Patch6009: backport-libbpf-Fix-use-after-free-in-btf_dump_name_dups.patch
Patch6010: backport-libbpf-Deal-with-section-with-no-data-gracefully.patch
Patch6011: backport-libbpf-Fix-null-pointer-dereference-in-find_prog_by_.patch
Patch6012: backport-sync-start-syncing-include-uapi-linux-fcntl.h-UAPI-h.patch
Patch6013: backport-libbpf-Handle-size-overflow-for-ringbuf-mmap.patch
Patch6014: backport-libbpf-Use-page-size-as-max_entries-when-probing-rin.patch
# This package supersedes libbpf from kernel-tools,
# which has default Epoch: 0. By having Epoch: 1
# 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}
%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}
%global make_flags DESTDIR=%{buildroot} OBJDIR=%{_builddir} CFLAGS="%{build_cflags} -fPIC -Werror" LDFLAGS="%{build_ldflags} -Werror -Wl,--no-as-needed -Wl,-z,noexecstack" LIBDIR=/%{_libdir} NO_PKG_CONFIG=1
%prep
%autosetup -n %{githubfull} -p1
%build
%make_build -C ./src %{make_flags}
%install
%make_install -C ./src %{make_flags}
%files
%{_libdir}/libbpf.so.0.3.0
%{_libdir}/libbpf.so.0
%files devel
%{_libdir}/libbpf.so
%{_includedir}/bpf/
%{_libdir}/pkgconfig/libbpf.pc
%files static
%{_libdir}/libbpf.a
%changelog
* Thu May 4 2023 zhangmingyi <zhangmingyi5@huawei.com> -2:0.3-6
- add -Werror -Wl,-z,noexecstack options
* Tue Mar 21 2023 zhangmingyi <zhangmingyi5@huawei.com> - 2:0.3-5
- backporting patches from upstream:
backport-libbpf-Fix-crash-if-SEC-freplace-programs-don-t-have.patch
backport-libbpf-Fix-the-case-of-running-as-non-root-with-capa.patch
backport-libbpf-Fix-overrun-in-netlink-attribute-iteration.patch
backport-libbpf-Fix-use-after-free-in-btf_dump_name_dups.patch
backport-libbpf-Deal-with-section-with-no-data-gracefully.patch
backport-libbpf-Fix-null-pointer-dereference-in-find_prog_by_.patch
backport-sync-start-syncing-include-uapi-linux-fcntl.h-UAPI-h.patch
backport-libbpf-Handle-size-overflow-for-ringbuf-mmap.patch
backport-libbpf-Use-page-size-as-max_entries-when-probing-rin.patch
* Sun Jan 29 2023 zhangmingyi <zhangmingyi5@huawei.com> - 2:0.3-4
- backporting: Avoid unused function warning on bpf_tail_call_static
* Wed Jan 18 2023 zhangmingyi <zhangmingyi5@huawei.com> - 2:0.3-3
- Fix determine_ptr_size() guessing
* Sun Jan 15 2023 zhangmingyi <zhangmingyi5@huawei.com> - 2:0.3-2
- backporting: backport-libbpf-Ensure-functions-with-always_inline-attribute-are-inline.patch
backport-libbpf-Fix-the-name-of-a-reused-map.patch
backport-libbpf-preserve-errno-across-pr_warn-pr_info-pr_debug.patch
* Tue Aug 23 2022 hujiawang<hujiawang1@huawei.com> - 2:0.3-1
- updata libbpf v0.1.1 to v0.3
* Wed Nov 10 2021 Lv Ying<lvying6@huawei.com> - 0.1.1-2
- support detecting and attaching of writable tracepoint program
https://lore.kernel.org/bpf/20211004094857.30868-3-hotforest@gmail.com
* Tue Nov 17 2020 nlgwcy <wuchangye@huawei.com> - 0.1.1-1
- update libbpf from v0.0.6 to v0.1.1
* Sun Apr 26 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.0.6-1
- Package init