git: 26019c39dae2 - main - net/ndpi: Update to 4.4 branch

From: Guido Falsi <madpilot_at_FreeBSD.org>
Date: Thu, 18 Aug 2022 19:19:26 UTC
The branch main has been updated by madpilot:

URL: https://cgit.FreeBSD.org/ports/commit/?id=26019c39dae2dd7ecb93f01dc01ceeb9eb582f14

commit 26019c39dae2dd7ecb93f01dc01ceeb9eb582f14
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2022-08-18 19:18:26 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2022-08-18 19:18:26 +0000

    net/ndpi: Update to 4.4 branch
---
 net/ndpi/Makefile                           |  6 ++--
 net/ndpi/distinfo                           |  6 ++--
 net/ndpi/files/patch-example_Makefile.in    | 49 ++++++++++++++++++++---------
 net/ndpi/files/patch-src_lib_Makefile.in    | 28 ++++++++++++-----
 net/ndpi/files/patch-tests_dga_Makefile.in  | 32 ++++++++++---------
 net/ndpi/files/patch-tests_unit_Makefile.in | 48 +++++++++++++++++++++-------
 6 files changed, 115 insertions(+), 54 deletions(-)

diff --git a/net/ndpi/Makefile b/net/ndpi/Makefile
index aae206846bab..30f3a6a5d574 100644
--- a/net/ndpi/Makefile
+++ b/net/ndpi/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	ndpi
-PORTVERSION=	4.2.d20220608
+PORTVERSION=	4.4.d20220714
 PORTEPOCH=	1
 CATEGORIES=	net
 
@@ -19,7 +19,7 @@ USES=		autoreconf compiler:c++11-lang cpe libtool localbase:ldflags pathfix \
 CPE_VENDOR=	ntop
 USE_LDCONFIG=	yes
 
-CONFIGURE_ARGS=	--with-pic
+CONFIGURE_ARGS=	--with-pic --with-local-libgcrypt
 CPPFLAGS+=	-I${LOCALBASE}/include/json-c
 LIBS+=		-ljson-c
 MAKE_ENV+=	EXAMPLESDIR="${EXAMPLESDIR_REL}"
@@ -29,7 +29,7 @@ INSTALL_TARGET=	install-strip
 USE_GITHUB=	yes
 GH_ACCOUNT=	ntop
 GH_PROJECT=	nDPI
-GH_TAGNAME=	bb59f2e
+GH_TAGNAME=	dd8953c
 
 PLIST_SUB=	MAJOR_VER=${PORTVERSION:R:R} VER=${PORTVERSION:R}
 
diff --git a/net/ndpi/distinfo b/net/ndpi/distinfo
index 0a2f0ac2ad46..9bdca3475c15 100644
--- a/net/ndpi/distinfo
+++ b/net/ndpi/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1656342275
-SHA256 (ntop-nDPI-4.2.d20220608-bb59f2e_GH0.tar.gz) = 34e7b84fbd09f20fd3a61fe4d9218ca71a5a6d417a39e62e7eb3cfe35d664cf6
-SIZE (ntop-nDPI-4.2.d20220608-bb59f2e_GH0.tar.gz) = 126569179
+TIMESTAMP = 1659114002
+SHA256 (ntop-nDPI-4.4.d20220714-dd8953c_GH0.tar.gz) = e39a1b4e5687394497745f2cdfd0504fc924b2dc5240cdbbbb19f69f2175d3eb
+SIZE (ntop-nDPI-4.4.d20220714-dd8953c_GH0.tar.gz) = 151062796
diff --git a/net/ndpi/files/patch-example_Makefile.in b/net/ndpi/files/patch-example_Makefile.in
index 343167ead9ef..87d9a194fc93 100644
--- a/net/ndpi/files/patch-example_Makefile.in
+++ b/net/ndpi/files/patch-example_Makefile.in
@@ -1,15 +1,31 @@
---- example/Makefile.in.orig	2022-02-01 08:14:05 UTC
+--- example/Makefile.in.orig	2022-07-14 16:13:42 UTC
 +++ example/Makefile.in
-@@ -12,28 +12,14 @@ HEADERS=intrusion_detection.h reader_util.h $(SRCHOME)
+@@ -6,46 +6,23 @@ SRCHOME=../src
+ DISABLE_NPCAP=@DISABLE_NPCAP@
+ EXE_SUFFIX=@EXE_SUFFIX@
+ SRCHOME=../src
+-ifneq ($(OS),Windows_NT)
+-CFLAGS+=-fPIC -DPIC
+-endif
+-CFLAGS+=-I$(SRCHOME)/include @PCAP_INC@ @CFLAGS@ @GPROF_CFLAGS@
++CFLAGS+=-fPIC -DPIC -I$(SRCHOME)/include @PCAP_INC@ @CFLAGS@ @GPROF_CFLAGS@
+ LDFLAGS=@LDFLAGS@
+ LIBNDPI=$(SRCHOME)/lib/libndpi.a
+ LIBS=$(LIBNDPI) @PCAP_LIB@ @ADDITIONAL_LIBS@ @LIBS@ @GPROF_LIBS@
+ HEADERS=reader_util.h $(SRCHOME)/include/ndpi_api.h \
          $(SRCHOME)/include/ndpi_typedefs.h $(SRCHOME)/include/ndpi_protocol_ids.h
