diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-05-13 15:44:42 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2022-09-11 12:26:03 +0200 |
commit | 395762163d3eabc87113c6b810a112d4cea3803b (patch) | |
tree | 9fa18c201860f7fd88e5da09b56656b9ce02ab5e | |
parent | b600e107b989ca0282cc4383e718c715155ee770 (diff) |
nDPId-master: add new package
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r-- | net/nDPId-master/Makefile | 93 | ||||
-rw-r--r-- | net/nDPId-master/patches/001-enable-in-source-build.patch | 17 |
2 files changed, 110 insertions, 0 deletions
diff --git a/net/nDPId-master/Makefile b/net/nDPId-master/Makefile new file mode 100644 index 0000000..f26f327 --- /dev/null +++ b/net/nDPId-master/Makefile @@ -0,0 +1,93 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=nDPId-master +PKG_VERSION:=1.4 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/lnslbrty/nDPId.git +PKG_SOURCE_VERSION:=9e07a57566cc45bf92a845d8cee968d72e0f314e +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) + +PKG_MAINTAINER:=Toni +PKG_LICENSE:=GPL-3 +PKG_LICENSE_FILES:=COPYING + +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/nDPId-master + TITLE:=nDPId is a tiny nDPI based daemons / toolkit (master branch) + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +zlib +LIBNDPI_GCRYPT:libgcrypt + URL:=http://github.com/lnslbrty/nDPId +endef + +define Package/nDPId-master/description + nDPId is a set of daemons and tools to capture, process and classify network flows. + It's only dependencies (besides a half-way modern c library and POSIX threads) are libnDPI (>= 3.6.0 or current github dev branch) and libpcap. +endef + +define Package/nDPId-master/config +config NDPID_MASTER_COLLECTD_SUPPORT + bool "nDPId collectd support" + depends on PACKAGE_nDPId-master && PACKAGE_collectd-mod-exec && !CONFIG_NDPID_COLLECTD_SUPPORT + default n + help + This option enables collectd to gather nDPId statistics via plugin-exec. + Disabled by default. +endef + +CMAKE_OPTIONS += -DBUILD_EXAMPLES=ON +CMAKE_OPTIONS += -DBUILD_NDPI=OFF +CMAKE_OPTIONS += -DNDPI_NO_PKGCONFIG=ON +CMAKE_OPTIONS += -DENABLE_ZLIB=ON +CMAKE_OPTIONS += -DENABLE_SANITIZER=OFF +CMAKE_OPTIONS += -DENABLE_MEMORY_PROFILING=OFF +CMAKE_OPTIONS += -DSTATIC_LIBNDPI_INSTALLDIR="$(PKG_BUILD_DIR)/libnDPI/install" + +TARGET_CFLAGS += -DLIBNDPI_STATIC=1 + +ifneq ($(CONFIG_LIBNDPI_GCRYPT),) +CMAKE_OPTIONS += -DNDPI_WIDTH_GCRYPT=ON +endif + +ifdef NDPID_MASTER_COLLECTD_SUPPORT +define Package/nDPId-master/install-collectd-files + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nDPIsrvd-collectd $(1)/usr/bin/nDPIsrvd-master-collectd +endef +endif + +define Build/Prepare + $(PKG_UNPACK) + $(Build/Patch) + $(SED) 's/^#define NDPI_API_VERSION.*/#define NDPI_API_VERSION 1/' \ + $(PKG_BUILD_DIR)/libnDPI/src/include/ndpi_api.h.in + env \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + CROSS_COMPILE_TRIPLET="$(GNU_TARGET_NAME)" \ + MAKE_PROGRAM="env -uCFLAGS -uCPPFLAGS $(MAKE)" \ + $(PKG_BUILD_DIR)/scripts/get-and-build-libndpi.sh +endef + +define Package/nDPId-master/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nDPId $(1)/usr/sbin/nDPId-master + + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nDPId-test $(1)/usr/bin/nDPId-master-test + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nDPIsrvd $(1)/usr/bin/nDPIsrvd-master + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nDPIsrvd-captured $(1)/usr/bin/nDPIsrvd-master-captured + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nDPIsrvd-collectd $(1)/usr/bin/nDPIsrvd-master-collectd + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nDPIsrvd-json-dump $(1)/usr/bin/nDPIsrvd-master-json-dump + + $(call Package/nDPId-master/install-collectd-files) +endef + +$(eval $(call BuildPackage,nDPId-master)) diff --git a/net/nDPId-master/patches/001-enable-in-source-build.patch b/net/nDPId-master/patches/001-enable-in-source-build.patch new file mode 100644 index 0000000..86432dc --- /dev/null +++ b/net/nDPId-master/patches/001-enable-in-source-build.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9045237..83f72b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,12 +1,5 @@ + cmake_minimum_required(VERSION 3.12.4) + project(nDPId C) +-if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}") +- message(FATAL_ERROR "In-source builds are not allowed.\n" +- "Please remove ${PROJECT_SOURCE_DIR}/CMakeCache.txt\n" +- "and\n" +- "${PROJECT_SOURCE_DIR}/CMakeFiles\n" +- "Create a build directory somewhere and run CMake again.") +-endif() + set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + find_package(PkgConfig REQUIRED) + |