aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorMingli Yu <mingli.yu@windriver.com>2020-11-09 12:29:30 +0800
committerKhem Raj <raj.khem@gmail.com>2020-11-09 20:49:52 -0800
commitf5b9e4ecd2cbcb4b6eae894a78cba8e72481c3a3 (patch)
tree073259668f47f45024e11e2e7721ab8283edeb9e /meta-networking
parent3b6b36e32d1eb9fa2ce82a756a5954c77d5e5c9d (diff)
downloadmeta-openembedded-contrib-f5b9e4ecd2cbcb4b6eae894a78cba8e72481c3a3.tar.gz
ntopng: add new recipe
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. Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-support/ntopng/files/0001-Makefile.in-don-t-use-the-internal-lua.patch39
-rw-r--r--meta-networking/recipes-support/ntopng/files/0001-autogen.sh-generate-configure.ac-only.patch36
-rw-r--r--meta-networking/recipes-support/ntopng/files/0001-configure.seed-fix-configure-error.patch42
-rw-r--r--meta-networking/recipes-support/ntopng/files/0001-configure.seed-fix-host-contamination.patch82
-rw-r--r--meta-networking/recipes-support/ntopng/files/0001-configure.seed-not-check-clang-on-host.patch47
-rw-r--r--meta-networking/recipes-support/ntopng/files/ntopng.service13
-rw-r--r--meta-networking/recipes-support/ntopng/ntopng_4.2.bb48
7 files changed, 307 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/ntopng/files/0001-Makefile.in-don-t-use-the-internal-lua.patch b/meta-networking/recipes-support/ntopng/files/0001-Makefile.in-don-t-use-the-internal-lua.patch
new file mode 100644
index 0000000000..46724558c4
--- /dev/null
+++ b/meta-networking/recipes-support/ntopng/files/0001-Makefile.in-don-t-use-the-internal-lua.patch
@@ -0,0 +1,39 @@
+From 65c15247d268566b79e4595b8e734b7e40679d75 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+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 <mingli.yu@windriver.com>
+---
+ 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)-@REVISION@.noarch.rpm
+ ######
+
+-LIB_TARGETS = $(LUA_LIB)
+
+ ifneq ($(HAS_ZEROMQ), 0)
+ LIB_TARGETS += $(ZEROMQ_LIB)
+--
+2.26.2
+
diff --git a/meta-networking/recipes-support/ntopng/files/0001-autogen.sh-generate-configure.ac-only.patch b/meta-networking/recipes-support/ntopng/files/0001-autogen.sh-generate-configure.ac-only.patch
new file mode 100644
index 0000000000..8d62147b9e
--- /dev/null
+++ b/meta-networking/recipes-support/ntopng/files/0001-autogen.sh-generate-configure.ac-only.patch
@@ -0,0 +1,36 @@
+From 22f0bec462763f1b0b92daa33133e274d3b45f4f Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+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 <mingli.yu@windriver.com>
+---
+ 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
+
diff --git a/meta-networking/recipes-support/ntopng/files/0001-configure.seed-fix-configure-error.patch b/meta-networking/recipes-support/ntopng/files/0001-configure.seed-fix-configure-error.patch
new file mode 100644
index 0000000000..dffab24ca2
--- /dev/null
+++ b/meta-networking/recipes-support/ntopng/files/0001-configure.seed-fix-configure-error.patch
@@ -0,0 +1,42 @@
+From 29797dd037009d38e4976249ed21b2076240751e Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Wed, 4 Nov 2020 04:36:46 +0000
+Subject: [PATCH] configure.seed: fix configure error
+
+fix the below error:
+configure: error: cannot run test program while cross compiling
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ configure.seed | 13 +------------
+ 1 file changed, 1 insertion(+), 12 deletions(-)
+
+diff --git a/configure.seed b/configure.seed
+index a321f9bbf..03f9a31b0 100644
+--- a/configure.seed
++++ b/configure.seed
+@@ -642,18 +642,7 @@ if test x$radcli = xtrue; then
+ fi
+ fi
+
+-AC_CACHE_CHECK([if pthread rwlocks are supported], [my_cv_rw_locks_supported], [
+- AC_TRY_RUN([
+- #include <pthread.h>
+-
+- int main() {
+- pthread_rwlock_t t;
+- return 0;
+- }
+-]
+-, [my_cv_rw_locks_supported=yes], [my_cv_rw_locks_supported=no])
+-]
+-)
++AC_CACHE_CHECK([if pthread rwlocks are supported], [my_cv_rw_locks_supported])
+
+ if test "$my_cv_rw_locks_supported" = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_RW_LOCK, 1, [pthread rwlocks supported])
+--
+2.26.2
+
diff --git a/meta-networking/recipes-support/ntopng/files/0001-configure.seed-fix-host-contamination.patch b/meta-networking/recipes-support/ntopng/files/0001-configure.seed-fix-host-contamination.patch
new file mode 100644
index 0000000000..a5ac59fb32
--- /dev/null
+++ b/meta-networking/recipes-support/ntopng/files/0001-configure.seed-fix-host-contamination.patch
@@ -0,0 +1,82 @@
+From 81e3512718f80965c26ccb1f9d694c91b121fea0 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Wed, 4 Nov 2020 06:28:28 +0000
+Subject: [PATCH] configure.seed: fix host contamination
+
+Fix below error:
+This autoconf log indicates errors, it looked at host include and/or
+library paths while determining system capabilities.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ configure.seed | 47 +++++------------------------------------------
+ 1 file changed, 5 insertions(+), 42 deletions(-)
+
+diff --git a/configure.seed b/configure.seed
+index 03f9a31b0..58aebb5b8 100644
+--- a/configure.seed
++++ b/configure.seed
+@@ -79,31 +79,6 @@ fi
+ #
+ REVISION=`git log --pretty=oneline | wc -l`
+
+-if test -d "/usr/local/include"; then
+- CFLAGS="${CFLAGS} -I/usr/local/include"
+- CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
+-fi
+-
+-if test -d "/usr/local/lib"; then
+- LDFLAGS="${LDFLAGS} -L/usr/local/lib"
+-fi
+-
+-if test -d /opt/local/include; then :
+- CFLAGS="${CFLAGS} -I/opt/local/include"
+- CPPFLAGS="${CPPFLAGS} -I/opt/local/include"
+-fi
+-
+-if test -d /opt/local/lib; then :
+- LDFLAGS="${LDFLAGS} -L/opt/local/lib"
+-fi
+-
+-if [ test -f /usr/bin/lsb_release ]; then
+- CODENAME=`/usr/bin/lsb_release -c|cut -f 2`
+- if [[ $CODENAME == "wheezy" ]]; then :
+- CPPFLAGS="${CPPFLAGS} -DOLD_NETFILTER_INTERFACE=1"
+- fi
+-fi
+-
+ SHORT_MACHINE=`uname -m | cut -b1-3`
+
+ GIT_RELEASE="@GIT_RELEASE@"
+@@ -214,23 +189,11 @@ dnl> fi
+ pkg-config --exists libssl
+ if test "$?" -ne 1; then
+ AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl])
+- SSL_INC="`pkg-config --cflags libssl` -I/usr/include/openssl"
++ SSL_INC="`pkg-config --cflags libssl`"
+ SSL_LIB="`pkg-config --libs libssl` -lssl -lcrypto"
+ else
+- dnl Workaround for MacOS Brew
+- if test -d "/usr/local/opt/openssl/lib"; then
+- AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl])
+- SSL_INC="-I/usr/local/opt/openssl/include"
+- SSL_LIB="-L/usr/local/opt/openssl/lib -lssl"
+- dnl Workaround for FreeBSD
+- elif test -f "/usr/lib/libssl.so"; then
+- AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl])
+- SSL_INC="-I/usr/include"
+- SSL_LIB="-L/usr/lib -lssl -lcrypto"
+- else
+- echo "Please install openssl-dev(el) package prerequisite"
+- exit -1
+- fi
++ echo "Please install openssl-dev(el) package prerequisite"
++ exit -1
+ fi
+
+ AC_CHECK_LIB([gcrypt], [gcry_cipher_checktag], [LDFLAGS="${LDFLAGS} -lgcrypt"])
+--
+2.26.2
+
diff --git a/meta-networking/recipes-support/ntopng/files/0001-configure.seed-not-check-clang-on-host.patch b/meta-networking/recipes-support/ntopng/files/0001-configure.seed-not-check-clang-on-host.patch
new file mode 100644
index 0000000000..95d1f99481
--- /dev/null
+++ b/meta-networking/recipes-support/ntopng/files/0001-configure.seed-not-check-clang-on-host.patch
@@ -0,0 +1,47 @@
+From eead0c589b71d4256bf9f16492164786b0ee07e4 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Mon, 9 Nov 2020 04:05:25 +0000
+Subject: [PATCH] configure.seed: not check clang on host
+
+Don't check clang on host to avoid host contamination.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ configure.seed | 19 -------------------
+ 1 file changed, 19 deletions(-)
+
+diff --git a/configure.seed b/configure.seed
+index d0335b599..cb97adca2 100644
+--- a/configure.seed
++++ b/configure.seed
+@@ -509,25 +509,6 @@ if test $SYSTEM = "Darwin"; then
+ CFLAGS="-fno-color-diagnostics $CFLAGS"
+ fi
+ fi
+-else
+- if test $SYSTEM = "Linux"; then
+- if [ test -f /usr/bin/clang++ ]; then
+- CC=clang
+- CXX=clang++
+- AC_MSG_RESULT(Using clang++ compiler)
+- fi
+-
+- if [ test -f /etc/redhat-release ]; then
+- if [ test -f /usr/bin/lsb_release ]; then
+- dnl> CentOS 7
+- CENTOS_N2N_DEP=", n2n"
+- fi
+- else
+- if [ test -f /usr/bin/lsb_release ]; then
+- OS=`/usr/bin/lsb_release -d|cut -d ':' -f 2`
+- fi
+- fi
+- fi
+ fi
+
+ dnl> Remove spaces
+--
+2.26.2
+
diff --git a/meta-networking/recipes-support/ntopng/files/ntopng.service b/meta-networking/recipes-support/ntopng/files/ntopng.service
new file mode 100644
index 0000000000..66912fbefa
--- /dev/null
+++ b/meta-networking/recipes-support/ntopng/files/ntopng.service
@@ -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
diff --git a/meta-networking/recipes-support/ntopng/ntopng_4.2.bb b/meta-networking/recipes-support/ntopng/ntopng_4.2.bb
new file mode 100644
index 0000000000..bd2b99fab2
--- /dev/null
+++ b/meta-networking/recipes-support/ntopng/ntopng_4.2.bb
@@ -0,0 +1,48 @@
+SUMMARY = "Web-based Traffic and Security Network Traffic Monitoring"
+DESCRIPTION = "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."
+
+SECTION = "console/network"
+
+DEPENDS = "curl libmaxminddb libpcap lua mariadb ndpi json-c rrdtool zeromq"
+RDEPENDS_${PN} = "bash redis"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRCREV = "5e649a2d1130b4a3ab0c5bb673d615172cc0bdbb"
+SRC_URI = "git://github.com/ntop/ntopng.git;protocol=git;branch=4.2-stable \
+ file://0001-configure.seed-fix-configure-error.patch \
+ file://0001-configure.seed-fix-host-contamination.patch \
+ file://0001-Makefile.in-don-t-use-the-internal-lua.patch \
+ file://0001-autogen.sh-generate-configure.ac-only.patch \
+ file://0001-configure.seed-not-check-clang-on-host.patch \
+ file://ntopng.service \
+"
+
+S = "${WORKDIR}/git"
+
+# don't use the lua under thirdparty as it supports cross compiling badly
+export LUA_LIB = "${STAGING_LIBDIR}/liblua.a"
+
+LDFLAGS_append_mipsarch = " -latomic"
+LDFLAGS_append_powerpc = " -latomic"
+inherit autotools-brokensep gettext systemd
+
+do_install_append() {
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/ntopng.service ${D}${systemd_unitdir}/system
+}
+
+FILES_${PN} += "\
+ ${systemd_unitdir}/system/ntopng.service"
+
+FILES_${PN}-doc += "\
+ /usr/man/man8/ntopng.8"
+
+do_configure_prepend() {
+ ${S}/autogen.sh
+}
+
+SYSTEMD_SERVICE_${PN} = "ntopng.service"