Skip to contentSkip to conversation

libmaxminddb: add new recipe

PATCH In review Yu, Mingli 2 participants 5 messages Nov 5, 2020 – Nov 7, 2020

lore
Share & tools
lore

Yu, Mingli

author
#0 lore raw

PATCH 1/4 libmaxminddb: add new recipe

From: Mingli Yu <[email protected]>

The libmaxminddb library provides a C library for reading MaxMind DB files, including the GeoIP2 databases from MaxMind.

---
 .../libmaxminddb/libmaxminddb_1.4.3.bb        | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 meta-networking/recipes-support/libmaxminddb/libmaxminddb_1.4.3.bb
meta-networking/recipes-support/libmaxminddb/libmaxminddb_1.4.3.bb new file +20 -0
new file mode 100644
index 000000000..d5c303861
@@ -0,0 +1,20 @@
+SUMMARY = "C library for the MaxMind DB file format"
+DESCRIPTION = "The libmaxminddb library provides a C library for reading MaxMind DB files, \
+ncluding the GeoIP2 databases from MaxMind. This is a custom binary \
+format designed to facilitate fast lookups of IP addresses while allowing \
+for great flexibility in the type of data associated with an address."
+
+HOMEPAGE = "https://github.com/maxmind/libmaxminddb"
+SECTION = "libdevel"
+LICENSE = " Apache-2.0"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
+"
+SRC_URI = "https://github.com/maxmind/libmaxminddb/releases/download/${PV}/${BPN}-${PV}.tar.gz \
+"
+SRC_URI[sha256sum] = "a5fdf6c7b4880fdc7620f8ace5bd5cbe9f65650c9493034b5b9fc7d83551a439"
+
+S = "${WORKDIR}/${BPN}-${PV}"
+
+inherit autotools-brokensep
+
Signature · 1 line
2.26.2
author
#1 lore raw

PATCH 2/4 ndpi: add new recipe

From: Mingli Yu <[email protected]>

nDPI is an open source LGPLv3 library for deep-packet inspection.

---
 ...01-autogen.sh-not-generate-configure.patch | 33 +++++++++++++++++++
 .../recipes-support/ntopng/ndpi_3.4.bb        | 26 +++++++++++++++
 2 files changed, 59 insertions(+)
 create mode 100644 meta-networking/recipes-support/ntopng/files/0001-autogen.sh-not-generate-configure.patch
 create mode 100644 meta-networking/recipes-support/ntopng/ndpi_3.4.bb
meta-networking/recipes-support/ntopng/files/0001-autogen.sh-not-generate-configure.patch new file +33 -0
new file mode 100644
index 000000000..ffc6ec1ef
@@ -0,0 +1,33 @@
+From d482bcc8fca90afc95ac3cbe848a3c9d7ad81ddc Mon Sep 17 00:00:00 2001
+From: Mingli Yu <[email protected]>
+Date: Wed, 4 Nov 2020 23:37:44 -0800
+Subject: [PATCH] autogen.sh: not generate configure
+
+Only use autogen.sh to generate configure.ac.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ autogen.sh | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/autogen.sh b/autogen.sh
+index df734ce9..d7bbf8cb 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -52,11 +52,3 @@ cat configure.seed | sed \
+     -e "s/@NDPI_VERSION_SHORT@/$NDPI_VERSION_SHORT/g" \
+     -e "s/@FUZZY@/$FUZZY/g" \
+     > configure.ac
+-
+-autoreconf -ivf
+-cat configure | sed "s/#define PACKAGE/#define NDPI_PACKAGE/g" | sed "s/#define VERSION/#define NDPI_VERSION/g"  > configure.tmp
+-cat configure.tmp > configure
+-
+-chmod +x configure
+-./configure $@
+-
+-- 
+2.17.1
+
meta-networking/recipes-support/ntopng/ndpi_3.4.bb new file +26 -0
new file mode 100644
index 000000000..1e4153779
@@ -0,0 +1,26 @@
+SUMMARY = "A library for deep-packet inspection."
+DESCRIPTION = "nDPI is an open source LGPLv3 library for deep-packet \
+inspection. Based on OpenDPI it includes ntop extensions"
+
+SECTION = "libdevel"
+DEPENDS = "libpcap"
+RDEPENDS_${PN} += " libpcap"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b52f2d57d10c4f7ee67a7eb9615d5d24"
+
+SRCREV = "64929a75e0a7a60d864bd25a9fd97fdf9ac892a2"
+SRC_URI = "git://github.com/ntop/nDPI.git;branch=3.4-stable \
+           file://0001-autogen.sh-not-generate-configure.patch \
+"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep pkgconfig
+
+do_configure_prepend() {
+    ${S}/autogen.sh
+}
+
+EXTRA_OEMAKE = " \
+    libdir=${libdir} \
+"
Signature · 1 line
2.26.2
author
#2 lore raw

