2 # Copyright (C) 2020-2023 Tony Ambardar <itugrok@yahoo.com>
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE_URL
:=https
://github.com
/libbpf
/libbpf
15 PKG_MIRROR_HASH
:=669d8db696f86f640f86edc358bffa2af8dda656b8e787b095de3578bd8d94ff
17 PKG_SOURCE_VERSION
:=v1.3
.0
18 PKG_ABI_VERSION
:=$(firstword $(subst .
,$(space
),$(PKG_VERSION
)))
20 PKG_MAINTAINER
:=Tony Ambardar
<itugrok@yahoo.com
>
21 PKG_CPE_ID
:=cpe
:/a
:libbpf_project
:libbpf
23 PKG_BUILD_FLAGS
:=no-mips16
27 include $(INCLUDE_DIR
)/package.mk
28 include $(INCLUDE_DIR
)/nls.mk
33 TITLE
:=libbpf
- eBPF helper library
34 LICENSE
:=LGPL-2.1 OR BSD-2-Clause
35 ABI_VERSION
:=$(PKG_ABI_VERSION
)
36 URL
:=http
://www.kernel.org
40 define Package
/libbpf
/description
41 libbpf is a library for loading eBPF programs and reading and manipulating eBPF objects from user-space.
45 EXTRA_CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
46 LDFLAGS
="$(TARGET_LDFLAGS)"
49 $(if
$(findstring c
,$(OPENWRT_VERBOSE
)),V
=1,V
='') \
54 define Build
/InstallDev
/libbpf
55 $(INSTALL_DIR
) $(1)/usr
/include/bpf
56 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/bpf
/*.h
$(1)/usr
/include/bpf
/
57 $(INSTALL_DIR
) $(1)/usr
/lib
58 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libbpf.
{a
,so
*} \
60 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
61 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libbpf.
pc \
62 $(1)/usr
/lib
/pkgconfig
/
63 $(SED
) 's,/usr/include,$$$${prefix}/include,g' \
64 $(1)/usr
/lib
/pkgconfig
/libbpf.
pc
65 $(SED
) 's,/usr/lib,$$$${exec_prefix}/lib,g' \
66 $(1)/usr
/lib
/pkgconfig
/libbpf.
pc
69 Build
/InstallDev
=$(Build
/InstallDev
/libbpf
)
71 define Package
/libbpf
/install
72 $(INSTALL_DIR
) $(1)/usr
/lib
73 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libbpf.so.
* $(1)/usr
/lib
/
76 $(eval
$(call BuildPackage
,libbpf
))