commit:     5729e747ac8bc212d7ccda0acc5a7eeffdcc6aa3
Author:     Denis Pronin <dannftk <AT> yandex <DOT> ru>
AuthorDate: Wed Apr 24 06:24:26 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun  9 15:55:20 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5729e747

net-analyzer/ntopng: add 6.0

Closes: https://bugs.gentoo.org/933819
Signed-off-by: Denis Pronin <dannftk <AT> yandex.ru>
Closes: https://github.com/gentoo/gentoo/pull/37091
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-analyzer/ntopng/Manifest                       |   2 +
 .../files/ntopng-6.0-dont-const-cast-argv.patch    |  34 +++++++
 net-analyzer/ntopng/ntopng-6.0.ebuild              | 104 +++++++++++++++++++++
 3 files changed, 140 insertions(+)

diff --git a/net-analyzer/ntopng/Manifest b/net-analyzer/ntopng/Manifest
index 88d1b021acfd..b2beb8993ffe 100644
--- a/net-analyzer/ntopng/Manifest
+++ b/net-analyzer/ntopng/Manifest
@@ -1,3 +1,5 @@
 DIST ntopng-5.2.1.tar.gz 60280025 BLAKE2B 
e7885a1ec9e5d37ee06def83a83c62f41acf87d939d18c33c8d114fe0bed0c973a6146f26fd92343aa7c7e7484970c3e95c33fe76468fe382809daddeed6541b
 SHA512 
01cdf21deac61a3b11e7d0e6b662c911123241332e812bb676cb8c5c003fe1d50a4c61231f9c327d467e89dd1345fc1bdbab5d2599fe04b04a8fe12654c01bdd
 DIST ntopng-5.6-web-90d81ad0281eb6eb582a683ac321a3959abb1269.tar.gz 2525957 
BLAKE2B 
5ae068ab4c0bae7c6cde7071dd056d3d717d0ae50ce0fe0f9e71fcbf8ab8ee51cdb2d3b05f095ce96921378361ff013d893a40496f1ce50da8ba4c65dc166fc0
 SHA512 
cd3f8c660b632bffb2baac4d163b055a64b05f510a0744c8d27689cabb3959d15d5cfa763fcf583e57d23dbcd73857360bae7d25bd9aa66682858e7ca985c21e
 DIST ntopng-5.6.tar.gz 46318113 BLAKE2B 
48702b55c239edca46d6cdecb846ac358c9a829a261eee128444bd994b967c962577a419466f139a2aefdd3a51485d2bb17bf39b8f35a9a31322c40c07203a5d
 SHA512 
c4ab79f98b2dc99218cd0c7ac0ed7275d23e7a161de742632f3ec7a538ea4948ba906d40e7fd2ba36fb4bd9be86ecc69f5df65e7f81607e6da489863947b2da5
+DIST ntopng-6.0-web-34c53388e8da61e6e04b3efd8e98dcd9b9e4fe1b.tar.gz 2890924 
BLAKE2B 
476ce4ea83fbd1241c12e2cd486f97570457721fd7a7e78e0e7b04ae80c4a69beb37a00e6fb6e47783f9296371cc92b4c9347016bc971d815a3af83d1671eb1d
 SHA512 
f9a1cf583c8d513a543498c9712ab40b9c1978877c5a86c0ec89bd26e9f66b8d90a0700f417bd7166b0b683e5091a3a1d30d4888564ae4220e62a9d82d17bc64
+DIST ntopng-6.0.tar.gz 68289620 BLAKE2B 
7edbd1b6231fdd1592f1b6ecca9f96dc79513dce1c53db70fb7b721ea483738dc0e74107ca15629c430e14ca7e461053967abc35de09e303e36ded9ed9994b43
 SHA512 
d9d27bed0706d36c82a5b22b2b918014fed7d614e11c79cc47ee1033ae5fd2f703a67f3c5205c63c014bbd2839eb7c78616137ee6cc11d09ebcf6fafc7a658d2