PATCH 3/4 ntopng: add new recipe

In reply to Yu, Mingli

From: Mingli Yu <[email protected]>

ntopng is a web-based network traffic monitoring application released under GPLv3. It is the new incarnation of the original ntop written in 1998, and now revamped in terms of performance, usability, and features.

---
 ...kefile.in-don-t-use-the-internal-lua.patch | 39 +++++++++
 ...utogen.sh-generate-configure.ac-only.patch | 36 ++++++++
 ...1-configure.seed-fix-configure-error.patch | 42 ++++++++++
 ...onfigure.seed-fix-host-contamination.patch | 82 +++++++++++++++++++
 .../ntopng/files/ntopng.service               | 13 +++
 .../recipes-support/ntopng/ntopng_4.2.bb      | 47 +++++++++++
 6 files changed, 259 insertions(+)
 create mode 100644 meta-networking/recipes-support/ntopng/files/0001-Makefile.in-don-t-use-the-internal-lua.patch
 create mode 100644 meta-networking/recipes-support/ntopng/files/0001-autogen.sh-generate-configure.ac-only.patch
 create mode 100644 meta-networking/recipes-support/ntopng/files/0001-configure.seed-fix-configure-error.patch
 create mode 100644 meta-networking/recipes-support/ntopng/files/0001-configure.seed-fix-host-contamination.patch
 create mode 100644 meta-networking/recipes-support/ntopng/files/ntopng.service
 create mode 100644 meta-networking/recipes-support/ntopng/ntopng_4.2.bb
