From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B849015808B for ; Tue, 8 Feb 2022 06:31:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9DE1BE0788; Tue, 8 Feb 2022 06:31:56 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4956FE0788 for ; Tue, 8 Feb 2022 06:31:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 314BA342D2A for ; Tue, 8 Feb 2022 06:31:55 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7932E2CC for ; Tue, 8 Feb 2022 06:31:53 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1644301905.f885f314661f613af15d46b79217b602fed28472.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/ntopng/files/, net-analyzer/ntopng/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-analyzer/ntopng/Manifest net-analyzer/ntopng/files/ntopng-5.2.1-build-system.patch net-analyzer/ntopng/files/ntopng-5.2.1-mysqltool.patch net-analyzer/ntopng/files/ntopng-5.2.1-ndpi-linking.patch net-analyzer/ntopng/ntopng-5.2.1.ebuild X-VCS-Directories: net-analyzer/ntopng/ net-analyzer/ntopng/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: f885f314661f613af15d46b79217b602fed28472 X-VCS-Branch: master Date: Tue, 8 Feb 2022 06:31:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 6835ee22-3e39-4942-95bd-e05c125de85b X-Archives-Hash: 54e8594fe1adcaa4902ed55140f7fa4f commit: f885f314661f613af15d46b79217b602fed28472 Author: Sam James gentoo org> AuthorDate: Tue Feb 8 06:31:37 2022 +0000 Commit: Sam James gentoo org> CommitDate: Tue Feb 8 06:31:45 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f885f314 net-analyzer/ntopng: add 5.2.1 Signed-off-by: Sam James gentoo.org> net-analyzer/ntopng/Manifest | 1 + .../ntopng/files/ntopng-5.2.1-build-system.patch | 89 ++++++++++++++++++++ .../ntopng/files/ntopng-5.2.1-mysqltool.patch | 17 ++++ .../ntopng/files/ntopng-5.2.1-ndpi-linking.patch | 13 +++ net-analyzer/ntopng/ntopng-5.2.1.ebuild | 97 ++++++++++++++++++++++ 5 files changed, 217 insertions(+) diff --git a/net-analyzer/ntopng/Manifest b/net-analyzer/ntopng/Manifest index 9a94093e2365..c97edb42bb7e 100644 --- a/net-analyzer/ntopng/Manifest +++ b/net-analyzer/ntopng/Manifest @@ -1,2 +1,3 @@ DIST ntopng-4.2.tar.gz 57554819 BLAKE2B a9eaf7ea670dbd9c830696a4b017330e25a82307852a0a85d95ddbb4e32a3123d43eda1b686c359da1fef77e601cd3791dcdf257141e2e1d3ed7974b92edaac8 SHA512 e89ec3f35644ae8bc570d9802ecfadbf0067145e23a589df2032e8781e9c954f4166d3abb650ddafc65e4fbad656730ee1abf9c5273d3e09f8173d423436b8ff DIST ntopng-5.0.tar.gz 57935381 BLAKE2B 420bda10ecc264d6baea0714367e8c475e72480ab1a114251c6712535ad1415288154623aa3ef780a5bab55bec684ddd7c0582997654f8fbb96ec08e17cb099f SHA512 e157430d9c98871d0136d2f51af6c7fed3a95fa21f8d3a9447ee69ac2aaee3752b6eddfd584715e3ee36234fd0fdcf865b761b0ec1a08727f6d988bc115d21e6 +DIST ntopng-5.2.1.tar.gz 60280025 BLAKE2B e7885a1ec9e5d37ee06def83a83c62f41acf87d939d18c33c8d114fe0bed0c973a6146f26fd92343aa7c7e7484970c3e95c33fe76468fe382809daddeed6541b SHA512 01cdf21deac61a3b11e7d0e6b662c911123241332e812bb676cb8c5c003fe1d50a4c61231f9c327d467e89dd1345fc1bdbab5d2599fe04b04a8fe12654c01bdd diff --git a/net-analyzer/ntopng/files/ntopng-5.2.1-build-system.patch b/net-analyzer/ntopng/files/ntopng-5.2.1-build-system.patch new file mode 100644 index 000000000000..ff05d103f22a --- /dev/null +++ b/net-analyzer/ntopng/files/ntopng-5.2.1-build-system.patch @@ -0,0 +1,89 @@ +https://github.com/ntop/ntopng/pull/6288 + +From 93b62eb0b48f9914fed5511dc2a4289a83a1ed34 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Tue, 8 Feb 2022 06:07:21 +0000 +Subject: [PATCH 1/3] build: fail configure if ZMQ can't be found + +We already "fail" (makefile won't be generated) when ZMQ can't be found but +the exit code doesn't represent this until now. + +Signed-off-by: Sam James +--- + configure.ac.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac.in b/configure.ac.in +index b032d7faa34..0b30e9480c7 100644 +--- a/configure.ac.in ++++ b/configure.ac.in +@@ -132,7 +132,7 @@ if test "x$ac_cv_lib_zmq_zmq_socket_monitor" = xyes; then : + AC_DEFINE_UNQUOTED(HAVE_ZMQ, 1, [ZMQ is present]) + else + echo "ZMQ not present or too old (< v. 3.x)" +- exit ++ exit 1 + fi + + AC_CHECK_LIB([sodium], [sodium_init], LIBS="${LIBS} -lsodium") + +From 75206e5a3fdc289a2229770595fbf588de79402b Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Tue, 8 Feb 2022 06:08:02 +0000 +Subject: [PATCH 2/3] build: avoid bashism in configure + +[[ ]] and == are both Bashisms and /bin/sh may be a POSIX compliant +shell (Debian notably uses dash for /bin/sh which wouldn't be +happy with this). + +This will continue to work on Bash. + +Signed-off-by: Sam James +--- + configure.ac.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac.in b/configure.ac.in +index 0b30e9480c7..3dc6ef4a539 100644 +--- a/configure.ac.in ++++ b/configure.ac.in +@@ -187,7 +187,7 @@ fi + + if [ test -f /usr/bin/lsb_release ]; then + CODENAME=`/usr/bin/lsb_release -c|cut -f 2` +- if [[ $CODENAME == "wheezy" ]]; then : ++ if test $CODENAME = "wheezy" ; then + CPPFLAGS="${CPPFLAGS} -DOLD_NETFILTER_INTERFACE=1" + fi + fi + +From 6e355cb98078dbfc379ba178ec99b7e351afdfe9 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Tue, 8 Feb 2022 06:09:44 +0000 +Subject: [PATCH 3/3] build: use $(MAKE) + +This allows parallel builds to work properly as we'll be calling 'make ...' +with any additional arguments it internally passes down rather than literally +just make. + +Signed-off-by: Sam James +--- + configure.ac.in | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/configure.ac.in b/configure.ac.in +index 3dc6ef4a539..3ff06c4efd4 100644 +--- a/configure.ac.in ++++ b/configure.ac.in +@@ -720,10 +720,7 @@ fi + + AC_DEFINE_UNQUOTED(_CRT_SECURE_NO_WARNINGS, 1, [Disable warning on windows]) + +-GMAKE=`which gmake` +-if test x$GMAKE = x; then +- GMAKE="make" +-fi ++GMAKE='$(MAKE)' + + GIT=`which git` + if test x$GIT = x; then diff --git a/net-analyzer/ntopng/files/ntopng-5.2.1-mysqltool.patch b/net-analyzer/ntopng/files/ntopng-5.2.1-mysqltool.patch new file mode 100644 index 000000000000..48551589f022 --- /dev/null +++ b/net-analyzer/ntopng/files/ntopng-5.2.1-mysqltool.patch @@ -0,0 +1,17 @@ +--- a/configure.ac.in ++++ b/configure.ac.in +@@ -596,13 +596,7 @@ if test "${with_nedge+set}" != set; then + if test "x$ac_cv_prog_ac_ct_MARIADB" = "xmariadb_config"; then + MYSQLTOOL="mariadb_config" + else +- PATH=$PATH:/usr/local/mysql/bin +- AC_CHECK_TOOL(MYSQL, mysql_config) +- if test "x$ac_cv_prog_ac_ct_MYSQL" = "xmysql_config"; then +- MYSQLTOOL="mysql_config" +- else +- MYSQLTOOL="" +- fi ++ MYSQLTOOL="mysql_config" + fi + + if test -n "$MYSQLTOOL"; then diff --git a/net-analyzer/ntopng/files/ntopng-5.2.1-ndpi-linking.patch b/net-analyzer/ntopng/files/ntopng-5.2.1-ndpi-linking.patch new file mode 100644 index 000000000000..4940cb44b733 --- /dev/null +++ b/net-analyzer/ntopng/files/ntopng-5.2.1-ndpi-linking.patch @@ -0,0 +1,13 @@ +--- a/configure.ac.in ++++ b/configure.ac.in +@@ -236,8 +236,8 @@ fi + PKG_CHECK_MODULES([NDPI], [libndpi >= 2.0], [ + NDPI_INC=`echo $NDPI_CFLAGS | sed -e "s/[ ]*$//"` + # Use static libndpi library as building against the dynamic library fails +- NDPI_LIB="-Wl,-Bstatic $NDPI_LIBS -Wl,-Bdynamic" +- #NDPI_LIB="$NDPI_LIBS" ++ #NDPI_LIB="-Wl,-Bstatic $NDPI_LIBS -Wl,-Bdynamic" ++ NDPI_LIB="$NDPI_LIBS" + NDPI_LIB_DEP= + ], [ + AC_MSG_CHECKING(for nDPI source) diff --git a/net-analyzer/ntopng/ntopng-5.2.1.ebuild b/net-analyzer/ntopng/ntopng-5.2.1.ebuild new file mode 100644 index 000000000000..b1e0ebb11864 --- /dev/null +++ b/net-analyzer/ntopng/ntopng-5.2.1.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools toolchain-funcs + +DESCRIPTION="Network traffic analyzer with web interface" +HOMEPAGE="https://www.ntop.org/" +SRC_URI="https://github.com/ntop/${PN}/archive/${PV}.tar.gz -> ${P}.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.2:= + >=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.2.1-ndpi-linking.patch + "${FILESDIR}"/${PN}-5.2.1-build-system.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 +} + +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}/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'" +}