commit:     18af427934289a253113f76cef2516371b114fd5
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 27 03:36:41 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jul 27 03:36:41 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18af4279

net-analyzer/iftop: backport patch for >1gbps

Closes: https://bugs.gentoo.org/857837
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../iftop-1.0_pre4-allow-scales-beyond-1gbps.patch | 43 +++++++++++++++++++
 net-analyzer/iftop/iftop-1.0_pre4-r5.ebuild        | 49 ++++++++++++++++++++++
 2 files changed, 92 insertions(+)

diff --git 
a/net-analyzer/iftop/files/iftop-1.0_pre4-allow-scales-beyond-1gbps.patch 
b/net-analyzer/iftop/files/iftop-1.0_pre4-allow-scales-beyond-1gbps.patch
new file mode 100644
index 000000000000..9c9892147df5
--- /dev/null
+++ b/net-analyzer/iftop/files/iftop-1.0_pre4-allow-scales-beyond-1gbps.patch
@@ -0,0 +1,43 @@
+https://code.blinkace.com/pdw/iftop/-/commit/77901c8c53e01359d83b8090aacfe62214658183
+https://bugs.gentoo.org/857837
+
+From: Paul Warren <p...@ex-parrot.com>
+Date: Wed, 3 Oct 2018 18:02:36 +0100
+Subject: [PATCH] Support scales beyond 1Gbps
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Guido Jäkel <guido.jae...@gmx.de>
+--- a/ui.c
++++ b/ui.c
+@@ -71,7 +71,7 @@ int dontshowdisplay = 0;
+ 
+ /* Barchart scales. */
+ static struct {
+-    int max, interval;
++    long max; int interval;
+ } scale[] = {
+         {      64000,     10 },     /* 64 kbit/s */
+         {     128000,     10 },
+@@ -79,7 +79,9 @@ static struct {
+         {    1000000,     10 },     /* 1 Mbit/s */
+         {   10000000,     10 },     
+         {  100000000,    100 },
+-        { 1000000000,    100 }      /* 1 Gbit/s */
++        { 1000000000,    100 },     /* 1 Gbit/s */
++        {10000000000,    100 },
++       {100000000000,    100 }
+     };
+ static int rateidx = 0, wantbiggerrate;
+ 
+@@ -105,7 +107,7 @@ static float get_max_bandwidth() {
+ }
+ 
+ /* rate in bits */
+-static int get_bar_length(const int rate) {
++static int get_bar_length(const long rate) {
+     float l;
+     if (rate <= 0)
+         return 0;
+GitLab

diff --git a/net-analyzer/iftop/iftop-1.0_pre4-r5.ebuild 
b/net-analyzer/iftop/iftop-1.0_pre4-r5.ebuild
new file mode 100644
index 000000000000..b4968509122d
--- /dev/null
+++ b/net-analyzer/iftop/iftop-1.0_pre4-r5.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="Display bandwidth usage on an interface"
+HOMEPAGE="http://www.ex-parrot.com/pdw/iftop/";
+SRC_URI="http://www.ex-parrot.com/pdw/iftop/download/${P/_/}.tar.gz";
+S="${WORKDIR}"/${P/_/}
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 
~amd64-linux ~x86-linux ~ppc-macos"
+
+RDEPEND="
+       net-libs/libpcap
+       sys-libs/ncurses:=
+"
+DEPEND="${RDEPEND}"
+# autoconf-archive for ax_pthread, bug #490168
+BDEPEND="
+       sys-devel/autoconf-archive
+       virtual/pkgconfig
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.0_pre4-configure.ac.patch
+       "${FILESDIR}"/${PN}-1.0_pre4-Makefile.am.patch
+       "${FILESDIR}"/${PN}-1.0_pre4-tsent-set-but-not-used.patch
+       "${FILESDIR}"/${PN}-1.0_pre4-ip6.arpa.patch
+       "${FILESDIR}"/${PN}-1.0_pre4-fix-MAC-formatting.patch
+       "${FILESDIR}"/${PN}-1.0_pre4-fno-common.patch
+       "${FILESDIR}"/${PN}-1.0_pre4-allow-scales-beyond-1gbps.patch
+)
+
+src_prepare() {
+       default
+
+       eautoreconf
+}
+
+src_install() {
+       dosbin iftop
+       doman iftop.8
+
+       dodoc AUTHORS ChangeLog README "${FILESDIR}"/iftoprc
+}

Reply via email to