- OBJS=ndpiReader.o reader_util.o intrusion_detection.o
  PREFIX?=@prefix@
 +EXAMPLESDIR?=share/examples/ndpi
  
 -ifneq ($(BUILD_MINGW),)
--SUFFIX:=.exe
+-
+-ifeq ($(DISABLE_NPCAP),0)
 -CFLAGS+=-I@srcdir@/../windows/WpdPack/Include -I@srcdir@/../windows/WpdPack/Include/pcap
--LIBS+=-Wl,-Bstatic -lpthread -Wl,-Bdynamic
+-else
+-CFLAGS+=-DDISABLE_NPCAP
+-endif
+-
+-ifeq ($(DISABLE_NPCAP),0)
 -
 -ifneq ($(BUILD_MINGW_X64),)
 -LIBS+=@srcdir@/../windows/WpdPack/Lib/x64/wpcap.lib
@@ -17,31 +33,34 @@
 -LIBS+=@srcdir@/../windows/WpdPack/Lib/wpcap.lib
 -endif
 -
--else
--
- LIBS+=-lpthread
- 
 -endif
 -
- all: ndpiReader$(SUFFIX) @DPDK_TARGET@
+-LIBS+=-Wl,-Bstatic -lpthread -Wl,-Bdynamic
+-else
+ LIBS+=-pthread
+-endif
+ 
+ CFLAGS+=-pthread
+ 
+ all: ndpiReader$(EXE_SUFFIX) @DPDK_TARGET@
  
  EXECUTABLE_SOURCES := ndpiReader.c ndpiSimpleIntegration.c
 -COMMON_SOURCES := $(filter-out $(EXECUTABLE_SOURCES),$(wildcard *.c ))
-+COMMON_SOURCES := reader_util.c
++COMMON_SOURCES = reader_util.c
  
  libndpiReader.a: $(COMMON_SOURCES:%.c=%.o) $(LIBNDPI)
  	$(AR) rsv libndpiReader.a $(COMMON_SOURCES:%.c=%.o)
-@@ -49,10 +35,10 @@ ndpiSimpleIntegration$(SUFFIX): ndpiSimpleIntegration.
+@@ -61,10 +38,10 @@ install: ndpiReader$(EXE_SUFFIX)
  
- install: ndpiReader$(SUFFIX)
+ install: ndpiReader$(EXE_SUFFIX)
  	mkdir -p $(DESTDIR)$(PREFIX)/bin/
 -	mkdir -p $(DESTDIR)$(PREFIX)/share/ndpi
 +	mkdir -p $(DESTDIR)$(PREFIX)/$(EXAMPLESDIR)/
- 	cp ndpiReader$(SUFFIX) $(DESTDIR)$(PREFIX)/bin/
+ 	cp ndpiReader$(EXE_SUFFIX) $(DESTDIR)$(PREFIX)/bin/
 -	cp protos.txt $(DESTDIR)$(PREFIX)/share/ndpi/ndpiProtos.txt
 -	cp mining_hosts.txt $(DESTDIR)$(PREFIX)/share/ndpi/ndpiCustomCategory.txt
 +	cp protos.txt $(DESTDIR)$(PREFIX)/$(EXAMPLESDIR)/ndpiProtos.txt
 +	cp mining_hosts.txt $(DESTDIR)$(PREFIX)/$(EXAMPLESDIR)/ndpiCustomCategory.txt
- 	[ -f ndpiSimpleIntegration$(SUFFIX) ] && cp ndpiSimpleIntegration$(SUFFIX) $(DESTDIR)$(PREFIX)/bin/ndpiSimpleIntegration$(SUFFIX) || true
+ 	[ -f ndpiSimpleIntegration$(EXE_SUFFIX) ] && cp ndpiSimpleIntegration$(EXE_SUFFIX) $(DESTDIR)$(PREFIX)/bin/ndpiSimpleIntegration$(EXE_SUFFIX) || true
  	[ -f build/app/ndpiReader.dpdk ] && cp build/app/ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ || true
  	[ -f ndpiReader.dpdk ] && cp ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ || true
