avahi: backport CVE fixes from upstream
[feed/packages.git] / libs / libpfring / Makefile
1 #
2 # Copyright (C) 2017 Banglang Huang
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 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=libpfring
12 PKG_VERSION:=8.4.0
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=https://codeload.github.com/ntop/PF_RING/tar.gz/$(PKG_VERSION)?
17 PKG_HASH:=2756a45ab250da11850160beb62aa879075aedfb49bf8f323b404f02b0c36670
18 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/PF_RING-$(PKG_VERSION)
19
20 PKG_MAINTAINER:=Banglang Huang <banglang.huang@foxmail.com>
21
22 PKG_FIXUP:=patch-libtool
23 PKG_INSTALL:=1
24 PKG_BUILD_PARALLEL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 CONFIGURE_PATH:=userland
29 MAKE_PATH:=userland/lib
30
31 define Package/libpfring
32 SECTION:=libs
33 CATEGORY:=Libraries
34 TITLE:=Library for PR_RING (package process framework)
35 URL:=https://github.com/ntop/pf_ring
36 DEPENDS:=+kmod-pf-ring +libpcap +libpthread
37 LICENSE:=LGPL-2.1-or-later
38 LICENSE_FILES:=LICENSE
39 endef
40
41 define Package/libpfring/description
42 PF_RING is a high speed packet capture library that turns a commodity PC into an efficient and cheap
43 network measurement box suitable for both packet and active traffic analysis and manipulation.
44 Moreover, PF_RING opens totally new markets as it enables the creation of efficient application such as
45 traffic balancers or packet filters in a matter of lines of codes.
46 endef
47
48 define KernelPackage/pf-ring
49 SUBMENU:=Network Support
50 TITLE:=PF_RING Kernel driver
51 FILES:=$(PKG_BUILD_DIR)/kernel/pf_ring.ko
52 AUTOLOAD:=$(call AutoLoad,90,pf_ring,1)
53 LICENSE:=GPL-2.0-or-later
54 endef
55
56 define KernelPackage/pf-ring/description
57 Kernel module for libpf-ring package
58 endef
59
60 CONFIGURE_VARS += \
61 MACHINE="$(ARCH)" \
62 ac_cv_lib_nl_3_nl_socket_alloc=no
63
64 define Build/Compile
65 $(MAKE) -C "$(LINUX_DIR)" \
66 KERNEL_DIR="$(LINUX_DIR)" \
67 ARCH="$(LINUX_KARCH)" \
68 CROSS_COMPILE="$(TARGET_CROSS)" \
69 M="$(PKG_BUILD_DIR)/kernel" \
70 EXTRA_CFLAGS="$(EXTRA_CFLAGS) -I$(PKG_BUILD_DIR)/kernel" \
71 modules
72 $(call Build/Compile/Default)
73 endef
74
75 define Build/InstallDev
76 $(INSTALL_DIR) $(1)/usr/include/
77 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
78
79 $(INSTALL_DIR) $(1)/usr/lib
80 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpfring.so* $(1)/usr/lib/
81 endef
82
83 define Package/libpfring/install
84 $(INSTALL_DIR) $(1)/usr/lib/
85 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpfring.so* $(1)/usr/lib/
86 $(LN) libpfring.so $(1)/usr/lib/libpfring.so.1
87 endef
88
89 $(eval $(call BuildPackage,libpfring))
90 $(eval $(call KernelPackage,pf-ring))