diff options
author | Jeroen Roovers <jer@gentoo.org> | 2016-08-04 16:07:17 +0200 |
---|---|---|
committer | Jeroen Roovers <jer@gentoo.org> | 2016-08-04 16:07:29 +0200 |
commit | 63d3dcfd13613f7b9eb23f2b20533dc0e310112c (patch) | |
tree | 52e55f8b2c14d8fdb949c1a50274d8a049812907 /net-analyzer/mtr | |
parent | 2d16abba3a65488c85fd9867b1ab463d4df972f3 (diff) | |
download | gentoo-63d3dcfd13613f7b9eb23f2b20533dc0e310112c.tar.gz gentoo-63d3dcfd13613f7b9eb23f2b20533dc0e310112c.tar.xz |
net-analyzer/mtr: Fix building with USE="-ipv6 -gtk".
Package-Manager: portage-2.3.0
Diffstat (limited to 'net-analyzer/mtr')
-rw-r--r-- | net-analyzer/mtr/files/mtr-9999-ipv6.patch | 59 | ||||
-rw-r--r-- | net-analyzer/mtr/files/mtr-9999-strings.patch | 12 | ||||
-rw-r--r-- | net-analyzer/mtr/mtr-0.87.ebuild | 2 | ||||
-rw-r--r-- | net-analyzer/mtr/mtr-9999.ebuild | 21 |
4 files changed, 86 insertions, 8 deletions
diff --git a/net-analyzer/mtr/files/mtr-9999-ipv6.patch b/net-analyzer/mtr/files/mtr-9999-ipv6.patch new file mode 100644 index 00000000000..32a62853387 --- /dev/null +++ b/net-analyzer/mtr/files/mtr-9999-ipv6.patch @@ -0,0 +1,59 @@ +--- a/net.c ++++ b/net.c +@@ -320,9 +320,13 @@ + struct sockaddr_storage local; + struct sockaddr_storage remote; + struct sockaddr_in *local4 = (struct sockaddr_in *) &local; ++#ifdef ENABLE_IPV6 + struct sockaddr_in6 *local6 = (struct sockaddr_in6 *) &local; ++#endif + struct sockaddr_in *remote4 = (struct sockaddr_in *) &remote; ++#ifdef ENABLE_IPV6 + struct sockaddr_in6 *remote6 = (struct sockaddr_in6 *) &remote; ++#endif + socklen_t len; + + ttl = index + 1; +@@ -437,9 +441,13 @@ + struct sockaddr_storage local; + struct sockaddr_storage remote; + struct sockaddr_in *local4 = (struct sockaddr_in *) &local; ++#ifdef ENABLE_IPV6 + struct sockaddr_in6 *local6 = (struct sockaddr_in6 *) &local; ++#endif + struct sockaddr_in *remote4 = (struct sockaddr_in *) &remote; ++#ifdef ENABLE_IPV6 + struct sockaddr_in6 *remote6 = (struct sockaddr_in6 *) &remote; ++#endif + socklen_t len; + + ttl = index + 1; +@@ -726,8 +734,12 @@ + + /* sendto() assumes packet length includes the IPv4 header but not the + IPv6 header. */ ++#ifdef ENABLE_IPV6 + spacketsize = abs(packetsize) - + ( ( af == AF_INET ) ? 0 : sizeof (struct ip6_hdr) ); ++#else ++ spacketsize = abs(packetsize); ++#endif + rv = sendto(sendsock, packet, spacketsize, 0, remotesockaddr, salen); + if (first && (rv < 0) && ((errno == EINVAL) || (errno == EMSGSIZE))) { + /* Try the first packet again using host byte order. */ +@@ -1535,11 +1547,15 @@ + struct sockaddr_in name_struct; + #endif + struct sockaddr_in * sa4; ++#ifdef ENABLE_IPV6 + struct sockaddr_in6 * sa6; ++#endif + struct sockaddr * name = (struct sockaddr *) &name_struct; + struct sockaddr_storage remote; + struct sockaddr_in *remote4 = (struct sockaddr_in *) &remote; ++#ifdef ENABLE_IPV6 + struct sockaddr_in6 *remote6 = (struct sockaddr_in6 *) &remote; ++#endif + socklen_t len; + int s; + diff --git a/net-analyzer/mtr/files/mtr-9999-strings.patch b/net-analyzer/mtr/files/mtr-9999-strings.patch new file mode 100644 index 00000000000..878382bde77 --- /dev/null +++ b/net-analyzer/mtr/files/mtr-9999-strings.patch @@ -0,0 +1,12 @@ +--- a/dns.c ++++ b/dns.c +@@ -49,7 +49,8 @@ + #include <unistd.h> + #include <fcntl.h> + //#include <ctype.h> +-//#include <string.h> ++#include <string.h> ++#include <strings.h> + #include <stdio.h> + #include <stdlib.h> + #include <signal.h> diff --git a/net-analyzer/mtr/mtr-0.87.ebuild b/net-analyzer/mtr/mtr-0.87.ebuild index afac24180f5..f1a2c37eee3 100644 --- a/net-analyzer/mtr/mtr-0.87.ebuild +++ b/net-analyzer/mtr/mtr-0.87.ebuild @@ -30,6 +30,8 @@ DEPEND=" DOCS=( AUTHORS FORMATS NEWS README SECURITY TODO ) FILECAPS=( cap_net_raw /usr/sbin/mtr ) PATCHES=( + "${FILESDIR}"/${PN}-0.80-impl-dec.patch + "${FILESDIR}"/${PN}-9999-ipv6.patch "${FILESDIR}"/${PN}-9999-tinfo.patch ) diff --git a/net-analyzer/mtr/mtr-9999.ebuild b/net-analyzer/mtr/mtr-9999.ebuild index 2af7b978a2f..f54af4fbe10 100644 --- a/net-analyzer/mtr/mtr-9999.ebuild +++ b/net-analyzer/mtr/mtr-9999.ebuild @@ -1,10 +1,9 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ -EAPI=5 - -inherit eutils autotools fcaps flag-o-matic git-r3 +EAPI=6 +inherit autotools eutils fcaps flag-o-matic git-r3 DESCRIPTION="My TraceRoute, an Excellent network diagnostic tool" HOMEPAGE="http://www.bitwizard.nl/mtr/" @@ -31,6 +30,12 @@ DEPEND=" DOCS=( AUTHORS FORMATS NEWS README SECURITY TODO ) FILECAPS=( cap_net_raw /usr/sbin/mtr ) +PATCHES=( + "${FILESDIR}"/${PN}-0.80-impl-dec.patch + "${FILESDIR}"/${PN}-9999-ipv6.patch + "${FILESDIR}"/${PN}-9999-strings.patch + "${FILESDIR}"/${PN}-9999-tinfo.patch +) src_unpack() { git-r3_src_unpack @@ -38,16 +43,16 @@ src_unpack() { } src_prepare() { - epatch \ - "${FILESDIR}"/${PN}-0.80-impl-dec.patch \ - "${FILESDIR}"/${PN}-0.85-gtk.patch \ - "${FILESDIR}"/${PN}-9999-tinfo.patch + default sed -i -e "/^\s*xver=/s|$.*)|${EGIT_VERSION:0:8}|" Makefile.am || die # Keep this comment and following mv, even in case ebuild does not need # it: kept gtk-2.0.m4 in SRC_URI but you'll have to mv it before autoreconf mv "${WORKDIR}"/gtk-2.0-for-mtr.m4 gtk-2.0.m4 || die #222909 + + eapply_user + AT_M4DIR="." eautoreconf } |