libbpf/libbpf.spec
superCharge-xsy f58bd2f4a7 backport patches from upstream:backport-libbpf-Fix-an-error-in-64bit-relocation-value-comput.patch
Signed-off-by: superCharge-xsy <xiesongyang@huawei.com>
(cherry picked from commit 767848cdce2c8335a84af7d2a2cabe4ceeb7b2de)
2024-06-24 19:02:13 +08:00

180 lines
7.7 KiB
RPMSpec

%global githubname libbpf
%global githubver 0.8.1
%global githubfull %{githubname}-%{githubver}
Name: %{githubname}
Version: %{githubver}
Release: 14
Summary: Libbpf library
License: LGPLv2 or BSD
URL: https://github.com/%{githubname}/%{githubname}
Source: https://github.com/%{githubname}/%{githubname}/archive/refs/tags/v%{githubver}.tar.gz
BuildRequires: gcc elfutils-libelf-devel elfutils-devel
#patches
Patch0000: backport-libbpf-Fix-determine_ptr_size-guessing.patch
Patch0001: backport-libbpf-preserve-errno-across-pr_warn-pr_info-pr_debug.patch
Patch0002: backport-libbpf-Ensure-functions-with-always_inline-attribute-are-inline.patch
Patch0003: backport-libbpf-Fix-the-name-of-a-reused-map.patch
Patch0004: backport-libbpf-Fix-crash-if-SEC-freplace-programs-don-t-have.patch
Patch0005: backport-libbpf-Fix-the-case-of-running-as-non-root-with-capa.patch
Patch0006: backport-libbpf-Fix-overrun-in-netlink-attribute-iteration.patch
Patch0007: backport-libbpf-Fix-use-after-free-in-btf_dump_name_dups.patch
Patch0008: backport-libbpf-Deal-with-section-with-no-data-gracefully.patch
Patch0009: backport-libbpf-Fix-null-pointer-dereference-in-find_prog_by_.patch
Patch0010: backport-sync-start-syncing-include-uapi-linux-fcntl.h-UAPI-h.patch
Patch0011: backport-libbpf-Handle-size-overflow-for-ringbuf-mmap.patch
Patch0012: backport-libbpf-Use-page-size-as-max_entries-when-probing-rin.patch
Patch0013: backport-libbpf-Fix-alen-calculation-in-libbpf_nla_dump_error.patch
Patch0014: backport-libbpf-Disable-SEC-pragma-macro-on-GCC.patch
Patch0015: backport-libbpf-disassociate-section-handler-on-explicit-bpf_.patch
Patch0016: backport-libbpf-Use-correct-return-pointer-in-attach_raw_tp.patch
Patch0017: backport-libbpf-Use-elf_getshdrnum-instead-of-e_shnum.patch
Patch0018: backport-libbpf-Ensure-FD-3-during-bpf_map__reuse_fd.patch
Patch0019: backport-libbpf-Ensure-libbpf-always-opens-files-with-O_CLOEX.patch
Patch0020: 0001-remove-nonexistent-helper-functions-and-add-new-help.patch
Patch0021: backport-libbpf-Fix-realloc-API-handling-in-zero-sized-edge-cases.patch
Patch0022: backport-libbpf-Set-close-on-exec-flag-on-gzopen.patch
Patch0023: backport-libbpf-Fix-is_pow_of_2.patch
Patch0024: backport-libbpf-make-RINGBUF-map-size-adjustments-more-eagerly.patch
Patch0025: backport-libbpf-Fix-NULL-pointer-dereference-in_bpf_object__c.patch
Patch0026: backport-libbpf-Fix-str_has_sfxs-return-value.patch
Patch0027: backport-libbpf-Initialize-err-in-probe_map_create.patch
Patch0028: backport-libbpf-Modify-the-function-name-in-libbpf.c-to-match.patch
Patch0029: backport-libbpf-Fix-an-error-in-64bit-relocation-value-comput.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}
Requires: kernel-headers >= 5.10.0
%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.%{githubver}
%{_libdir}/libbpf.so.0
%files devel
%{_libdir}/libbpf.so
%{_includedir}/bpf/
%{_libdir}/pkgconfig/libbpf.pc
%files static
%{_libdir}/libbpf.a
%changelog
* Thu Jun 20 2024 xiesongyang <xiesongyang@huawei.com> - 2:0.8.1-14
- backport patch from upstream:
backport-libbpf-Fix-an-error-in-64bit-relocation-value-comput.patch
* Sun Apr 28 2024 jinzhiguang <jinzhiguang@kylinos.cn> - 2:0.8.1-13
- backport patch from upstream:
backport-libbpf-Modify-the-function-name-in-libbpf.c-to-match.patch
* Mon Apr 15 2024 zhangmingyi <zhangmingyi5@huawei.com> 2:0.8.1-12
- backport patches from upstream:
backport-libbpf-Fix-NULL-pointer-dereference-in_bpf_object__c.patch
backport-libbpf-Fix-str_has_sfxs-return-value.patch
backport-libbpf-Initialize-err-in-probe_map_create.patch
* Thu Dec 7 2023 zhangmingyi <zhangmingyi5@huawei.com> 2:0.8.1-11
- backport patches from upstream:
backport-libbpf-Fix-realloc-API-handling-in-zero-sized-edge-cases.patch
backport-libbpf-Set-close-on-exec-flag-on-gzopen.patch
backport-libbpf-Fix-is_pow_of_2.patch
backport-libbpf-make-RINGBUF-map-size-adjustments-more-eagerly.patch
* Fri Dec 1 2023 liningjie <liningjie@xfusion.com> 2:0.8.1-10
- backport patches from openEuler-22.03-LTS-SP2:
0001-remove-nonexistent-helper-functions-and-add-new-help.patch
* Mon Aug 14 2023 zhangmingyi <zhangmingyi5@huawei.com> 2:0.8.1-9
- backport patches from upstream:
backport-libbpf-Ensure-FD-3-during-bpf_map__reuse_fd.patch
backport-libbpf-Ensure-libbpf-always-opens-files-with-O_CLOEX.patch
* Sat May 13 2023 zhangmingyi <zhangmingyi5@huawei.com> -2:0.8.1-8
- backport patches from upstream:
backport-libbpf-disassociate-section-handler-on-explicit-bpf_.patch
backport-libbpf-Use-correct-return-pointer-in-attach_raw_tp.patch
backport-libbpf-Use-elf_getshdrnum-instead-of-e_shnum.patch
* Fri May 12 2023 zhangmingyi <zhangmingyi5@huawei.com> -2:0.8.1-7
- backport patches from upstream:
backport-libbpf-Disable-SEC-pragma-macro-on-GCC.patch
* Thu May 4 2023 SuperCharge <xiesongyang@huawei.com> -2:0.8.1-6
- backport patches from upstream:
backport-libbpf-Fix-alen-calculation-in-libbpf_nla_dump_error.patch
* Thu May 4 2023 zhangmingyi <zhangmingyi5@huawei.com> -2:0.8.1-5
- add -Werror -Wl,-z,noexecstack options
* Thu Feb 23 2023 JofDiamonds <kwb0523@163.com> -2:0.8.1-4
- backport patches from upstream:
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
* Fri Jan 6 2023 zhangmingyi<zhangmingyi5@huawei.com> - 2:0.8.1-3
-- 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
* Sat Nov 26 2022 zhangmingyi <zhangmingyi@huawei.com> -2:0.8.1-2
- libbpf.spec - modify Source address
* Tue Nov 8 2022 liuxin <liuxin350@huawei.com> - 2:0.8.1-1
- update libbpf from v0.3 to v0.8.1
* Wed Oct 26 2022 zhangmingyi <zhangmingyi5@huawei.com> - 2:0.3-3
- Fix determine_ptr_size() guessing
* Mon Aug 22 2022 hujiawang <hujiawang1@huawei.com> - 2:0.3-2
- change the package name
* Tue Dec 28 2021 sunsuwan <sunsuwan2@huawei.com> - 2:0.3-1
- update libbpf from v0.1.1 to v0.3
* Wed Oct 28 2020 hubble_zhu <hubble_zhu@qq.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