Ebuild corregida de iputils

This commit is contained in:
Sandino Araico Sanchez 2016-12-28 19:56:13 -06:00
parent 76dc25ccdc
commit 1c5496ef4f
8 changed files with 501 additions and 0 deletions

View file

@ -0,0 +1,3 @@
DIST iputils-s20151218-manpages.tar.xz 22336 SHA256 ae60dcf7a5a83d02008c03888935fd2dcff56c9f86734d4656b6284a7631a28d SHA512 964b9e22b18b67215ea48e046c45768cd86076b53db2131b00ac721be9e7de4edadefb74855d81861f12b4e10dcecd90d29f0098c2c4568d7601d97e756be0a3 WHIRLPOOL 82e3c9930861ed2df00c3b40488212dc36d5d65d62e1e7245d778ff77c6660a93bdd1dd8931cdddba4a631a9321741c0c2246d0cf48b22fc562ee7a066ac75fd
DIST iputils-s20151218.tar.bz2 157187 SHA256 549f58d71951e52b46595829134d4e330642f522f50026917fadc349a54825a1 SHA512 4bf0eed0ae5603e872afb0e09be039df3822a7723e8cbb8cbe578d69d8c457ffac9bdbe2eb17b32c95968e5e4ad6204af955617482c5701671f0f476b560b65c WHIRLPOOL e5b1d89eeaf64c2be97217eff37ef9aea33f69925683067c5366eb8db30a0b8cd8e96c2c18eedb573c965a6508efcb9e67effa66da1ad8bd606a1c1ffff9adf7
EBUILD iputils-20151218-r1.ebuild 4047 SHA256 e8c7e75274326f55720344c83dd1037fbf4a125ee2dcfddbcbf39e49f2aaccac SHA512 5f652bd5e987f84c9fc76c62509be943f960f7d998236c23a60e560978a552b2d83d34136a34467c295f52f9bc6f0f549042430fd755fdf73cde1edce93ecc6c WHIRLPOOL 316e6ff6ede46f5abed719daafadd9ecfcca7d09cccab347576773432032b41f183f4aa949b493f5242567e778336e80545fd246d86b5f3c097c5fb885477c1c

View file

