diff options
author | Jeroen Roovers <jer@gentoo.org> | 2017-06-10 12:43:46 +0200 |
---|---|---|
committer | Jeroen Roovers <jer@gentoo.org> | 2017-06-10 12:57:16 +0200 |
commit | 59f08eb272e2a48fc12291c98864ec2ab6e4c2e4 (patch) | |
tree | 3459f5f7fb670e632f54a9d8a73632a2300bbcfb /net-analyzer/netselect | |
parent | x11-themes/qtcurve: add snapshot (diff) | |
download | gentoo-59f08eb272e2a48fc12291c98864ec2ab6e4c2e4.tar.gz gentoo-59f08eb272e2a48fc12291c98864ec2ab6e4c2e4.tar.bz2 gentoo-59f08eb272e2a48fc12291c98864ec2ab6e4c2e4.zip |
net-analyzer/netselect: Version bump.
Package-Manager: Portage-2.3.6, Repoman-2.3.2
Diffstat (limited to 'net-analyzer/netselect')
-rw-r--r-- | net-analyzer/netselect/Manifest | 1 | ||||
-rw-r--r-- | net-analyzer/netselect/files/netselect-0.4-bsd.patch | 56 | ||||
-rw-r--r-- | net-analyzer/netselect/files/netselect-0.4-flags.patch | 12 | ||||
-rw-r--r-- | net-analyzer/netselect/netselect-0.4.ebuild | 40 |
4 files changed, 109 insertions, 0 deletions
diff --git a/net-analyzer/netselect/Manifest b/net-analyzer/netselect/Manifest index ecac5649c218..16dea6606f3b 100644 --- a/net-analyzer/netselect/Manifest +++ b/net-analyzer/netselect/Manifest @@ -1 +1,2 @@ DIST netselect-0.3.tar.gz 22047 SHA256 fe81942589d5219d030e5cecfb12787fb6d3613416cb326dea4952bf53f9c978 SHA512 04a4b79c357a0110dcf377ad04ac729ed7854bec4b064ad16da632367ce1870379546fffc8396ea770bfa580618d7c0495c16b0ba30f736419511b890ce5dca5 WHIRLPOOL 2e49cb22b12c88a1d9f42da19b42284ae98d391739bf7bd1e134661b8780ef733b26f5f4be4ed61dce3a4a9922a6a10d9040698fa3f4910ceacc54df4a42afcc +DIST netselect-0.4.tar.gz 22095 SHA256 ae343991c94b1fdeb5e7896bb11d357c1dd9297f5d842c507953f57935e15e19 SHA512 eee9639122b7cc89218c610794d090582aecb3df138bcef41472c8d40c0f7e998b2c4b04aace13795fda5c710ee28cc2c0784a680ad6d1aa6a14eb441a408bfa WHIRLPOOL 26560ff81683c48ad7c94e827029b4b0a127c29b94fe47fe2b95f3736eafeeeaa2c9b1e9f6feff7971a37cd15fdb51814acd195ebafd6e89face3d514eb872c3 diff --git a/net-analyzer/netselect/files/netselect-0.4-bsd.patch b/net-analyzer/netselect/files/netselect-0.4-bsd.patch new file mode 100644 index 000000000000..fd49a17682db --- /dev/null +++ b/net-analyzer/netselect/files/netselect-0.4-bsd.patch @@ -0,0 +1,56 @@ +--- a/netselect.c ++++ b/netselect.c +@@ -39,14 +39,14 @@ + * hey, great! Let me know. -- apenwarr + */ + +-#ifdef __EMX__ +-# include <io.h> +-# include <fcntl.h> +-# include <sys/types.h> +-# include <sys/select.h> +-# include <machine/endian.h> +-#else +-# include <endian.h> ++#ifdef __linux__ ++#include <endian.h> ++#include <sys/types.h> ++#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) ++#if defined(__OpenBSD__) ++#include <machine/types.h> ++#endif ++#include <machine/endian.h> + #endif + + #include <sys/param.h> +@@ -167,6 +167,7 @@ + extern int optind; + int hostcount, startcount, endcount = 0, sent_one, lag, min_lag = 100; + int ch, seq, ttl, max_ttl = 30, num_score = 1; ++ int on = 1; + int use_icmp = 0; + unsigned int min_tries = 10; + struct timeval now; +@@ -234,7 +235,12 @@ + if (verbose >= 1) + fprintf(stderr, "Running netselect to choose %d out of %d address%s.\n", + num_score, numhosts, numhosts==1 ? "" : "es"); +- ++ ++ if (setsockopt(sndsock, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on)) < 0) { ++ perror("IP_HDRINCL"); ++ _exit(EXIT_FAILURE); ++ } ++ + /* keep going until most of the hosts have been finished */ + must_continue = numhosts; + while (must_continue && must_continue >= numhosts/2) +@@ -712,7 +718,7 @@ + ip->ip_off = 0; + ip->ip_hl = sizeof(*ip) >> 2; + ip->ip_p = IPPROTO_UDP; +- ip->ip_len = 0; /* kernel fills this in */ ++ ip->ip_len = sizeof(OPacket); + ip->ip_ttl = ttl; + ip->ip_v = IPVERSION; + ip->ip_id = htons(ident + seq); diff --git a/net-analyzer/netselect/files/netselect-0.4-flags.patch b/net-analyzer/netselect/files/netselect-0.4-flags.patch new file mode 100644 index 000000000000..ffcfead8eb3a --- /dev/null +++ b/net-analyzer/netselect/files/netselect-0.4-flags.patch @@ -0,0 +1,12 @@ +--- a/Makefile ++++ b/Makefile +@@ -3,8 +3,7 @@ + MANDEST = ${PREFIX}/man/man1 + + CC = gcc +-CFLAGS = -O2 -Wall -I. -g +-LDFLAGS = -g ++CFLAGS += -Wall -I. + LIBS = + + ifdef OS2 diff --git a/net-analyzer/netselect/netselect-0.4.ebuild b/net-analyzer/netselect/netselect-0.4.ebuild new file mode 100644 index 000000000000..c28ca36f4c5b --- /dev/null +++ b/net-analyzer/netselect/netselect-0.4.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit eutils flag-o-matic toolchain-funcs + +DESCRIPTION="Ultrafast implementation of ping" +HOMEPAGE="http://apenwarr.ca/netselect/" +SRC_URI="https://github.com/apenwarr/${PN}/archive/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos" + +PATCHES=( + "${FILESDIR}"/${PN}-0.4-bsd.patch + "${FILESDIR}"/${PN}-0.4-flags.patch +) +S=${WORKDIR}/${PN}-${P} + +src_prepare() { + default + + rm -r netinet || die + + tc-export CC +} + +src_install () { + dobin netselect + + if ! use prefix ; then + fowners root:wheel /usr/bin/netselect + fperms 4711 /usr/bin/netselect + fi + + dodoc HISTORY README + + doman netselect.1 +} |