diff --git a/net-analyzer/ntopng/files/ntopng-6.0-dont-const-cast-argv.patch 
b/net-analyzer/ntopng/files/ntopng-6.0-dont-const-cast-argv.patch
new file mode 100644
index 000000000000..199db074097e
--- /dev/null
+++ b/net-analyzer/ntopng/files/ntopng-6.0-dont-const-cast-argv.patch
@@ -0,0 +1,34 @@
+The patch is borrowed from upstream https://github.com/ntop/ntopng
+
+https://github.com/ntop/ntopng/commit/5069aa4a6259bd0830a33f2ece980612dba5ace9
+
+commit 5069aa4a6259bd0830a33f2ece980612dba5ace9 (HEAD -> 6.0-stable, 
origin/6.0-stable)
+Author: Denis Pronin <[email protected]>
+Date:   Sat Jun 8 09:29:51 2024 +0300
+
+    fix building when rrd_tune() function has const char** as the 2nd param 
(#8442)
+    
+    Signed-off-by: Denis Pronin <[email protected]>
+
+diff --git a/src/LuaEngineNtop.cpp b/src/LuaEngineNtop.cpp
+index 42e41822c..ea8e3769f 100644
+--- a/src/LuaEngineNtop.cpp
++++ b/src/LuaEngineNtop.cpp
+@@ -21,6 +21,8 @@
+ 
+ #include "ntop_includes.h"
+ 
++#include <type_traits>
++
+ extern "C" {
+ #include "rrd.h"
+ };
+@@ -6296,7 +6298,7 @@ static int ntop_rrd_tune(lua_State *vm) {
+   filename = argv[1];
+ 
+   reset_rrd_state();
+-  status = rrd_tune(argc, (char **)argv);
++  status = rrd_tune(argc, (std::conditional<std::is_same<decltype(rrd_tune), 
int(int, const char **)>::value, const char **, char **>::type)argv);
+ 
+   if (status != 0) {
+     char *err = rrd_get_error();

diff --git a/net-analyzer/ntopng/ntopng-6.0.ebuild 
b/net-analyzer/ntopng/ntopng-6.0.ebuild
new file mode 100644
index 000000000000..53fcd2cf27ae
--- /dev/null
+++ b/net-analyzer/ntopng/ntopng-6.0.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools toolchain-funcs
+
+# Check this on bumps, get latest commit from the relevant branch (e.g. 
6.0-stable)
+# See bug #894152 and https://github.com/ntop/ntopng/issues/7203
+NTOPNG_DIST_COMMIT="34c53388e8da61e6e04b3efd8e98dcd9b9e4fe1b"
+DESCRIPTION="Network traffic analyzer with web interface"
+HOMEPAGE="https://www.ntop.org/";
+SRC_URI="https://github.com/ntop/ntopng/archive/${PV}.tar.gz -> ${P}.tar.gz"
+SRC_URI+=" 
https://github.com/ntop/ntopng-dist/archive/${NTOPNG_DIST_COMMIT}.tar.gz -> 
${P}-web-${NTOPNG_DIST_COMMIT}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="dev-db/mysql-connector-c:=
+       dev-db/sqlite:3
+       dev-libs/hiredis:=
+       dev-libs/json-c:=
+       dev-libs/libmaxminddb
+       dev-libs/libsodium:=
+       dev-libs/openssl:=
+       net-analyzer/rrdtool
+       net-libs/libpcap
+       ~net-libs/nDPI-4.8
+       >=net-libs/zeromq-3:=
+       net-misc/curl
+       sys-libs/libcap
+       sys-libs/zlib"
+RDEPEND="${DEPEND}
+       acct-user/ntopng
+       acct-group/ntopng
+       dev-db/redis"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-5.2.1-mysqltool.patch
+       "${FILESDIR}"/${PN}-5.4-ndpi-linking.patch
+       "${FILESDIR}"/${PN}-6.0-dont-const-cast-argv.patch
+)
+
+src_prepare() {
+       default
+
+       # Follows upstream's autogen.sh
+       sed \
+               -e "s/@VERSION@/${PV}.$(date +%y%m%d)/g" \
+               -e "s/@SHORT_VERSION@/${PV}/g" \
+               -e "s/@GIT_DATE@/$(date)/g" \
+               -e "s/@GIT_RELEASE@/${PV}.$(date +%y%m%d)/g" \
+               -e "s/@GIT_BRANCH@//g" < "${S}/configure.ac.in" \
+               > "${S}/configure.ac" || die
+
+       eautoreconf
+}
+
+src_configure() {
+       tc-export PKG_CONFIG
+
+       # configure.ac.in at least has some bashisms(?) which get lost(?)
+       # in conversion to configure.ac (like [ -> nothing?) so just force
+       # bash for now. It's still not quite right but at least upstream will be
+       # testing with it. TODO: fix this!
+       CONFIG_SHELL="${BROOT}/bin/bash" econf 
--with-ndpi-includes="${ESYSROOT}"/usr/include/ndpi
+}
+
+src_compile() {
+       emake \
+               CC="$(tc-getCC)" \
+               MYCFLAGS="${CFLAGS}" \
+               MYLDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+       SHARE_NTOPNG_DIR="${EPREFIX}/usr/share/${PN}"
+       insinto "${SHARE_NTOPNG_DIR}"
+       doins -r httpdocs
+       doins -r scripts
+
+       insinto "${SHARE_NTOPNG_DIR}"/httpdocs/dist
+       doins -r "${WORKDIR}"/ntopng-dist-${NTOPNG_DIST_COMMIT}/.
+
+       insinto "${SHARE_NTOPNG_DIR}/third-party"
+       doins -r third-party/i18n.lua-master
+       doins -r third-party/lua-resty-template-master
+
+       exeinto /usr/bin
+       doexe "${PN}"
+       doman "${PN}.8"
+
+       newinitd "${FILESDIR}"/ntopng.init.d ntopng
+       newconfd "${FILESDIR}"/ntopng.conf.d ntopng
+
+       keepdir /var/lib/ntopng
+       fowners ntopng /var/lib/ntopng
+}
+
+pkg_postinst() {
+       elog "ntopng default credentials are user='admin' password='admin'"
+}

Reply via email to