meta-networking/recipes-support/ntopng/files/0001-Makefile.in-don-t-use-the-internal-lua.patch new file +39 -0
new file mode 100644
index 000000000..46724558c
@@ -0,0 +1,39 @@
+From 65c15247d268566b79e4595b8e734b7e40679d75 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <[email protected]>
+Date: Wed, 4 Nov 2020 08:55:10 +0000
+Subject: [PATCH] Makefile.in: don't use the internal lua
+
+ntopng depends on lua and it will compile the lua under
+third-party sub dir of source tree, but this one supports
+cross-compiling badly, so use the one under RECIPE_SYSROOT.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ Makefile.in | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 143535746..fc06a5341 100755
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -40,7 +40,6 @@ endif
+ 
+ LUA_HOME=${PWD}/third-party/lua-5.3.5
+ LUA_INC=-I$(LUA_HOME)/src
+-LUA_LIB=$(LUA_HOME)/src/liblua.a
+ 
+ ######
+ LIBRRDTOOL_HOME=${PWD}/third-party/rrdtool-1.4.8
+@@ -118,7 +117,6 @@ RPM_PKG = $(TARGET)-$(NTOPNG_VERSION)-@REVISION@.$(PLATFORM).rpm
+ RPM_DATA_PKG = $(TARGET)-data-$(NTOPNG_VERSION)-@[email protected]
+ ######
+ 
+-LIB_TARGETS = $(LUA_LIB)
+ 
+ ifneq ($(HAS_ZEROMQ), 0)
+ LIB_TARGETS += $(ZEROMQ_LIB)
+-- 
+2.26.2
+
meta-networking/recipes-support/ntopng/files/0001-autogen.sh-generate-configure.ac-only.patch new file +36 -0
new file mode 100644
index 000000000..8d62147b9
@@ -0,0 +1,36 @@
+From 22f0bec462763f1b0b92daa33133e274d3b45f4f Mon Sep 17 00:00:00 2001
+From: Mingli Yu <[email protected]>
+Date: Thu, 5 Nov 2020 00:05:21 -0800
+Subject: [PATCH] autogen.sh: generate configure.ac only
+
+The autogen.sh should only generate configure.ac and the
+logic used to generate configure script should follow the
+autotools.bbclass in oe. Otherwise there may comes below
+do_configure error:
+ | checking whether we are cross compiling... configure: error: in `/path/tmp/work/core2-64-poky-linux/ndpi/3.4-r0/git':
+ | configure: error: cannot run C compiled programs.
+ | If you meant to cross compile, use `--host'.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ autogen.sh | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/autogen.sh b/autogen.sh
+index 73f8d0ebe..15ff0aa84 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -73,8 +73,3 @@ cat configure.seed | sed \
+     > configure.ac
+ 
+ rm -f config.h config.h.in *~ #*
+-
+-echo "Wait please..."
+-autoreconf -if
+-echo ""
+-echo "Now run ./configure"
+-- 
+2.17.1
+
meta-networking/recipes-support/ntopng/files/0001-configure.seed-fix-configure-error.patch new file +42 -0

42 lines not on this page · raw message

meta-networking/recipes-support/ntopng/files/0001-configure.seed-fix-host-contamination.patch new file +82 -0

82 lines not on this page · raw message

meta-networking/recipes-support/ntopng/files/ntopng.service new file +13 -0
new file mode 100644
index 000000000..66912fbef
@@ -0,0 +1,13 @@
+[Unit]
+Description=ntopng - High-Speed Web-based Traffic Analysis and Flow Collection Tool
+After=network.target
+
+[Service]
+Type=forking
+StandardOutput=syslog
+StandardError=inherit
+ExecStart=/usr/bin/ntopng -e -w 3000
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
meta-networking/recipes-support/ntopng/ntopng_4.2.bb new file +47 -0

47 lines not on this page · raw message

Signature · 1 line
2.26.2
author
#3 lore raw

PATCH 4/4 ntop: remove the recipe

In reply to Yu, Mingli

From: Mingli Yu <[email protected]>

The ntop project is inactive and there is no new version since 2012 [1] and it has been replaced by ntopng.

[1] https://sourceforge.net/projects/ntop/files/ntop/Stable/

---
 .../ntop/0001-nDPI-Include-sys-types.h.patch  |  26 --
 ...-Makefile.am-fix-for-automake-1.16.1.patch |  74 ------
 .../ntop/ntop/embed-libs.patch                |  20 --
 ...issing-return-from-non-void-function.patch |  19 --
 .../recipes-support/ntop/ntop/ntop.service    |  15 --
 .../ntop/ntop/ntop_configure_in.patch         | 164 -------------
 ...p_configure_in_net_snmp_config_exist.patch |  21 --
 .../recipes-support/ntop/ntop/ntop_init.patch | 228 ------------------
 .../ntop/ntop/ntop_webInterface.patch         |  19 --
 .../ntop/ntop/use-static-inline.patch         |  32 ---
 .../recipes-support/ntop/ntop_5.0.1.bb        | 142 -----------
 11 files changed, 760 deletions(-)
 delete mode 100644 meta-networking/recipes-support/ntop/ntop/0001-nDPI-Include-sys-types.h.patch
 delete mode 100644 meta-networking/recipes-support/ntop/ntop/0001-plugins-Makefile.am-fix-for-automake-1.16.1.patch
 delete mode 100644 meta-networking/recipes-support/ntop/ntop/embed-libs.patch
 delete mode 100644 meta-networking/recipes-support/ntop/ntop/fix-missing-return-from-non-void-function.patch
 delete mode 100644 meta-networking/recipes-support/ntop/ntop/ntop.service
 delete mode 100644 meta-networking/recipes-support/ntop/ntop/ntop_configure_in.patch
 delete mode 100644 meta-networking/recipes-support/ntop/ntop/ntop_configure_in_net_snmp_config_exist.patch
 delete mode 100644 meta-networking/recipes-support/ntop/ntop/ntop_init.patch
 delete mode 100644 meta-networking/recipes-support/ntop/ntop/ntop_webInterface.patch
 delete mode 100644 meta-networking/recipes-support/ntop/ntop/use-static-inline.patch
 delete mode 100644 meta-networking/recipes-support/ntop/ntop_5.0.1.bb
