From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 010B7138334 for ; Wed, 12 Sep 2018 02:39:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D843FE09A2; Wed, 12 Sep 2018 02:39:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 90E64E09A2 for ; Wed, 12 Sep 2018 02:39:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2440533BDD0 for ; Wed, 12 Sep 2018 02:38:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9EAEF3BE for ; Wed, 12 Sep 2018 02:38:57 +0000 (UTC) From: "Benda XU" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Benda XU" Message-ID: <1536719850.c0817e0ba61968f842f4f8d5fbb30d5c93be8dec.heroxbd@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/openbsd-netcat/files/, net-analyzer/openbsd-netcat/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-analyzer/openbsd-netcat/Manifest net-analyzer/openbsd-netcat/files/openbsd-netcat-1.190-darwin.patch net-analyzer/openbsd-netcat/openbsd-netcat-1.190.ebuild net-analyzer/openbsd-netcat/openbsd-netcat-1.84.ebuild X-VCS-Directories: net-analyzer/openbsd-netcat/files/ net-analyzer/openbsd-netcat/ X-VCS-Committer: heroxbd X-VCS-Committer-Name: Benda XU X-VCS-Revision: c0817e0ba61968f842f4f8d5fbb30d5c93be8dec X-VCS-Branch: master Date: Wed, 12 Sep 2018 02:38:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 0b6cec05-9ac4-4504-96ba-426ffad6a413 X-Archives-Hash: f44ddf0e9a188bd0001768549364ff19 commit: c0817e0ba61968f842f4f8d5fbb30d5c93be8dec Author: Xiami f2light com> AuthorDate: Thu Sep 6 11:19:39 2018 +0000 Commit: Benda XU gentoo org> CommitDate: Wed Sep 12 02:37:30 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0817e0b net-analyzer/openbsd-netcat: bump to version 1.190 Bump to EAPI 7 (deprecate epatch) Use debian/patches/series to determine patch order Remove eapi-deprecated ebuild Closes: https://github.com/gentoo/gentoo/pull/9790 Package-Manager: Portage-2.3.40, Repoman-2.3.9 net-analyzer/openbsd-netcat/Manifest | 3 +- .../files/openbsd-netcat-1.190-darwin.patch | 90 ++++++++++++++++++++++ .../openbsd-netcat/openbsd-netcat-1.190.ebuild | 56 ++++++++++++++ .../openbsd-netcat/openbsd-netcat-1.84.ebuild | 68 ---------------- 4 files changed, 148 insertions(+), 69 deletions(-) diff --git a/net-analyzer/openbsd-netcat/Manifest b/net-analyzer/openbsd-netcat/Manifest index 5fc38136e0d..6b9fe794d87 100644 --- a/net-analyzer/openbsd-netcat/Manifest +++ b/net-analyzer/openbsd-netcat/Manifest @@ -1,3 +1,4 @@ -DIST nc-1.84-22.el6.src.rpm 62570 BLAKE2B d7407ec122997a05fe27a13557530d2905f7d1159e609b4600c72dceaa9347944218196a1190ac7e431b35e255eca1fa8f812f12b32898eda369c21984498d97 SHA512 a02f5a42e0db0aeff95a06964d6b9ccfa21d659ca67505d19c724966edbca42446ac4048339def769139ca6ae145cdc75e9908f12b21449bc9d748d3cac39094 DIST netcat-openbsd_1.105-7.debian.tar.gz 31843 BLAKE2B 115eb2d0c0f35055eb26608746806ba97d15b9320954b5d531a73f3f76ed22238395797e90bc3e60dd9cf5b31e696eec59843f37001093013ed0ef82ae590126 SHA512 ec507c858a9f0e75f5a8d6ee8e60eef5200428e55091e831a7acba6c61d70f97af01103c9b65354b0ce773214b0758d957852af793debb70be8aab5b5900b3f6 DIST netcat-openbsd_1.105.orig.tar.gz 14891 BLAKE2B 65119a4e2cb3d9cd7b2d7d346b827ff1c175cc3255f40d70bbd45213b438635d6b063b3cf210d27595e38b0d67339788221ae5c3737e6096782245fb573bca3a SHA512 1e515b5af83a12c6f270d6e8bede6406cc7c9f83ca0e316816508dfe2e2c49cda3fffb6b24a3922bf9908dc8b70d540eb8cc49e9cbfe867e49133c004d3f4703 +DIST netcat-openbsd_1.190-2.debian.tar.xz 34836 BLAKE2B 3ff4390c07d05e8d1a19c8696da12bdc6bba07c6e88281b04cd7915509f44a14dda66462128da768b255d92f3a02d008750a860db9290f9f8e0e0bb9dd66e01b SHA512 c33510ad6761627e0b7e564747f6ae82c7569157bdc91f6a282a97b038b2b0917c27fdfba137462c7c34d84fcfdfe8b6393204884d153e3d200a86f5c6657a9a +DIST netcat-openbsd_1.190.orig.tar.gz 22384 BLAKE2B c3e83106f53a0214f71c805b1dfe6b66718dfca217f713a0d7016cb0a3c75c78580fbdd277bd7b5324371145c4b986ebb867e6f779cd61ffecb8e732ebabcb84 SHA512 32310813391f63b8283dc4a63e52821e464ecbfcd0ea995e8e15047c6252a86b31eb4725dc69b778594c43d6ce0cc081aa0f00d7cda0587c91941f20b93a33fe diff --git a/net-analyzer/openbsd-netcat/files/openbsd-netcat-1.190-darwin.patch b/net-analyzer/openbsd-netcat/files/openbsd-netcat-1.190-darwin.patch new file mode 100644 index 00000000000..818b13a81a5 --- /dev/null +++ b/net-analyzer/openbsd-netcat/files/openbsd-netcat-1.190-darwin.patch @@ -0,0 +1,90 @@ +Allow compilation on Darwin + +diff --git a/netcat.c b/netcat.c +index a0fb51b..bbb5dd1 100644 +--- a/netcat.c ++++ b/netcat.c +@@ -51,11 +51,13 @@ + # include + #endif + ++#ifndef IPTOS_LOWCOST ++# define IPTOS_LOWCOST 0x02 ++#endif + #ifndef IPTOS_LOWDELAY + # define IPTOS_LOWDELAY 0x10 + # define IPTOS_THROUGHPUT 0x08 + # define IPTOS_RELIABILITY 0x04 +-# define IPTOS_LOWCOST 0x02 + # define IPTOS_MINCOST IPTOS_LOWCOST + #endif /* IPTOS_LOWDELAY */ + +@@ -108,8 +110,9 @@ + # include + #endif + #include +-#include +-#include ++#include ++#include ++#include + + #include "atomicio.h" + +@@ -240,6 +243,43 @@ static int connect_with_timeout(int fd, const struct sockaddr *sa, + + static void quit(); + ++static char* strtonumerrs[] = { ++ "too large", ++ "too small", ++ "invalid" ++}; ++ ++static long long ++strtonum( ++ const char *nptr, ++ long long minval, ++ long long maxval, ++ const char **errstr) ++{ ++ long long val; ++ ++ while (*nptr != '\0' && isspace(*nptr)) ++ nptr++; ++ if (*nptr == '\0') { ++ if (errstr != NULL) ++ *errstr = strtonumerrs[2]; ++ return 0; ++ } ++ val = atoll(nptr); ++ if (val < minval) { ++ if (errstr != NULL) ++ *errstr = strtonumerrs[1]; ++ return 0; ++ } ++ if (val > maxval) { ++ if (errstr != NULL) ++ *errstr = strtonumerrs[0]; ++ return 0; ++ } ++ *errstr = NULL; ++ return val; ++} ++ + int + main(int argc, char *argv[]) + { +diff --git a/socks.c b/socks.c +index 9068f39..68b68e3 100644 +--- a/socks.c ++++ b/socks.c +@@ -38,7 +38,7 @@ + #include + #include + #include +-#include ++#include + #include "atomicio.h" + + #define SOCKS_PORT "1080" diff --git a/net-analyzer/openbsd-netcat/openbsd-netcat-1.190.ebuild b/net-analyzer/openbsd-netcat/openbsd-netcat-1.190.ebuild new file mode 100644 index 00000000000..e94c5c4103a --- /dev/null +++ b/net-analyzer/openbsd-netcat/openbsd-netcat-1.190.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs + +DESCRIPTION="The OpenBSD network swiss army knife" +HOMEPAGE="https://cvsweb.openbsd.org/src/usr.bin/nc/ + https://salsa.debian.org/debian/netcat-openbsd" +SRC_URI="http://http.debian.net/debian/pool/main/n/netcat-openbsd/netcat-openbsd_${PV}.orig.tar.gz + http://http.debian.net/debian/pool/main/n/netcat-openbsd/netcat-openbsd_${PV}-2.debian.tar.xz" +LICENSE="BSD" +SLOT="0" +IUSE="elibc_Darwin" + +KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x64-macos" + +DEPEND="virtual/pkgconfig" +RDEPEND="!elibc_Darwin? ( dev-libs/libbsd ) + !net-analyzer/netcat + !net-analyzer/netcat6 +" + +S=${WORKDIR}/netcat-openbsd-${PV} + +src_prepare() { + for i_patch in $(<"${WORKDIR}"/debian/patches/series); do + eapply "${WORKDIR}"/debian/patches/"${i_patch}" + done + if [[ ${CHOST} == *-darwin* ]] ; then + # this undoes some of the Debian/Linux changes + eapply "${FILESDIR}"/${P}-darwin.patch + fi + default +} + +src_compile() { + emake CC=$(tc-getCC) CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" +} + +src_install() { + dobin nc + doman nc.1 + cd "${WORKDIR}"/debian || die + newdoc netcat-openbsd.README.Debian README + dodoc -r examples +} + +pkg_postinst() { + if [[ ${KERNEL} = "linux" ]]; then + ewarn "SO_REUSEPORT is introduced in linux 3.9. If your running kernel is older" + ewarn "and kernel header is newer, nc will not listen correctly. Matching the header" + ewarn "to the running kernel will do. See bug #490246 for details." + fi +} diff --git a/net-analyzer/openbsd-netcat/openbsd-netcat-1.84.ebuild b/net-analyzer/openbsd-netcat/openbsd-netcat-1.84.ebuild deleted file mode 100644 index 201bfeb79f8..00000000000 --- a/net-analyzer/openbsd-netcat/openbsd-netcat-1.84.ebuild +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=4 - -inherit eutils toolchain-funcs rpm - -DESCRIPTION="the OpenBSD network swiss army knife" -HOMEPAGE="http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/" -SRC_URI="ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/nc-1.84-22.el6.src.rpm" -LICENSE="BSD" -SLOT="0" - -KEYWORDS="~amd64 ~x86" - -IUSE="static" - -DEPEND="dev-libs/glib:2" -RDEPEND="${DEPEND}" - -S=${WORKDIR}/nc - -src_unpack() { - rpm_src_unpack -} - -src_prepare() { - epatch "../nc-1.84-glib.patch" - epatch "../nc-1.78-pollhup.patch" - epatch "../nc-1.82-reuseaddr.patch" - epatch "../nc-gcc_signess.patch" - epatch "../nc-1.84-connect_with_timeout.patch" - epatch "../nc-1.84-udp_stop.patch" - epatch "../nc-1.84-udp_port_scan.patch" - epatch "../nc-1.84-crlf.patch" - epatch "../nc-1.84-verb.patch" - epatch "../nc-1.84-man.patch" - epatch "../nc-1.84-gcc4.3.patch" - epatch "../nc-1.84-efficient_reads.patch" - epatch "../nc-1.84-verbose-segfault.patch" - - # avoid name conflict against net-analyzer/netcat - mv nc.1 nc.openbsd.1 -} - -src_compile() { - use static && export STATIC="-static" - COMPILER=$(tc-getCC) - ${COMPILER} ${CFLAGS} netcat.c atomicio.c socks.c \ - $(pkg-config --cflags --libs glib-2.0) \ - ${LDFLAGS} -o nc.openbsd || die -} - -src_install() { - dobin nc.openbsd - dodoc README* - doman nc.openbsd.1 - docinto scripts - dodoc scripts/* -} - -pkg_postinst() { - if [[ ${KERNEL} = "linux" ]]; then - ewarn "FO_REUSEPORT is introduced in linux 3.9. If your running kernel is older" - ewarn "and kernel header is newer, nc will not listen correctly. Matching the header" - ewarn "to the running kernel will do. See bug #490246 for details." - fi -}