[gentoo-commits] repo/gentoo:master commit in: net-analyzer/fping/files/, net-analyzer/fping/

2024-03-16 Thread Sam James
commit: f513598b3aa9b1b157d905119472eaaa0b1c9a49
Author: Sam James  gentoo  org>
AuthorDate: Sun Mar 17 03:51:38 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Mar 17 03:51:38 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f513598b

net-analyzer/fping: fix modern C issue / musl build

Closes: https://bugs.gentoo.org/895182
Signed-off-by: Sam James  gentoo.org>

 net-analyzer/fping/files/fping-5.1-c99-musl.patch | 39 +++
 net-analyzer/fping/fping-5.1-r1.ebuild| 35 
 2 files changed, 74 insertions(+)

diff --git a/net-analyzer/fping/files/fping-5.1-c99-musl.patch 
b/net-analyzer/fping/files/fping-5.1-c99-musl.patch
new file mode 100644
index ..d56bb501682c
--- /dev/null
+++ b/net-analyzer/fping/files/fping-5.1-c99-musl.patch
@@ -0,0 +1,39 @@
+https://bugs.gentoo.org/895182
+https://github.com/schweikert/fping/commit/c0fbccb977c523ba671afdf0f37de40d26351f77
+
+From c0fbccb977c523ba671afdf0f37de40d26351f77 Mon Sep 17 00:00:00 2001
+From: Khem Raj 
+Date: Mon, 29 Aug 2022 15:41:51 -0700
+Subject: [PATCH] fping: Initialize msghdr struct in a portable way
+
+Initializing the structure assuming glibc layout results in
+compile errors on musl, therefore do partial intialization and then
+assigning the members individually.
+
+Signed-off-by: Khem Raj 
+--- a/src/fping.c
 b/src/fping.c
+@@ -1962,15 +1962,13 @@ int receive_packet(int64_t wait_time,
+ reply_buf,
+ reply_buf_len
+ };
+-struct msghdr recv_msghdr = {
+-reply_src_addr,
+-reply_src_addr_len,
+-_iov,
+-1,
+-_control,
+-sizeof(msg_control),
+-0
+-};
++struct msghdr recv_msghdr = {0};
++recv_msghdr.msg_name = reply_src_addr;
++recv_msghdr.msg_namelen = reply_src_addr_len;
++recv_msghdr.msg_iov = _iov;
++recv_msghdr.msg_iovlen = 1;
++recv_msghdr.msg_control = _control;
++recv_msghdr.msg_controllen = sizeof(msg_control);
+ #if HAVE_SO_TIMESTAMPNS
+ struct cmsghdr *cmsg;
+ #endif
+

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



[gentoo-commits] repo/gentoo:master commit in: net-analyzer/fping/files/, net-analyzer/fping/

2020-02-03 Thread Jeroen Roovers
commit: 623d1e0b9b697f886abfd52e0a48796107198c96
Author: Jeroen Roovers  gentoo  org>
AuthorDate: Mon Feb  3 18:10:53 2020 +
Commit: Jeroen Roovers  gentoo  org>
CommitDate: Mon Feb  3 18:15:34 2020 +
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  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 000..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?= 
+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 000..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
+}



[gentoo-commits] repo/gentoo:master commit in: net-analyzer/fping/files/, net-analyzer/fping/

2018-09-18 Thread Jeroen Roovers
commit: 216d72e341996af2e80979550b403bdc46ab02e8
Author: Jeroen Roovers  gentoo  org>
AuthorDate: Tue Sep 18 13:38:08 2018 +
Commit: Jeroen Roovers  gentoo  org>
CommitDate: Tue Sep 18 13:38:08 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=216d72e3

net-analyzer/fping: Version 4.1.

Package-Manager: Portage-2.3.49, Repoman-2.3.10

 net-analyzer/fping/Manifest   |  1 +
 net-analyzer/fping/files/fping-4.1-ipv6.patch | 15 ++
 net-analyzer/fping/fping-4.1.ebuild   | 29 +++
 3 files changed, 45 insertions(+)

diff --git a/net-analyzer/fping/Manifest b/net-analyzer/fping/Manifest
index e13c75b02e9..39a6a6025d9 100644
--- a/net-analyzer/fping/Manifest
+++ b/net-analyzer/fping/Manifest
@@ -1,4 +1,5 @@
 DIST fping-3.13.tar.gz 155976 BLAKE2B 
