1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 02:51:50 +00:00
openmptcprouter-feeds/ndpi-netfilter2/Makefile

85 lines
2.8 KiB
Makefile
Raw Normal View History

2018-06-22 08:50:17 +00:00
#
# Based on package from https://github.com/openwrt-develop/ndpi-netfilter/
2022-10-20 08:22:59 +00:00
# Copyright (C) 2018-2022 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
2018-06-22 08:50:17 +00:00
#
# 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:=ndpi-netfilter2
2022-11-24 19:59:06 +00:00
PKG_RELEASE:=4
PKG_REV:=2fc0c86e58d56c8f9c5da3883a09732fc902e5e7
PKG_VERSION:=4-$(PKG_REV)
2018-06-22 08:50:17 +00:00
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/vel21ripn/nDPI.git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/iptables-mod-ndpi
SUBMENU:=Firewall
SECTION:=net
CATEGORY:=Network
TITLE:=ndpi successor of OpenDPI
URL:=http://www.ntop.org/products/ndpi/
2019-04-24 19:47:00 +00:00
# DEPENDS:=+iptables +iptables-mod-conntrack-extra +kmod-ipt-ndpi +libpcap
2023-04-28 06:50:09 +00:00
# DEPENDS:=+iptables +kmod-ipt-ndpi +libpcap @(LINUX_5_4||LINUX_5_15||TARGET_x86_64)
DEPENDS:=+iptables +kmod-ipt-ndpi +libpcap @(LINUX_5_4||LINUX_5_15)
2018-10-20 07:08:49 +00:00
MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
2018-06-22 08:50:17 +00:00
endef
define Package/iptables-mod-ndpi/description
nDPI is a ntop-maintained superset of the popular OpenDPI library
endef
2022-08-03 19:36:39 +00:00
CONFIGURE_CMD=./autogen.sh
CONFIGURE_ARGS += --with-pic
MAKE_PATH:=ndpi-netfilter
2018-06-22 08:50:17 +00:00
2023-04-25 17:44:04 +00:00
MAKE_FLAGS += \
2023-04-26 06:43:57 +00:00
KERNEL_DIR="$(LINUX_DIR)" \
MODULES_DIR="$(TARGET_MODULES_DIR)" \
2023-04-28 06:50:09 +00:00
NDPI_PATH=$(PKG_BUILD_DIR)/ndpi-netfilter \
ARCH="$(LINUX_KARCH)"
2018-06-22 08:50:17 +00:00
define Build/Compile
(cd $(PKG_BUILD_DIR)/src/lib &&\
2019-09-04 05:29:50 +00:00
gcc -g -O2 -fPIC -DPIC -DNDPI_LIB_COMPILATION -I../../src/include/ -I../../src/lib/third_party/include/ ndpi_network_list_compile.c -o ndpi_network_list_compile &&\
2022-07-29 10:47:20 +00:00
./ndpi_network_list_compile -o ndpi_network_list.c.inc ndpi_network_list_*.yaml)
2023-04-28 06:50:09 +00:00
$(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR)/ndpi-netfilter
2018-06-22 08:50:17 +00:00
endef
2023-04-28 06:50:09 +00:00
define KernelPackage/iptables-mod-ndpi/install
2018-06-22 08:50:17 +00:00
$(INSTALL_DIR) $(1)/usr/lib/iptables
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ndpi-netfilter/ipt/libxt_ndpi.so $(1)/usr/lib/iptables
endef
define KernelPackage/ipt-ndpi
SUBMENU:=Netfilter Extensions
TITLE:= nDPI net netfilter module
DEPENDS:=+kmod-nf-conntrack +kmod-nf-conntrack-netlink +kmod-ipt-compat-xtables +libpcap @(LINUX_5_4||LINUX_5_15||TARGET_x86_64)
2018-06-22 08:50:17 +00:00
KCONFIG:=CONFIG_NF_CONNTRACK_LABELS=y \
CONFIG_NETFILTER_XT_MATCH_CONNLABEL=y
FILES:= $(PKG_BUILD_DIR)/ndpi-netfilter/src/xt_ndpi.ko
AUTOLOAD:=$(call AutoProbe,xt_ndpi)
2023-04-28 06:50:09 +00:00
# MODPARAMS.xt_ndpi:=ndpi_enable_flow=1
KCONFIG:=\
CONFIG_LIVEPATCH=y \
CONFIG_NF_CONNTRACK=y \
CONFIG_NF_CONNTRACK_LABELS=y \
2023-04-28 06:50:09 +00:00
CONFIG_NETFILTER_XT_MATCH_CONNLABEL=y \
CONFIG_UNUSED_SYMBOLS=y
2018-06-22 08:50:17 +00:00
endef
$(eval $(call BuildPackage,iptables-mod-ndpi))
$(eval $(call KernelPackage,ipt-ndpi))