meta-networking/recipes-support/ntop/ntop/0001-nDPI-Include-sys-types.h.patch deleted +0 -26
deleted file mode 100644
index 81ffeec21..000000000
@@ -1,26 +0,0 @@
-From 6543f3e2d5fe214e2fc6c050289bf1ae73b18724 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Wed, 30 Aug 2017 13:56:24 -0700
-Subject: [PATCH] nDPI: Include sys/types.h
-
-Needed for uint_t types
-
-Signed-off-by: Khem Raj <[email protected]>
----
-Upstream-Status: Pending
-
- nDPI/src/include/ipq_api.h | 1 +
- 1 file changed, 1 insertion(+)
-
-Index: ntop-5.0.1/nDPI/src/include/ipq_api.h
-===================================================================
---- ntop-5.0.1.orig/nDPI/src/include/ipq_api.h
-+++ ntop-5.0.1/nDPI/src/include/ipq_api.h
-@@ -24,6 +24,7 @@
- #ifndef __IPOQUE_API_INCLUDE_FILE__
- #define __IPOQUE_API_INCLUDE_FILE__
- 
-+#include <sys/types.h>
- 
- #if defined(HAVE_NTOP) && defined(WIN32)
- #include <winsock2.h>
meta-networking/recipes-support/ntop/ntop/0001-plugins-Makefile.am-fix-for-automake-1.16.1.patch deleted +0 -74

74 lines not on this page · raw message

meta-networking/recipes-support/ntop/ntop/embed-libs.patch deleted +0 -20
deleted file mode 100644
index 2d1ab7371..000000000
@@ -1,20 +0,0 @@
-Use --embed option so that it can return libpython as well
-
-% ../recipe-sysroot-native/usr/bin/python3-native/python3-config --libs --embed
--lpython3.8 -lcrypt -lpthread -ldl -lutil -lm -lm
-[kraj@apollo /mnt/b/yoe/build/tmp/work/cortexa7t2hf-neon-vfpv4-yoe-linux-gnueabi/ntop/5.0.1-r0/ntop-5.0.1]
-% ../recipe-sysroot-native/usr/bin/python3-native/python3-config --libs
--lcrypt -lpthread -ldl -lutil -lm -lm
-
-Signed-off-by: Khem Raj <[email protected]>
---- a/configure.in
-+++ b/configure.in
-@@ -1463,7 +1463,7 @@ dnl>
-   fi
- 
-   if test "x$PYTHON_CONFIG" != "x"; then
--    PYTHON_LIBS="`$PYTHON_CONFIG --libs`"
-+    PYTHON_LIBS="`$PYTHON_CONFIG --libs --embed`"
-     if test "x$PYTHON_LIBS" = "x"; then
-       AC_MSG_RESULT(Python[-devel] support is present but misconfigured)     
-     else   
meta-networking/recipes-support/ntop/ntop/fix-missing-return-from-non-void-function.patch deleted +0 -19
deleted file mode 100644
index e627e59a5..000000000
@@ -1,19 +0,0 @@
-Fix following error:
-
-netflowPlugin.c: In function 'netflowUtilsLoop':
-netflowPlugin.c:2144:1: error: no return statement in function returning non-void [-Werror=return-type]
- 2144 | }
-      | ^
-
-Return NULL like netflowMainLoop does.
-
---- ntop-5.0.1.orig/plugins/netflowPlugin.c	2012-03-09 17:44:17.000000000 +0000
-+++ ntop-5.0.1/plugins/netflowPlugin.c	2019-08-09 10:25:40.878799852 +0000
-@@ -2141,6 +2141,7 @@
-       waitCondvar(&myGlobals.device[deviceId].netflowGlobals->ifStatsQueueCondvar);
-     }
-   }
-+  return(NULL);
- }
- #endif
- 
meta-networking/recipes-support/ntop/ntop/ntop.service deleted +0 -15
deleted file mode 100644
index 1ead2a0c5..000000000
@@ -1,15 +0,0 @@
-[Unit]
-Description=A network traffic probe similar to the UNIX top command
-Requires=network.target
-
-ConditionPathExists=@SYSCONFDIR@/ntop.conf
-After=syslog.target network.target
-
-[Service]
-Type=oneshot
-RemainAfterExit=yes
-ExecStart=@LIBEXECDIR@/ntop-helper start
-ExecStop=@LIBEXECDIR@/ntop-helper stop
-
-[Install]
-WantedBy=multi-user.target
meta-networking/recipes-support/ntop/ntop/ntop_configure_in.patch deleted +0 -164

