commit:     623d1e0b9b697f886abfd52e0a48796107198c96
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  3 18:10:53 2020 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Mon Feb  3 18:15:34 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=623d1e0b

net-analyzer/fping: Add USE=filecaps, fping6 > fping symlink

Bug #698662:
- Use filecaps.eclass to set cap_net_raw

Bug #708020:
- Create a symlink from /usr/sbin/fping6 -> fping
- Add upstream patch to fix `fping6 -6 ...`

Package-Manager: Portage-2.3.87, Repoman-2.3.20
Closes: https://bugs.gentoo.org/698662
Closes: https://bugs.gentoo.org/708020
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>

 net-analyzer/fping/files/fping-4.2-fping6-6.patch | 21 +++++++++++++
 net-analyzer/fping/fping-4.2-r1.ebuild            | 36 +++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/net-analyzer/fping/files/fping-4.2-fping6-6.patch 
b/net-analyzer/fping/files/fping-4.2-fping6-6.patch
new file mode 100644
index 00000000000..63138d3e2d2
--- /dev/null
+++ b/net-analyzer/fping/files/fping-4.2-fping6-6.patch
@@ -0,0 +1,21 @@
+From 6fd4f8bd91abc43f80078bdd0084cb6d2b1de7f1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Johan=20Str=C3=B6m?= <jo...@stromnet.se>
+Date: Tue, 25 Jun 2019 14:03:14 +0200
+Subject: [PATCH] Do not fail if using fping6 with -6 flag
+
+Mostly for backwards compatability
+---
+ src/fping.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/fping.c
++++ b/src/fping.c
+@@ -435,7 +435,7 @@
+             break;
+         case '6':
+ #ifdef IPV6
+-            if (hints_ai_family != AF_UNSPEC) {
++            if (hints_ai_family != AF_UNSPEC && hints_ai_family != AF_INET6) {
+                 fprintf(stderr, "%s: can't specify both -4 and -6\n", prog);
+                 exit(1);
+             }

diff --git a/net-analyzer/fping/fping-4.2-r1.ebuild 
b/net-analyzer/fping/fping-4.2-r1.ebuild
new file mode 100644
index 00000000000..0e1b61dd97e
--- /dev/null
+++ b/net-analyzer/fping/fping-4.2-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit fcaps
+
+DESCRIPTION="A utility to ping multiple hosts at once"
+HOMEPAGE="https://fping.org/";
+SRC_URI="https://fping.org/dist/${P}.tar.gz";
+
+LICENSE="fping"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 
~amd64-linux ~x86-linux ~x86-macos"
+IUSE="ipv6 suid"
+
+FILECAPS=( cap_net_raw+ep usr/sbin/fping )
+PATCHES=(
+       "${FILESDIR}"/${PN}-4.2-fno-common.patch
+       "${FILESDIR}"/${PN}-4.2-fping6-6.patch
+)
+
+src_configure() {
+       econf $(use_enable ipv6)
+}
+
+src_install() {
+       default
+
+       if use suid; then
+               fperms u+s /usr/sbin/fping
+       fi
+
+       if use ipv6; then
+               dosym fping /usr/sbin/fping6
+       fi
+}

Reply via email to