diff options
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 @@ | |||
1 | From 65c15247d268566b79e4595b8e734b7e40679d75 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
3 | Date: Wed, 4 Nov 2020 08:55:10 +0000 | ||
4 | Subject: [PATCH] Makefile.in: don't use the internal lua | ||
5 | |||
6 | ntopng depends on lua and it will compile the lua under | ||
7 | third-party sub dir of source tree, but this one supports | ||
8 | cross-compiling badly, so use the one under RECIPE_SYSROOT. | ||
9 | |||
10 | Upstream-Status: Inappropriate [embedded specific] | ||
11 | |||
12 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
13 | --- | ||
14 | Makefile.in | 2 -- | ||
15 | 1 file changed, 2 deletions(-) | ||
16 | |||
17 | diff --git a/Makefile.in b/Makefile.in | ||
18 | index 143535746..fc06a5341 100755 | ||
19 | --- a/Makefile.in | ||
20 | +++ b/Makefile.in | ||
21 | @@ -40,7 +40,6 @@ endif | ||
22 | |||
23 | LUA_HOME=${PWD}/third-party/lua-5.3.5 | ||
24 | LUA_INC=-I$(LUA_HOME)/src | ||
25 | -LUA_LIB=$(LUA_HOME)/src/liblua.a | ||
26 | |||
27 | ###### | ||
28 | LIBRRDTOOL_HOME=${PWD}/third-party/rrdtool-1.4.8 | ||
29 | @@ -118,7 +117,6 @@ RPM_PKG = $(TARGET)-$(NTOPNG_VERSION)-@REVISION@.$(PLATFORM).rpm | ||
30 | RPM_DATA_PKG = $(TARGET)-data-$(NTOPNG_VERSION)-@REVISION@.noarch.rpm | ||
31 | ###### | ||
32 | |||
33 | -LIB_TARGETS = $(LUA_LIB) | ||
34 | |||
35 | ifneq ($(HAS_ZEROMQ), 0) | ||
36 | LIB_TARGETS += $(ZEROMQ_LIB) | ||
37 | -- | ||
38 | 2.26.2 | ||
39 | |||
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 @@ | |||
1 | From 22f0bec462763f1b0b92daa33133e274d3b45f4f Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
3 | Date: Thu, 5 Nov 2020 00:05:21 -0800 | ||
4 | Subject: [PATCH] autogen.sh: generate configure.ac only | ||
5 | |||
6 | The autogen.sh should only generate configure.ac and the | ||
7 | logic used to generate configure script should follow the | ||
8 | autotools.bbclass in oe. Otherwise there may comes below | ||
9 | do_configure error: | ||
10 | | checking whether we are cross compiling... configure: error: in `/path/tmp/work/core2-64-poky-linux/ndpi/3.4-r0/git': | ||
11 | | configure: error: cannot run C compiled programs. | ||
12 | | If you meant to cross compile, use `--host'. | ||
13 | |||
14 | Upstream-Status: Inappropriate [embedded specific] | ||
15 | |||
16 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
17 | --- | ||
18 | autogen.sh | 5 ----- | ||
19 | 1 file changed, 5 deletions(-) | ||
20 | |||
21 | diff --git a/autogen.sh b/autogen.sh | ||
22 | index 73f8d0ebe..15ff0aa84 100755 | ||
23 | --- a/autogen.sh | ||
24 | +++ b/autogen.sh | ||
25 | @@ -73,8 +73,3 @@ cat configure.seed | sed \ | ||
26 | > configure.ac | ||
27 | |||
28 | rm -f config.h config.h.in *~ #* | ||
29 | - | ||
30 | -echo "Wait please..." | ||
31 | -autoreconf -if | ||
32 | -echo "" | ||
33 | -echo "Now run ./configure" | ||
34 | -- | ||
35 | 2.17.1 | ||
36 | |||
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 @@ | |||
1 | From 29797dd037009d38e4976249ed21b2076240751e Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
3 | Date: Wed, 4 Nov 2020 04:36:46 +0000 | ||
4 | Subject: [PATCH] configure.seed: fix configure error | ||
5 | |||
6 | fix the below error: | ||
7 | configure: error: cannot run test program while cross compiling | ||
8 | |||
9 | Upstream-Status: Inappropriate [embedded specific] | ||
10 | |||
11 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
12 | --- | ||
13 | configure.seed | 13 +------------ | ||
14 | 1 file changed, 1 insertion(+), 12 deletions(-) | ||
15 | |||
16 | diff --git a/configure.seed b/configure.seed | ||
17 | index a321f9bbf..03f9a31b0 100644 | ||
18 | --- a/configure.seed | ||
19 | +++ b/configure.seed | ||
20 | @@ -642,18 +642,7 @@ if test x$radcli = xtrue; then | ||
21 | fi | ||
22 | fi | ||
23 | |||
24 | -AC_CACHE_CHECK([if pthread rwlocks are supported], [my_cv_rw_locks_supported], [ | ||
25 | - AC_TRY_RUN([ | ||
26 | - #include <pthread.h> | ||
27 | - | ||
28 | - int main() { | ||
29 | - pthread_rwlock_t t; | ||
30 | - return 0; | ||
31 | - } | ||
32 | -] | ||
33 | -, [my_cv_rw_locks_supported=yes], [my_cv_rw_locks_supported=no]) | ||
34 | -] | ||
35 | -) | ||
36 | +AC_CACHE_CHECK([if pthread rwlocks are supported], [my_cv_rw_locks_supported]) | ||
37 | |||
38 | if test "$my_cv_rw_locks_supported" = yes; then | ||
39 | AC_DEFINE_UNQUOTED(HAVE_RW_LOCK, 1, [pthread rwlocks supported]) | ||
40 | -- | ||
41 | 2.26.2 | ||
42 | |||
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 @@ | |||
1 | From 81e3512718f80965c26ccb1f9d694c91b121fea0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
3 | Date: Wed, 4 Nov 2020 06:28:28 +0000 | ||
4 | Subject: [PATCH] configure.seed: fix host contamination | ||
5 | |||
6 | Fix below error: | ||
7 | This autoconf log indicates errors, it looked at host include and/or | ||
8 | library paths while determining system capabilities. | ||
9 | |||
10 | Upstream-Status: Inappropriate [OE specific] | ||
11 | |||
12 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
13 | --- | ||
14 | configure.seed | 47 +++++------------------------------------------ | ||
15 | 1 file changed, 5 insertions(+), 42 deletions(-) | ||
16 | |||
17 | diff --git a/configure.seed b/configure.seed | ||
18 | index 03f9a31b0..58aebb5b8 100644 | ||
19 | --- a/configure.seed | ||
20 | +++ b/configure.seed | ||
21 | @@ -79,31 +79,6 @@ fi | ||
22 | # | ||
23 | REVISION=`git log --pretty=oneline | wc -l` | ||
24 | |||
25 | -if test -d "/usr/local/include"; then | ||
26 | - CFLAGS="${CFLAGS} -I/usr/local/include" | ||
27 | - CPPFLAGS="${CPPFLAGS} -I/usr/local/include" | ||
28 | -fi | ||
29 | - | ||
30 | -if test -d "/usr/local/lib"; then | ||
31 | - LDFLAGS="${LDFLAGS} -L/usr/local/lib" | ||
32 | -fi | ||
33 | - | ||
34 | -if test -d /opt/local/include; then : | ||
35 | - CFLAGS="${CFLAGS} -I/opt/local/include" | ||
36 | - CPPFLAGS="${CPPFLAGS} -I/opt/local/include" | ||
37 | -fi | ||
38 | - | ||
39 | -if test -d /opt/local/lib; then : | ||
40 | - LDFLAGS="${LDFLAGS} -L/opt/local/lib" | ||
41 | -fi | ||
42 | - | ||
43 | -if [ test -f /usr/bin/lsb_release ]; then | ||
44 | - CODENAME=`/usr/bin/lsb_release -c|cut -f 2` | ||
45 | - if [[ $CODENAME == "wheezy" ]]; then : | ||
46 | - CPPFLAGS="${CPPFLAGS} -DOLD_NETFILTER_INTERFACE=1" | ||
47 | - fi | ||
48 | -fi | ||
49 | - | ||
50 | SHORT_MACHINE=`uname -m | cut -b1-3` | ||
51 | |||
52 | GIT_RELEASE="@GIT_RELEASE@" | ||
53 | @@ -214,23 +189,11 @@ dnl> fi | ||
54 | pkg-config --exists libssl | ||
55 | if test "$?" -ne 1; then | ||
56 | AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl]) | ||
57 | - SSL_INC="`pkg-config --cflags libssl` -I/usr/include/openssl" | ||
58 | + SSL_INC="`pkg-config --cflags libssl`" | ||
59 | SSL_LIB="`pkg-config --libs libssl` -lssl -lcrypto" | ||
60 | else | ||
61 | - dnl Workaround for MacOS Brew | ||
62 | - if test -d "/usr/local/opt/openssl/lib"; then | ||
63 | - AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl]) | ||
64 | - SSL_INC="-I/usr/local/opt/openssl/include" | ||
65 | - SSL_LIB="-L/usr/local/opt/openssl/lib -lssl" | ||
66 | - dnl Workaround for FreeBSD | ||
67 | - elif test -f "/usr/lib/libssl.so"; then | ||
68 | - AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl]) | ||
69 | - SSL_INC="-I/usr/include" | ||
70 | - SSL_LIB="-L/usr/lib -lssl -lcrypto" | ||
71 | - else | ||
72 | - echo "Please install openssl-dev(el) package prerequisite" | ||
73 | - exit -1 | ||
74 | - fi | ||
75 | + echo "Please install openssl-dev(el) package prerequisite" | ||
76 | + exit -1 | ||
77 | fi | ||
78 | |||
79 | AC_CHECK_LIB([gcrypt], [gcry_cipher_checktag], [LDFLAGS="${LDFLAGS} -lgcrypt"]) | ||
80 | -- | ||
81 | 2.26.2 | ||
82 | |||
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 @@ | |||
1 | From eead0c589b71d4256bf9f16492164786b0ee07e4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
3 | Date: Mon, 9 Nov 2020 04:05:25 +0000 | ||
4 | Subject: [PATCH] configure.seed: not check clang on host | ||
5 | |||
6 | Don't check clang on host to avoid host contamination. | ||
7 | |||
8 | Upstream-Status: Inappropriate [OE specific] | ||
9 | |||
10 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
11 | --- | ||
12 | configure.seed | 19 ------------------- | ||
13 | 1 file changed, 19 deletions(-) | ||
14 | |||
15 | diff --git a/configure.seed b/configure.seed | ||
16 | index d0335b599..cb97adca2 100644 | ||
17 | --- a/configure.seed | ||
18 | +++ b/configure.seed | ||
19 | @@ -509,25 +509,6 @@ if test $SYSTEM = "Darwin"; then | ||
20 | CFLAGS="-fno-color-diagnostics $CFLAGS" | ||
21 | fi | ||
22 | fi | ||
23 | -else | ||
24 | - if test $SYSTEM = "Linux"; then | ||
25 | - if [ test -f /usr/bin/clang++ ]; then | ||
26 | - CC=clang | ||
27 | - CXX=clang++ | ||
28 | - AC_MSG_RESULT(Using clang++ compiler) | ||
29 | - fi | ||
30 | - | ||
31 | - if [ test -f /etc/redhat-release ]; then | ||
32 | - if [ test -f /usr/bin/lsb_release ]; then | ||
33 | - dnl> CentOS 7 | ||
34 | - CENTOS_N2N_DEP=", n2n" | ||
35 | - fi | ||
36 | - else | ||
37 | - if [ test -f /usr/bin/lsb_release ]; then | ||
38 | - OS=`/usr/bin/lsb_release -d|cut -d ':' -f 2` | ||
39 | - fi | ||
40 | - fi | ||
41 | - fi | ||
42 | fi | ||
43 | |||
44 | dnl> Remove spaces | ||
45 | -- | ||
46 | 2.26.2 | ||
47 | |||
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 @@ | |||
1 | [Unit] | ||
2 | Description=ntopng - High-Speed Web-based Traffic Analysis and Flow Collection Tool | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | StandardOutput=syslog | ||
8 | StandardError=inherit | ||
9 | ExecStart=/usr/bin/ntopng -e -w 3000 | ||
10 | Restart=on-abort | ||
11 | |||
12 | [Install] | ||
13 | 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 @@ | |||
1 | SUMMARY = "Web-based Traffic and Security Network Traffic Monitoring" | ||
2 | DESCRIPTION = "ntopng is a web-based network traffic monitoring application \ | ||
3 | released under GPLv3. It is the new incarnation of the original \ | ||
4 | ntop written in 1998, and now revamped in terms of performance, \ | ||
5 | usability, and features." | ||
6 | |||
7 | SECTION = "console/network" | ||
8 | |||
9 | DEPENDS = "curl libmaxminddb libpcap lua mariadb ndpi json-c rrdtool zeromq" | ||
10 | RDEPENDS_${PN} = "bash redis" | ||
11 | LICENSE = "GPLv3" | ||
12 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" | ||
13 | |||
14 | SRCREV = "5e649a2d1130b4a3ab0c5bb673d615172cc0bdbb" | ||
15 | SRC_URI = "git://github.com/ntop/ntopng.git;protocol=git;branch=4.2-stable \ | ||
16 | file://0001-configure.seed-fix-configure-error.patch \ | ||
17 | file://0001-configure.seed-fix-host-contamination.patch \ | ||
18 | file://0001-Makefile.in-don-t-use-the-internal-lua.patch \ | ||
19 | file://0001-autogen.sh-generate-configure.ac-only.patch \ | ||
20 | file://0001-configure.seed-not-check-clang-on-host.patch \ | ||
21 | file://ntopng.service \ | ||
22 | " | ||
23 | |||
24 | S = "${WORKDIR}/git" | ||
25 | |||
26 | # don't use the lua under thirdparty as it supports cross compiling badly | ||
27 | export LUA_LIB = "${STAGING_LIBDIR}/liblua.a" | ||
28 | |||
29 | LDFLAGS_append_mipsarch = " -latomic" | ||
30 | LDFLAGS_append_powerpc = " -latomic" | ||
31 | inherit autotools-brokensep gettext systemd | ||
32 | |||
33 | do_install_append() { | ||
34 | install -d ${D}${systemd_unitdir}/system/ | ||
35 | install -m 0644 ${WORKDIR}/ntopng.service ${D}${systemd_unitdir}/system | ||
36 | } | ||
37 | |||
38 | FILES_${PN} += "\ | ||
39 | ${systemd_unitdir}/system/ntopng.service" | ||
40 | |||
41 | FILES_${PN}-doc += "\ | ||
42 | /usr/man/man8/ntopng.8" | ||
43 | |||
44 | do_configure_prepend() { | ||
45 | ${S}/autogen.sh | ||
46 | } | ||
47 | |||
48 | SYSTEMD_SERVICE_${PN} = "ntopng.service" | ||