164 lines not on this page · raw message

meta-networking/recipes-support/ntop/ntop/ntop_configure_in_net_snmp_config_exist.patch deleted +0 -21
deleted file mode 100644
index 269138df9..000000000
@@ -1,21 +0,0 @@
-Check net-snmp-config's existence in case user specified the
-ac_cv_prog_NETSNMP to avoid HAVE_SNMP defined if the specified
-net-snmp-config doesn't exist.
-
-Upstream-Status: Inappropriate [Embedded specific]
-
-Signed-off-by: Yao Zhao <[email protected]>
----
-diff --git a/configure.in b/configure.in
-index 6f3e88f..8ddf017 100755
---- a/configure.in
-+++ b/configure.in
-@@ -1423,7 +1423,7 @@ dnl> NET-SNMP
- dnl>
- if test ".${ac_disable_snmp}" != ".yes"; then
-   AC_CHECK_TOOL(NETSNMP, net-snmp-config)
--  if test -n "$NETSNMP"; then
-+  if test -n "$NETSNMP" -a -e "$NETSNMP"; then
-     AC_DEFINE_UNQUOTED(HAVE_SNMP, 1, [SNMP is supported])
-     SNMPLIBS="`$NETSNMP --libs`"
-     SNMPLIBS="`echo ${SNMPLIBS}|sed -e s,'-R../lib',,g`"
meta-networking/recipes-support/ntop/ntop/ntop_init.patch deleted +0 -228

228 lines not on this page · raw message