@ -0,0 +1,24 @@
--- iputils/rarpd.c.mps 2004-06-10 15:27:01.000000000 +0200
+++ iputils/rarpd.c 2004-06-10 15:26:29.000000000 +0200
@@ -42,7 +42,9 @@ int listen_arp;
char *ifname;
char *tftp_dir = "/etc/tftpboot";
+#ifndef __UCLIBC__
extern int ether_ntohost(char *name, unsigned char *ea);
+#endif
void usage(void) __attribute__((noreturn));
struct iflink
@@ -305,7 +307,11 @@ struct rarp_map *rarp_lookup(int ifindex
6,
};
+#ifndef __UCLIBC__
if (ether_ntohost(ename, lladdr) != 0 ||
+#else
+ if (
+#endif
(hp = gethostbyname(ename)) == NULL) {
if (verbose)
syslog(LOG_INFO, "not found in /etc/ethers");

View file

@ -0,0 +1,61 @@
From c66609d2c830d6fe06f48f5d38c54eb5cc6f2975 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Thu, 24 Jan 2013 23:36:16 -0500
Subject: [PATCH [iputils]] fix handling of CFLAGS
This defaults CFLAGS to -O3 without clobbering settings people have set
up in the environment already.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
Makefile | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index 2c49940..ecabac3 100644
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,6 @@
# Configuration
#
-# CC
-CC=gcc
# Path to parent kernel include files directory
LIBC_INCLUDE=/usr/include
# Libraries
@@ -48,11 +46,10 @@ ENABLE_RDISC_SERVER=no
# -------------------------------------
# What a pity, all new gccs are buggy and -Werror does not work. Sigh.
-# CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g
-CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -g
-CCOPTOPT=-O3
-GLIBCFIX=-D_GNU_SOURCE
-DEFINES=
+# CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g
+CFLAGS?=-O3 -g
+CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall
+CPPFLAGS+=-D_GNU_SOURCE
LDLIB=
FUNC_LIB = $(if $(filter static,$(1)),$(LDFLAG_STATIC) $(2) $(LDFLAG_DYNAMIC),$(2))
@@ -113,7 +110,6 @@ IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
IPV6_TARGETS=tracepath6 traceroute6 ping6
TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
-CFLAGS=$(CCOPTOPT) $(CCOPT) $(GLIBCFIX) $(DEFINES)
LDLIBS=$(LDLIB) $(ADDLIB)
UNAME_N:=$(shell uname -n)
@@ -132,6 +128,7 @@ all: $(TARGETS)
$(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -S -o $@
%.o: %.c
$(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -o $@
+LINK.o += $(CFLAGS)
$(TARGETS): %: %.o
$(LINK.o) $^ $(LIB_$@) $(LDLIBS) -o $@
--
1.8.0.2

View file

@ -0,0 +1,74 @@
From 4e322b85a12ba3ef5e8118724e3442b2ebb0f6d6 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Wed, 1 Aug 2012 11:43:34 -0400
Subject: [PATCH iputils] doc: fix parallel build of html/man pages
The use of the same tempdir prevents building of these files in parallel.
So build all of them in unique tempdirs so we can do them in parallel.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
doc/Makefile | 37 ++++++++++++++++++++++++-------------
1 file changed, 24 insertions(+), 13 deletions(-)
diff --git a/doc/Makefile b/doc/Makefile
index 7ec4f1c..4f930a3 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -12,29 +12,40 @@ man: $(MANFILES)
# lots of some strange temporary junk directories and files.
# So, scope it to a temporary dir and clean all after each run.
-$(HTMLFILES): index.db
- @-rm -rf tmp.db2html
- @mkdir tmp.db2html
- @set -e; cd tmp.db2html; docbook2html ../$< ; mv *.html ..
- @-rm -rf tmp.db2html
+SETUP_TMPDIR = \
+ t="tmp.db2html.$@"; \
+ rm -rf $$t; \
+ mkdir $$t; \
+ cd $$t
+CLEAN_TMPDIR = \
+ cd ..; \
+ rm -rf $$t
+
+MAKE_HTML = \
+ @set -e; \
+ $(SETUP_TMPDIR); \
+ docbook2html ../$<; \
+ mv *.html ..; \
+ $(CLEAN_TMPDIR)
+$(HTMLFILES): index.db
+ $(MAKE_HTML)
iputils.html: iputils.db
- @-rm -rf tmp.db2html
- @mkdir tmp.db2html
- @set -e; cd tmp.db2html; docbook2html -u -o html ../$< ; mv html/$@ ..
- @-rm -rf tmp.db2html
+ $(MAKE_HTML)
# docbook2man produces utterly ugly output and I did not find
# any way to customize this but hacking backend perl script a little.
# Well, hence...
$(MANFILES): index.db
- @-mkdir tmp.db2man
- @set -e; cd tmp.db2man; nsgmls ../$< | sgmlspl ../docbook2man-spec.pl ; mv $@ ..
- @-rm -rf tmp.db2man
+ @set -e; \
+ $(SETUP_TMPDIR); \
+ nsgmls ../$< | sgmlspl ../docbook2man-spec.pl; \
+ mv $@ ..; \
+ $(CLEAN_TMPDIR)
clean:
- @rm -rf $(MANFILES) $(HTMLFILES) iputils.html tmp.db2html tmp.db2man
+ @rm -rf $(MANFILES) $(HTMLFILES) iputils.html tmp.db2html* tmp.db2man*
snapshot:
@date "+%y%m%d" > snapshot.db
--
2.3.5

View file

@ -0,0 +1,45 @@
https://bugs.gentoo.org/472592
From dd0aa192626f94d08e399fc2a743ee72c50853fb Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Fri, 24 Apr 2015 20:41:31 -0400
Subject: [PATCH iputils] ping: fix -i number parsing in locales
Always use #.# format for the -i flag even when the current locale uses
a different separator. Locale de_DE which uses #,# normally.
Simple testcase:
$ make USE_IDN=1
$ LANG=de_DE.UTF8 ./ping -i 0.5 localhost
Reported-by: Sergey Fionov <fionov@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
ping_common.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/ping_common.c b/ping_common.c
index 62f53a6..0a37e09 100644
--- a/ping_common.c
+++ b/ping_common.c
@@ -269,9 +269,17 @@ void common_options(int ch)
double dbl;
char *ep;
+#ifdef USE_IDN
+ setlocale(LC_ALL, "C");
+#endif
+
errno = 0;
dbl = strtod(optarg, &ep);
+#ifdef USE_IDN
+ setlocale(LC_ALL, "");
+#endif
+
if (errno || *ep != '\0' ||
!finite(dbl) || dbl < 0.0 || dbl >= (double)INT_MAX / 1000 - 1.0) {
fprintf(stderr, "ping: bad timing interval\n");
--
2.3.5

View file

@ -0,0 +1,97 @@
From 321d64b9f94653322e678e34ac214ddb73a71db8 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Thu, 24 Jan 2013 23:32:39 -0500
Subject: [PATCH iputils] ping6: allow disabling of openssl support
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
Makefile | 5 ++++-
iputils_md5dig.h | 4 +++-
ping6.c | 10 ++++++++++
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 54e5a6d..7147f08 100644
--- a/Makefile
+++ b/Makefile
@@ -36,7 +36,7 @@ ARPING_DEFAULT_DEVICE=
# Libgcrypt (for MD5) for ping6 [yes|no|static]
USE_GCRYPT=yes
-# Crypto library for ping6 [shared|static]
+# Crypto library for ping6 [shared|static|no]
USE_CRYPTO=shared
# Resolv library for ping6 [yes|static]
USE_RESOLV=yes
@@ -63,7 +63,10 @@ ifneq ($(USE_GCRYPT),no)
LIB_CRYPTO = $(call FUNC_LIB,$(USE_GCRYPT),$(LDFLAG_GCRYPT))
DEF_CRYPTO = -DUSE_GCRYPT
else
+ifneq ($(USE_CRYPTO),no)
LIB_CRYPTO = $(call FUNC_LIB,$(USE_CRYPTO),$(LDFLAG_CRYPTO))
+ DEF_CRYPTO = -DUSE_OPENSSL
+endif
endif
# USE_RESOLV: LIB_RESOLV
diff --git a/iputils_md5dig.h b/iputils_md5dig.h
index 4cec866..d6c4d46 100644
--- a/iputils_md5dig.h
+++ b/iputils_md5dig.h
@@ -5,8 +5,10 @@
# include <stdlib.h>
# include <gcrypt.h>
# define IPUTILS_MD5DIG_LEN 16
-#else
+# define USE_CRYPTO
+#elif defined(USE_OPENSSL)
# include <openssl/md5.h>
+# define USE_CRYPTO
#endif
#ifdef USE_GCRYPT
diff --git a/ping6.c b/ping6.c
index 7085f31..7b7c1af 100644
--- a/ping6.c
+++ b/ping6.c
@@ -324,6 +324,7 @@ static void niquery_init_nonce(void)
#if !PING6_NONCE_MEMORY
static int niquery_nonce(__u8 *nonce, int fill)
{
+# ifdef USE_CRYPTO
static __u8 digest[MD5_DIGEST_LENGTH];
static int seq = -1;
@@ -346,6 +347,10 @@ static int niquery_nonce(__u8 *nonce, int fill)
return -1;
return ntohsp((__u16 *)nonce);
}
+# else
+ fprintf(stderr, "ping6: function not available; crypto disabled\n");
+ exit(3);
+# endif
}
#endif
@@ -500,6 +505,7 @@ static int niquery_option_subject_addr_handler(int index, const char *arg)
static int niquery_option_subject_name_handler(int index, const char *arg)
{
+#ifdef USE_CRYPTO
static char nigroup_buf[INET6_ADDRSTRLEN + 1 + IFNAMSIZ];
unsigned char *dnptrs[2], **dpp, **lastdnptr;
int n;
@@ -625,6 +631,10 @@ errexit:
free(idn);
free(name);
exit(1);
+#else
+ fprintf(stderr, "ping6: function not available; crypto disabled\n");
+ exit(3);
+#endif
}
int niquery_option_help_handler(int index, const char *arg)
--
2.3.5

View file

@ -0,0 +1,38 @@
From e88ed3752872d7c7ca37d95eb4d434ca4d3c4eae Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sat, 19 Apr 2014 10:39:39 -0400
Subject: [PATCH iputils] tftpd: fix syslog setup
Commit d81a44625b04d487c895473aa77af13420b7afdd added support for checking
the set*id calls, but would call syslog() before it had called openlog().
Move the call up earlier to fix that.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
tftpd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tftpd.c b/tftpd.c
index e3af2f4..7ddc8eb 100644
--- a/tftpd.c
+++ b/tftpd.c
@@ -109,6 +109,8 @@ int main(int ac, char **av)
register int n = 0;
int on = 1;
+ openlog("tftpd", LOG_PID, LOG_DAEMON);
+
/* Sanity. If parent forgot to setuid() on us. */
if (geteuid() == 0) {
if (setgid(65534)) {
@@ -125,7 +127,6 @@ int main(int ac, char **av)
while (ac-- > 0 && n < MAXARG)
dirs[n++] = *av++;
- openlog("tftpd", LOG_PID, LOG_DAEMON);
if (ioctl(0, FIONBIO, &on) < 0) {
syslog(LOG_ERR, "ioctl(FIONBIO): %m\n");
exit(1);
--
2.3.5

View file

@ -0,0 +1,159 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# For released versions, we precompile the man/html pages and store
# them in a tarball on our mirrors. This avoids ugly issues while
# building stages, and when the jade/sgml packages are broken (which
# seems to be more common than would be nice).
EAPI=5
inherit flag-o-matic eutils toolchain-funcs fcaps
if [[ ${PV} == "99999999" ]] ; then
EGIT_REPO_URI="git://www.linux-ipv6.org/gitroot/iputils"
inherit git-2
else
SRC_URI="http://www.skbuff.net/iputils/iputils-s${PV}.tar.bz2
https://dev.gentoo.org/~polynomial-c/iputils-s${PV}-manpages.tar.xz"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux"
fi
DESCRIPTION="Network monitoring tools including ping and ping6"
HOMEPAGE="https://wiki.linuxfoundation.org/networking/iputils"
LICENSE="BSD-4"
SLOT="0"
IUSE="arping caps clockdiff doc gcrypt idn ipv6 libressl rarpd rdisc SECURITY_HAZARD ssl static tftpd tracepath traceroute"
LIB_DEPEND="caps? ( sys-libs/libcap[static-libs(+)] )
idn? ( net-dns/libidn[static-libs(+)] )
ipv6? ( ssl? (
gcrypt? ( dev-libs/libgcrypt:0=[static-libs(+)] )
!gcrypt? (
!libressl? ( dev-libs/openssl:0[static-libs(+)] )
libressl? ( dev-libs/libressl[static-libs(+)] )
)
) )"
RDEPEND="arping? ( !net-misc/arping )
rarpd? ( !net-misc/rarpd )
traceroute? ( !net-analyzer/traceroute )
!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
DEPEND="${RDEPEND}
static? ( ${LIB_DEPEND} )
virtual/os-headers"
if [[ ${PV} == "99999999" ]] ; then
DEPEND+="
app-text/openjade
dev-perl/SGMLSpm
app-text/docbook-sgml-dtd
app-text/docbook-sgml-utils
"
fi
S=${WORKDIR}/${PN}-s${PV}
PATCHES=(
"${FILESDIR}"/021109-uclibc-no-ether_ntohost.patch
"${FILESDIR}"/${PN}-99999999-openssl.patch #335436
"${FILESDIR}"/${PN}-99999999-tftpd-syslog.patch
"${FILESDIR}"/${PN}-20121221-makefile.patch
"${FILESDIR}"/${PN}-20121221-parallel-doc.patch
"${FILESDIR}"/${PN}-20121221-strtod.patch #472592
)
src_prepare() {
use SECURITY_HAZARD && PATCHES+=( "${FILESDIR}"/${PN}-20071127-nonroot-floodping.patch )
epatch "${PATCHES[@]}"
}
src_configure() {
use static && append-ldflags -static
IPV4_TARGETS=(
ping
$(for v in arping clockdiff rarpd rdisc tftpd tracepath ; do usev ${v} ; done)
)
IPV6_TARGETS=(
ping6
$(usex tracepath 'tracepath6' '')
$(usex traceroute 'traceroute6' '')
)
use ipv6 || IPV6_TARGETS=()
}
ldflag_resolv() {
# See if the system includes a libresolv. #584132
echo "main(){}" > "${T}"/resolv.c
if ${CC} ${CFLAGS} ${LDFLAGS} "${T}"/resolv.c -lresolv -o "${T}"/resolv 2>/dev/null ; then
echo -lresolv
fi
}
src_compile() {
tc-export CC
emake \
USE_CAP=$(usex caps) \
USE_IDN=$(usex idn) \
USE_GCRYPT=$(usex gcrypt) \
USE_CRYPTO=$(usex ssl) \
LDFLAG_RESOLV=$(ldflag_resolv) \
IPV4_TARGETS="${IPV4_TARGETS[*]}" \
IPV6_TARGETS="${IPV6_TARGETS[*]}"
if [[ ${PV} == "99999999" ]] ; then
emake html man
fi
}
src_install() {
into /
dobin ping $(usex ipv6 'ping6' '')
use ipv6 && dosym ping.8 /usr/share/man/man8/ping6.8
doman doc/ping.8
if use arping ; then
dobin arping
doman doc/arping.8
fi
into /usr
local u
for u in clockdiff rarpd rdisc tftpd tracepath traceroute ; do
if use ${u} ; then
case ${u} in
clockdiff) dobin ${u};;
*) dosbin ${u};;
esac
doman doc/${u}.8
fi
done
if use tracepath && use ipv6 ; then
dosbin tracepath6
dosym tracepath.8 /usr/share/man/man8/tracepath6.8
fi
if use traceroute && use ipv6 ; then
dosbin traceroute6
doman doc/traceroute6.8
fi
if use rarpd ; then
newinitd "${FILESDIR}"/rarpd.init.d rarpd
newconfd "${FILESDIR}"/rarpd.conf.d rarpd
fi
dodoc INSTALL RELNOTES
use doc && dohtml doc/*.html
}
pkg_postinst() {
fcaps cap_net_raw \
bin/ping \
$(usex ipv6 'bin/ping6' '') \
$(usex arping 'bin/arping' '') \
$(usex clockdiff 'usr/bin/clockdiff' '')
}