aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2021-02-07 09:29:01 +0000
committerLuca Deri <deri@ntop.org>2021-02-07 09:29:01 +0000
commit8297dacfe5760f5fb63979da203cbc44ef3561b2 (patch)
tree830a338be0252d98b5da15aee845f306addcc616 /packages
parentbe58d7841734fcd6a0bcb783936e328092592096 (diff)
Added Makefile for building the development version of libndpi for OpenWRT
Diffstat (limited to 'packages')
-rw-r--r--packages/openwrt/Makefile.dev93
-rw-r--r--packages/openwrt/README9
2 files changed, 101 insertions, 1 deletions
diff --git a/packages/openwrt/Makefile.dev b/packages/openwrt/Makefile.dev
new file mode 100644
index 000000000..3fc571255
--- /dev/null
+++ b/packages/openwrt/Makefile.dev
@@ -0,0 +1,93 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libndpi
+# Avoid a specfic version
+PKG_VERSION:=dev
+PKG_RELEASE:=1
+
+# Compile it from soucre
+SOURCE_DIR:=/home/deri/openwrt-dependencies/nDPI/
+
+PKG_MAINTAINER:=Luca Deri <deri@ntop.org>
+PKG_LICENSE:=LGPL-3.0-or-later
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_REMOVE_FILES:=autogen.sh
+PKG_BUILD_DEPENDS:=libpcap
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/uclibc++.mk
+include $(INCLUDE_DIR)/package.mk
+
+ifeq ($(CONFIG_LIBNDPI_GCRYPT),)
+CONFIGURE_ARGS += --disable-gcrypt
+endif
+
+define Package/libndpi
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=Library for deep-packet inspection
+ URL:=https://github.com/ntop/nDPI
+ DEPENDS:=$(CXX_DEPENDS) +LIBNDPI_GCRYPT:libgcrypt +libpcap +libjson-c
+endef
+
+define Package/libndpi/description
+ nDPI is an open source LGPLv3 library for deep-packet inspection.
+ Based on OpenDPI it includes ntop extensions.
+endef
+
+define Package/libndpi/config
+config LIBNDPI_GCRYPT
+ bool "GCrypt support"
+ depends on PACKAGE_libndpi
+ default n
+ help
+ This option enables QUIC client hello decryption.
+ Disabled by default.
+endef
+
+define Build/Prepare
+ cp -r $(SOURCE_DIR)/* $(PKG_BUILD_DIR)
+ $(PKG_UNPACK)
+ $(Build/Patch)
+ mv $(PKG_BUILD_DIR)/configure.seed $(PKG_BUILD_DIR)/configure.ac
+ $(SED) "s/@NDPI_MAJOR@/3/g" \
+ -e "s/@NDPI_MINOR@/4/g" \
+ -e "s/@NDPI_PATCH@/0/g" \
+ -e "s/@NDPI_VERSION_SHORT@/3.4.0/g" \
+ -e "s/@FUZZY@/dnl> /g" \
+ $(PKG_BUILD_DIR)/configure.ac
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include/ndpi
+ $(CP) $(PKG_BUILD_DIR)/src/include/*.h \
+ $(1)/usr/include/ndpi/
+
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
+ $(1)/usr/lib/
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(CP) $(PKG_BUILD_DIR)/libndpi.pc \
+ $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libndpi/install
+ $(INSTALL_DIR) $(1)/usr/lib/
+ $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
+ $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/example/ndpiReader \
+ $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libndpi))
diff --git a/packages/openwrt/README b/packages/openwrt/README
index 7b2e5a9fc..f9977b631 100644
--- a/packages/openwrt/README
+++ b/packages/openwrt/README
@@ -1,10 +1,16 @@
-Howto Compile lindpi on OpenWRT
+Howto Compile libndpi on OpenWRT
-------------------------------
cd myopenwrt_directory
mkdir package/network/services/libndpi
cd package/network/services/libndpi
+
+# (a) Stable version
cp ~/nDPI/packages/openwrt/Makefile .
+
+# (b) Dev version
+cp ~/nDPI/packages/openwrt/Makefile.dev Makefile
+
cd myopenwrt_directory
make menuconfig
@@ -23,3 +29,4 @@ make -j1 V=s package/network/services/libndpi/compile
Other Documents
---------------
https://openwrt.org/packages/pkgdata/libndpi
+