meta-networking/recipes-support/ntop/ntop/ntop_webInterface.patch deleted +0 -19
deleted file mode 100644
index 9f57ca425..000000000
@@ -1,19 +0,0 @@
-change osName to version as it prints out "ntop Version".
-
-Upstream-Status: Pending
-
-Signed-off-by: Yao Zhao <[email protected]>
----
-diff --git a/webInterface.c b/webInterface.c
-index 5622e69..8cb7a67 100644
---- a/webInterface.c
-+++ b/webInterface.c
-@@ -5816,7 +5816,7 @@ static void printNtopConfigInfoData(int textPrintFlag, UserPref *pref) {
-   printInfoSectionTitle(textPrintFlag, "Basic Information");
- 
-   safe_snprintf(__FILE__, __LINE__, formatBuf, sizeof(formatBuf), "%s (%d bit)",
--		osName, sizeof(long) == 8 ? 64 : 32);
-+		version, sizeof(long) == 8 ? 64 : 32);
-   printFeatureConfigInfo(textPrintFlag, "ntop Version", formatBuf);
- 
- #ifndef WIN32
meta-networking/recipes-support/ntop/ntop/use-static-inline.patch deleted +0 -32
deleted file mode 100644
index 2b001c13e..000000000
@@ -1,32 +0,0 @@
-[PATCH] replace 'inline' with 'static inline' for gcc 5.x
-
-gcc 5.x defaults to -std=gnu11 instead of -std=gnu89 which change
-the semantics for inline functions and the standalone 'inline'
-causes error with "gcc5 -g -o0"
- 
-Replace inline with static inline to be compatible with both gcc 4
-and 5.
-
-Upstream-status: Pending
-
-Signed-off-by: Roy Li <[email protected]>
----
- nDPI/src/lib/protocols/ssl.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/nDPI/src/lib/protocols/ssl.c b/nDPI/src/lib/protocols/ssl.c
-index 245b8c3..72beda9 100644
---- a/nDPI/src/lib/protocols/ssl.c
-+++ b/nDPI/src/lib/protocols/ssl.c
-@@ -39,7 +39,7 @@ static void ipoque_int_ssl_add_connection(struct ipoque_detection_module_struct
- 
- #ifdef HAVE_NTOP
- #ifndef WIN32
--inline int min(int a, int b) { return(a < b ? a : b); }
-+static inline int min(int a, int b) { return(a < b ? a : b); }
- #endif
- 
- static void stripCertificateTrailer(char *buffer, int buffer_len) {
--- 
-1.9.1
-
meta-networking/recipes-support/ntop/ntop_5.0.1.bb deleted +0 -142

142 lines not on this page · raw message

Signature · 1 line
2.26.2
#4 lore raw
In reply to Yu, Mingli
Quoted 18 lines · Mingli

From: Mingli Yu <[email protected]>

The libmaxminddb library provides a C library for reading MaxMind DB files, including the GeoIP2 databases from MaxMind.

---
 .../libmaxminddb/libmaxminddb_1.4.3.bb        | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 meta-networking/recipes-support/libmaxminddb/libmaxminddb_1.4.3.bb
meta-networking/recipes-support/libmaxminddb/libmaxminddb_1.4.3.bb new file +0 -0
new file mode 100644
index 000000000..d5c303861

meta-networking/recipes-support/libmaxminddb/libmaxminddb_1.4.3.bb line 8

Quoted 8 lines
meta-networking/recipes-support/libmaxminddb/libmaxminddb_1.4.3.bb new file +8 -0
@@ -0,0 +1,20 @@
+SUMMARY = "C library for the MaxMind DB file format"
+DESCRIPTION = "The libmaxminddb library provides a C library for reading MaxMind DB files, \
+ncluding the GeoIP2 databases from MaxMind. This is a custom binary \
+format designed to facilitate fast lookups of IP addresses while allowing \
+for great flexibility in the type of data associated with an address."
+
+HOMEPAGE = "https://github.com/maxmind/libmaxminddb"
+SECTION = "libdevel"

Call it just libs or devel

meta-networking/recipes-support/libmaxminddb/libmaxminddb_1.4.3.bb line 17

Quoted 9 lines
meta-networking/recipes-support/libmaxminddb/libmaxminddb_1.4.3.bb new file +9 -0
+LICENSE = " Apache-2.0"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
+"
+SRC_URI = "https://github.com/maxmind/libmaxminddb/releases/download/${PV}/${BPN}-${PV}.tar.gz \
+"
+SRC_URI[sha256sum] = "a5fdf6c7b4880fdc7620f8ace5bd5cbe9f65650c9493034b5b9fc7d83551a439"
+
+S = "${WORKDIR}/${BPN}-${PV}"

This is defaults for S so lets get rid of it here.

Quoted 9 lines
meta-networking/recipes-support/libmaxminddb/libmaxminddb_1.4.3.bb new file +3 -1
+
+inherit autotools-brokensep
+
--

2.26.2