6f5b825fd215a4329c35022e326df2e9dc7454b03e9a960074aef451277d2d99af23ccf451379d44a76776fec135983c7948c8bd54bde98c7f79180e59ced616
 SHA512 
d6c1c5b9edb97ef59cfb6d22f74f6a055e52465d3ba0f93be35b6fc9615ee08490ee927f3cf9efd087e18279519292f353abe6152061985ee166ba5f7e95e29d
 DIST fping-4.0.tar.gz 170060 BLAKE2B 
1142ed700a28f28ff8710b65300754139734f89123db01fa4a3772f0a804cfa58477b30ab749426be384f7e007437a82138d319ab6a702702314e24c915db44d
 SHA512 
5dca650e9c34dd2e1bdbb981df61cf092230f07a15c4ccef105b9f5843e0d85dc9665db89631feded503ecc6f6be86446719de18e59349adb7c2f3e9757e
+DIST fping-4.1.tar.gz 170851 BLAKE2B 
4cad16f05afff5d1755f58be454059d1959cce1c9f50a8af1b20c34f51b3dca9b4238fd934b46ad11cb71c539c3a1f82531b44f585c774a0c28a4786105e3c0c
 SHA512 
cd31ea336985f8d727b0db3c70213b827f0282b0c382694e10c72a89c425f2f7383d07f8f2febdc23aa246ebbf65ac9751b2404be405088963a682945edc80ba
 DIST fping_2.4b2-to-ipv6-16.1.diff.gz 8488 BLAKE2B 
fe229b5042445665403f40c5a7740e024c836176a375c77440a827463adb3ed219a9c6da73375482baa81c1134764d3cfafebc44aef7596dd380e0964ff130e0
 SHA512 
6af25324d159df4ddd7dd909e2e1a0d85e08c2f51c31469960c2dbc7a9eb4967fd114eb87361f8c6b1691de60e7f753d371e6c902bec706f3fed3d205fbe49f0
 DIST fping_2.4b2-to-ipv6.orig.tar.gz 6 BLAKE2B 
b3495c304d1108732cf5aedbf3665ce2ce50be5ca051b724e92583197f9aa7f84e41655b9c3438e0715eb8210ec79fb17a020904fa0d1cfef43f7178f622ea87
 SHA512 
3d1a76680d3a7cd361481d6e6de49797fbaf01422a73c784c8b667131afd56de2bfbbeb17014047cd2dea903f87d9f19e38ed7b0a5c2e8f2faf82759bf064ff9

diff --git a/net-analyzer/fping/files/fping-4.1-ipv6.patch 
b/net-analyzer/fping/files/fping-4.1-ipv6.patch
new file mode 100644
index 000..7889b568a19
--- /dev/null
+++ b/net-analyzer/fping/files/fping-4.1-ipv6.patch
@@ -0,0 +1,15 @@
+--- a/src/fping.c
 b/src/fping.c
+@@ -687,7 +687,11 @@ int main(int argc, char** argv)
+ 
+ /* validate various option settings */
+ 
+-if (socket4 < 0 && socket6 < 0) {
++if (socket4 < 0
++#ifdef IPV6
++&& socket6 < 0
++#endif
++) {
+ crash_and_burn("can't create socket (must run as root?)");
+ }
+ 

diff --git a/net-analyzer/fping/fping-4.1.ebuild 
b/net-analyzer/fping/fping-4.1.ebuild
new file mode 100644
index 000..13dec2b8e68
--- /dev/null
+++ b/net-analyzer/fping/fping-4.1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="A utility to ping multiple hosts at once"
+HOMEPAGE="http://fping.org/;
+SRC_URI="http://fping.org/dist/${P}.tar.gz;
+
+LICENSE="fping"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 
~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
+IUSE="ipv6 suid"
+
+PATCHES=(
+   "${FILESDIR}"/${PN}-4.1-ipv6.patch
+)
+
+src_configure() {
+   econf $(use_enable ipv6)
+}
+
+src_install() {
+   default
+
+   if use suid ; then
+   fperms u+s /usr/sbin/fping
+   fi
+}