diff --git a/net/ndpi/files/patch-src_lib_Makefile.in b/net/ndpi/files/patch-src_lib_Makefile.in
index e97fe31a11a2..01fb958f91cc 100644
--- a/net/ndpi/files/patch-src_lib_Makefile.in
+++ b/net/ndpi/files/patch-src_lib_Makefile.in
@@ -1,26 +1,40 @@
 -	/bin/rm -f libndpi.a $(OBJECTS)
 new file mode 100644
---- src/lib/Makefile.in.orig	2020-10-19 14:18:25 UTC
+--- src/lib/Makefile.in.orig	2022-07-14 16:13:42 UTC
 +++ src/lib/Makefile.in
-@@ -18,30 +18,17 @@ CFLAGS     += -fPIC -DPIC -I../include -Ithird_party/i
- LDFLAGS    = @LDFLAGS@ @ADDITIONAL_LIBS@ @LIBS@
- RANLIB     = ranlib
+@@ -14,15 +14,12 @@ includedir = ${prefix}/include/ndpi
+ prefix     = @prefix@
+ libdir     = ${prefix}/lib
+ includedir = ${prefix}/include/ndpi
+-ifneq ($(OS),Windows_NT)
+-CFLAGS     += -fPIC -DPIC
+-endif
+-CFLAGS     += -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION @CFLAGS@ @GPROF_CFLAGS@ @CUSTOM_NDPI@
++CFLAGS     += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION @CFLAGS@ @GPROF_CFLAGS@ @CUSTOM_NDPI@
+ LDFLAGS    = @LDFLAGS@
+ LIBS       = @ADDITIONAL_LIBS@ @LIBS@ @GPROF_LIBS@
  
 -OBJECTS   = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) $(patsubst ./%.c, ./%.o, $(wildcard ./*.c))
 -HEADERS   = $(wildcard ../include/*.h)
-+OBJECTS != ls protocols/*.c | sed 's/\(.*\)\.c$$/\1.o/' && ls third_party/src/*.c | sed 's/\(.*\)\.c$$/\1.o/' && ls ./*.c | sed 's/\(.*\)\.c$$/\1.o/'
++OBJECTS != ls protocols/*.c | sed 's/\(.*\)\.c$$/\1.o/' && ls third_party/src/*.c | sed -e 's/\(.*\)\.c$$/\1.o/' -e '/gcrypt_light/d' && ls ./*.c | sed 's/\(.*\)\.c$$/\1.o/'
 +HEADERS != ls ../include/*.h
  NDPI_VERSION_MAJOR   = @NDPI_MAJOR@
  NDPI_LIB_STATIC      = libndpi.a
  NDPI_LIB_SHARED_BASE = libndpi.so
- NDPI_LIB_SHARED      = $(NDPI_LIB_SHARED_BASE).@NDPI_VERSION_SHORT@
+@@ -30,27 +27,8 @@ USE_HOST_LIBGCRYPT   = @USE_HOST_LIBGCRYPT@
  NDPI_LIBS            = $(NDPI_LIB_STATIC) $(NDPI_LIB_SHARED)
+ USE_HOST_LIBGCRYPT   = @USE_HOST_LIBGCRYPT@
  
+-ifneq ($(USE_HOST_LIBGCRYPT),0)
+-TMP_OBJS := $(OBJECTS)
+-OBJECTS   = $(filter-out third_party/src/gcrypt_light.o,$(TMP_OBJS))
+-endif
+-
 -ifneq ($(OS),Windows_NT)
 -OS := $(shell uname)
 -endif
  BUILD_MINGW    		 = @BUILD_MINGW@
- 
+-
 -ifeq ($(OS),Darwin)
 -CC=clang
 -SONAME_FLAG=
diff --git a/net/ndpi/files/patch-tests_dga_Makefile.in b/net/ndpi/files/patch-tests_dga_Makefile.in
index c7e09995d8c5..2e0dbdf6b39a 100644
--- a/net/ndpi/files/patch-tests_dga_Makefile.in
+++ b/net/ndpi/files/patch-tests_dga_Makefile.in
@@ -1,26 +1,30 @@
---- tests/dga/Makefile.in.orig	2022-02-01 08:14:05 UTC
+--- tests/dga/Makefile.in.orig	2022-07-14 16:13:42 UTC
 +++ tests/dga/Makefile.in
-@@ -12,16 +12,13 @@ HEADERS=$(SRCHOME)/include/ndpi_api.h $(SRCHOME)/inclu
- OBJS=dga_evaluate
- PREFIX?=@prefix@
+@@ -4,10 +4,7 @@ SRCHOME=../../src
  
--ifneq ($(BUILD_MINGW),)
- all:
- 	@echo 'DGA test disabled due to mingw build.'
+ SRCHOME=../../src
  
--else
--
- all: dga_evaluate
+-ifneq ($(OS),Windows_NT)
+-CFLAGS+=-fPIC -DPIC
+-endif
+-CFLAGS+=-g -I$(SRCHOME)/include @CFLAGS@
++CFLAGS+=-fPIC -DPIC -g -I$(SRCHOME)/include @CFLAGS@
+ LIBNDPI=$(SRCHOME)/lib/libndpi.a
+ LIBS=$(LIBNDPI) @ADDITIONAL_LIBS@ -lpthread @LIBS@
+ LDFLAGS=@LDFLAGS@
+@@ -18,7 +15,7 @@ EXECUTABLE_SOURCES := dga_evaluate.c
+ all: dga_evaluate$(EXE_SUFFIX)
  
  EXECUTABLE_SOURCES := dga_evaluate.c
 -COMMON_SOURCES := $(filter-out $(EXECUTABLE_SOURCES),$(wildcard *.c ))
-+COMMON_SOURCES=
++COMMON_SOURCES =
  
- dga_evaluate: $(LIBNDPI) dga_evaluate.o
+ dga_evaluate$(EXE_SUFFIX): $(LIBNDPI) dga_evaluate.o
  	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) dga_evaluate.o $(LIBS) -o $@
-@@ -42,5 +39,3 @@ distdir:
+@@ -38,6 +35,4 @@ distclean: clean
  
  distclean: clean
  	/bin/rm -f Makefile
 -
--endif
+-check:
+ 	true # nothing to do here, done by invoking tests/do-dga.sh
diff --git a/net/ndpi/files/patch-tests_unit_Makefile.in b/net/ndpi/files/patch-tests_unit_Makefile.in
index d56c22da2529..96040ac63d7d 100644
--- a/net/ndpi/files/patch-tests_unit_Makefile.in
+++ b/net/ndpi/files/patch-tests_unit_Makefile.in
@@ -1,26 +1,50 @@
---- tests/unit/Makefile.in.orig	2022-02-01 08:14:05 UTC
+--- tests/unit/Makefile.in.orig	2022-07-14 16:13:42 UTC
 +++ tests/unit/Makefile.in
-@@ -12,16 +12,10 @@ HEADERS=$(SRCHOME)/include/ndpi_api.h $(SRCHOME)/inclu
+@@ -5,10 +5,7 @@ SRCHOME=../../src
+ 
+ SRCHOME=../../src
+ 
+-ifneq ($(OS),Windows_NT)
+-CFLAGS+=-fPIC -DPIC
+-endif
+-CFLAGS+=-g -I$(SRCHOME)/include @JSONC_CFLAGS@ @PCAP_INC@ @CFLAGS@
++CFLAGS+=-fPIC -DPIC -g -I$(SRCHOME)/include @JSONC_CFLAGS@ @PCAP_INC@ @CFLAGS@
+ LIBNDPI=$(SRCHOME)/lib/libndpi.a
+ LIBS=$(LIBNDPI) @PCAP_LIB@ @ADDITIONAL_LIBS@ @JSONC_LIBS@ @LIBS@
+ LDFLAGS=@LDFLAGS@
+@@ -16,28 +13,7 @@ PREFIX?=@prefix@
  OBJS=unit
  PREFIX?=@prefix@
  
 -ifneq ($(BUILD_MINGW),)
--all:
--	@echo 'Unit tests disabled due to mingw build.'
 -
+-ifeq ($(DISABLE_NPCAP),0)
+-CFLAGS+=-I@srcdir@/../windows/WpdPack/Include -I@srcdir@/../windows/WpdPack/Include/pcap
 -else
+-CFLAGS+=-DDISABLE_NPCAP
+-endif
 -
- all: unit
+-ifeq ($(DISABLE_NPCAP),0)
+-
+-ifneq ($(BUILD_MINGW_X64),)
+-LIBS+=@srcdir@/../windows/WpdPack/Lib/x64/wpcap.lib
+-else
+-LIBS+=@srcdir@/../windows/WpdPack/Lib/wpcap.lib
+-endif
+-
+-endif
+-
+-LIBS+=-Wl,-Bstatic -lpthread -Wl,-Bdynamic
+-else
+ LIBS+=-pthread
+-endif
  
- EXECUTABLE_SOURCES := unit.c
--COMMON_SOURCES := $(filter-out $(EXECUTABLE_SOURCES),$(wildcard *.c ))
-+COMMON_SOURCES= 
+ all: unit$(EXE_SUFFIX)
  
- unit: $(LIBNDPI) unit.o
- 	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) unit.o $(LIBS) -o $@
-@@ -42,5 +36,3 @@ distdir:
+@@ -62,6 +38,4 @@ distclean: clean
  
  distclean: clean
  	/bin/rm -f Makefile
 -
--endif
+-check:
+ 	true # nothing to do here, done by invoking tests/do-unit.sh