You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.5 KiB

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