Browse Source

libpfring: Merge pfring and libpfring in the same package

They use the same source. It makes no sense to have them separate.

Also cleaned up the Makefile to modern standards.

Fixed license information.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
lilik-openwrt-22.03
Rosen Penev 5 years ago
parent
commit
decf99dc64
No known key found for this signature in database GPG Key ID: 36D31CFA845F0E3B
2 changed files with 38 additions and 80 deletions
  1. +0
    -63
      kernel/pfring/Makefile
  2. +38
    -17
      libs/libpfring/Makefile

+ 0
- 63
kernel/pfring/Makefile View File

@ -1,63 +0,0 @@
#
# Copyright (C) 2017 Banglang Huang
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=pf-ring
PKG_VERSION:=7.4.0
PKG_RELEASE:=1
PKG_MAINTAINER:=Banglang Huang <banglang.huang@foxmail.com>
PKG_LICENSE:=GPL-2.0-only
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/ntop/PF_RING/tar.gz/$(PKG_VERSION)?
PKG_HASH:=e1c9cb44d8072854220f493c56fa5cba99a6b8336883939dc18b3e30c2954b68
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/PF_RING-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
CONFIGURE_PATH:=kernel
MAKE_PATH:=kernel
define KernelPackage/pf-ring
SUBMENU:=Network Support
TITLE:=PF_RING Kernel driver
FILES:=$(PKG_BUILD_DIR)/kernel/pf_ring.ko
AUTOLOAD:=$(call AutoLoad,90,pf_ring,1)
endef
define KernelPackage/pf-ring/description
Kernel module for libpf-ring package
endef
EXTRA_CFLAGS += \
-I$(PKG_BUILD_DIR)/kernel
MAKE_OPTS := \
ARCH="$(LINUX_KARCH)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
SUBDIRS="$(PKG_BUILD_DIR)/kernel" \
CFLAGS="$(TARGET_CFLAGS)" \
EXTRA_CFLAGS="$(EXTRA_CFLAGS)"
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/linux
$(CP) $(PKG_INSTALL_DIR)/usr/include/linux/*.h $(1)/usr/include/linux
endef
define Build/Compile
+$(MAKE) -C "$(LINUX_DIR)" \
$(MAKE_OPTS) \
modules
endef
$(eval $(call KernelPackage,pf-ring))

+ 38
- 17
libs/libpfring/Makefile View File

@ -6,21 +6,22 @@
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=libpfring
PKG_VERSION:=7.4.0
PKG_RELEASE:=1
PKG_MAINTAINER:=Banglang Huang <banglang.huang@foxmail.com>
PKG_LICENSE:=LGPL-2.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/ntop/PF_RING/tar.gz/$(PKG_VERSION)?
PKG_HASH:=e1c9cb44d8072854220f493c56fa5cba99a6b8336883939dc18b3e30c2954b68
PKG_BUILD_DIR:=$(BUILD_DIR)/PF_RING-$(PKG_VERSION)
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/PF_RING-$(PKG_VERSION)
PKG_MAINTAINER:=Banglang Huang <banglang.huang@foxmail.com>
PKG_INSTALL:=1
PKG_FIXUP:=patch-libtool
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
@ -33,6 +34,8 @@ define Package/libpfring
TITLE:=Library for PR_RING (package process framework)
URL:=https://github.com/ntop/pf_ring
DEPENDS:=+kmod-pf-ring +libpcap +libpthread
LICENSE:=LGPL-2.1-or-later
LICENSE_FILES:=LICENSE
endef
define Package/libpfring/description
@ -42,28 +45,46 @@ define Package/libpfring/description
traffic balancers or packet filters in a matter of lines of codes.
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/* \
$(1)/usr/include/
define KernelPackage/pf-ring
SUBMENU:=Network Support
TITLE:=PF_RING Kernel driver
FILES:=$(PKG_BUILD_DIR)/kernel/pf_ring.ko
AUTOLOAD:=$(call AutoLoad,90,pf_ring,1)
LICENSE:=GPL-2.0-or-later
endef
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/libpfring.so* \
$(1)/usr/lib/
define KernelPackage/pf-ring/description
Kernel module for libpf-ring package
endef
CONFIGURE_VARS += \
MACHINE="$(ARCH)" \
ac_cv_lib_nl_3_nl_socket_alloc=no
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \
KERNEL_DIR="$(LINUX_DIR)" \
ARCH="$(LINUX_KARCH)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
SUBDIRS="$(PKG_BUILD_DIR)/kernel" \
EXTRA_CFLAGS="$(EXTRA_CFLAGS) -I$(PKG_BUILD_DIR)/kernel" \
modules
$(call Build/Compile/Default)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpfring.so* $(1)/usr/lib/
endef
define Package/libpfring/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/libpfring.so* \
$(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpfring.so* $(1)/usr/lib/
$(LN) libpfring.so $(1)/usr/lib/libpfring.so.1
endef
$(eval $(call BuildPackage,libpfring))
$(eval $(call KernelPackage,pf-ring))

Loading…
Cancel
Save