From 12997d4eb873b8514fdb132d23c0731607b3aa65 Mon Sep 17 00:00:00 2001 From: mi Date: Mon, 9 Mar 2015 06:48:12 +0000 Subject: Unbreak -- seems to work for me, no errors quoted in the BROKEN-message appear. While here resolve a worning and arrange for installing the author's README-file, if DOCS-option is on. --- net/netselect/Makefile | 14 ++++++++++---- net/netselect/files/patch-netselect.c | 19 +++++++++++++++++-- net/netselect/pkg-plist | 1 + 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/net/netselect/Makefile b/net/netselect/Makefile index 1d881985ea34..dd047898198a 100644 --- a/net/netselect/Makefile +++ b/net/netselect/Makefile @@ -12,18 +12,24 @@ COMMENT= Ultrafast implementation of ping LICENSE= BSD3CLAUSE -BROKEN= Does not work (sendto: Invalid argument) - -OPTIONS_DEFINE= SUID +OPTIONS_DEFINE= SUID DOCS OPTIONS_SUB= yes -SUID_DESC= Install with the setuid bit (mode 4110) +SUID_DESC= Install with the setuid bit to allow use by non-root users +EXTRACT_AFTER_ARGS=netselect/netselect.c netselect/README WRKSRC= ${WRKDIR}/${PORTNAME} do-build: ${CC} ${CFLAGS} -o ${WRKSRC}/${PORTNAME} ${WRKSRC}/${PORTNAME}.c + ${REINPLACE_CMD} -E -i "" -e 's|[[:blank:]]+$$||' ${WRKSRC}/README + +.include do-install: ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin +.if ${PORT_OPTIONS:MDOCS} + ${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR} +.endif .include diff --git a/net/netselect/files/patch-netselect.c b/net/netselect/files/patch-netselect.c index 6e7f1cacca48..6717a97234aa 100644 --- a/net/netselect/files/patch-netselect.c +++ b/net/netselect/files/patch-netselect.c @@ -1,5 +1,5 @@ ---- netselect.c.orig 2006-07-14 22:59:18.000000000 +0200 -+++ netselect.c 2006-07-14 22:57:22.000000000 +0200 +--- netselect.c 2001-08-29 05:18:57.000000000 -0400 ++++ netselect.c 2015-03-09 02:31:02.000000000 -0400 @@ -39,14 +39,13 @@ * hey, great! Let me know. -- apenwarr */ @@ -53,3 +53,18 @@ ip->ip_ttl = ttl; ip->ip_v = IPVERSION; ip->ip_id = htons(ident + seq); +@@ -771,12 +776,8 @@ + int cc = 0; + time_t msec_used; + HostData *host; +- +-#if !defined(__GLIBC__) +- int fromlen = sizeof(from); +-#else /* __GLIBC__ */ +- size_t fromlen = sizeof(from); +-#endif /* __GLIBC__ */ ++ ++ socklen_t fromlen = sizeof(from); + + FD_ZERO(&fds); + FD_SET(sock, &fds); diff --git a/net/netselect/pkg-plist b/net/netselect/pkg-plist index b5ddfc583a9b..7a520d7b93c1 100644 --- a/net/netselect/pkg-plist +++ b/net/netselect/pkg-plist @@ -1,2 +1,3 @@ %%SUID%%@(root,wheel,4110) bin/netselect %%NO_SUID%%@(root,wheel,100) bin/netselect +%%PORTDOCS%%%%DOCSDIR%%/README -- cgit