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

80 lines
2.5 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
2023-02-18 16:37:34 +00:00
PKG_REV:=ac0ad66b3644a43cbaa821a6135d3e610f8b2c1a
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
DEPENDS:=+iptables +kmod-ipt-ndpi +libpcap
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
MAKE_FLAGS += \
KERNEL_DIR="$(LINUX_DIR)" \
MODULES_DIR="$(TARGET_MODULES_DIR)" \
2018-06-22 15:10:16 +00:00
ARCH="$(LINUX_KARCH)" \
2022-08-04 12:08:29 +00:00
KERNEL_RELEASE="$(KERNEL_PATCHVER)" \
2018-06-22 15:10:16 +00:00
CROSS_COMPILE="$(TARGET_CROSS)" \
2022-08-03 19:36:39 +00:00
CC="$(TARGET_CC)" \
2018-06-22 08:50:17 +00:00
NDPI_PATH=$(PKG_BUILD_DIR)/ndpi-netfilter
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)
2018-06-22 15:10:16 +00:00
$(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR)/ndpi-netfilter
2018-06-22 08:50:17 +00:00
endef
define Package/iptables-mod-ndpi/install
$(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
2018-10-20 07:08:49 +00:00
DEPENDS:=+kmod-nf-conntrack +kmod-nf-conntrack-netlink +kmod-ipt-compat-xtables +libpcap
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)
endef
$(eval $(call BuildPackage,iptables-mod-ndpi))
$(eval $(call KernelPackage,ipt-ndpi))