libbpf: Update to v1.3.0
[openwrt/staging/hauke.git] / package / libs / libbpf / Makefile
1 #
2 # Copyright (C) 2020-2023 Tony Ambardar <itugrok@yahoo.com>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libbpf
11 PKG_VERSION:=1.3.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE_URL:=https://github.com/libbpf/libbpf
15 PKG_MIRROR_HASH:=ff597a3635c2c099419d7e9e8bc44084f7f9e0c4ba2dcd571130165a19ed4ef4
16 PKG_SOURCE_PROTO:=git
17 PKG_SOURCE_VERSION:=v1.3.0
18 PKG_ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
19
20 PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
21 PKG_CPE_ID:=cpe:/a:libbpf_project:libbpf
22
23 PKG_BUILD_FLAGS:=no-mips16
24 PKG_BUILD_PARALLEL:=1
25 PKG_INSTALL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/nls.mk
29
30 define Package/libbpf
31 SECTION:=libs
32 CATEGORY:=Libraries
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
37 DEPENDS:=+libelf
38 endef
39
40 define Package/libbpf/description
41 libbpf is a library for loading eBPF programs and reading and manipulating eBPF objects from user-space.
42 endef
43
44 MAKE_VARS = \
45 EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
46 LDFLAGS="$(TARGET_LDFLAGS)"
47
48 MAKE_FLAGS += \
49 $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
50 LIBSUBDIR=lib
51
52 MAKE_PATH = src
53
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*} \
59 $(1)/usr/lib/
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
67 endef
68
69 Build/InstallDev=$(Build/InstallDev/libbpf)
70
71 define Package/libbpf/install
72 $(INSTALL_DIR) $(1)/usr/lib
73 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.so.* $(1)/usr/lib/
74 endef
75
76 $(eval $(call BuildPackage,libbpf))