2023-05-21 09:14:37 +00:00
|
|
|
#
|
2024-04-03 22:31:29 +00:00
|
|
|
# Copyright (C) 2020-2024 Tony Ambardar <itugrok@yahoo.com>
|
2023-05-21 09:14:37 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=libbpf
|
2024-07-15 05:21:52 +00:00
|
|
|
PKG_VERSION:=1.4.5
|
2023-05-21 09:14:37 +00:00
|
|
|
PKG_RELEASE:=1
|
|
|
|
|
|
|
|
PKG_SOURCE_URL:=https://github.com/libbpf/libbpf
|
2024-07-15 05:21:52 +00:00
|
|
|
PKG_MIRROR_HASH:=09ad44597d170c12f9f710f7ac4bacfa2b01d110c45810ac0f16c6a3f5d51a0d
|
2023-05-21 09:14:37 +00:00
|
|
|
PKG_SOURCE_PROTO:=git
|
2024-06-05 03:30:16 +00:00
|
|
|
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
|
2023-05-21 09:14:37 +00:00
|
|
|
PKG_ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
|
|
|
|
|
|
|
|
PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
|
2023-09-18 20:53:14 +00:00
|
|
|
PKG_CPE_ID:=cpe:/a:libbpf_project:libbpf
|
2023-05-21 09:14:37 +00:00
|
|
|
|
2024-04-03 22:31:29 +00:00
|
|
|
PKG_BUILD_FLAGS:=no-mips16 no-gc-sections no-lto
|
2023-05-21 09:14:37 +00:00
|
|
|
PKG_BUILD_PARALLEL:=1
|
|
|
|
PKG_INSTALL:=1
|
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
include $(INCLUDE_DIR)/nls.mk
|
|
|
|
|
|
|
|
define Package/libbpf
|
|
|
|
SECTION:=libs
|
|
|
|
CATEGORY:=Libraries
|
|
|
|
TITLE:=libbpf - eBPF helper library
|
|
|
|
LICENSE:=LGPL-2.1 OR BSD-2-Clause
|
|
|
|
ABI_VERSION:=$(PKG_ABI_VERSION)
|
|
|
|
URL:=http://www.kernel.org
|
|
|
|
DEPENDS:=+libelf
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/libbpf/description
|
|
|
|
libbpf is a library for loading eBPF programs and reading and manipulating eBPF objects from user-space.
|
|
|
|
endef
|
|
|
|
|
|
|
|
MAKE_FLAGS += \
|
|
|
|
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
|
|
|
|
LIBSUBDIR=lib
|
|
|
|
|
|
|
|
MAKE_PATH = src
|
|
|
|
|
|
|
|
define Build/InstallDev/libbpf
|
|
|
|
$(INSTALL_DIR) $(1)/usr/include/bpf
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/bpf/*.h $(1)/usr/include/bpf/
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.{a,so*} \
|
|
|
|
$(1)/usr/lib/
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libbpf.pc \
|
|
|
|
$(1)/usr/lib/pkgconfig/
|
|
|
|
$(SED) 's,/usr/include,$$$${prefix}/include,g' \
|
|
|
|
$(1)/usr/lib/pkgconfig/libbpf.pc
|
|
|
|
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' \
|
|
|
|
$(1)/usr/lib/pkgconfig/libbpf.pc
|
|
|
|
endef
|
|
|
|
|
|
|
|
Build/InstallDev=$(Build/InstallDev/libbpf)
|
|
|
|
|
|
|
|
define Package/libbpf/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.so.* $(1)/usr/lib/
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,libbpf))
|