Diff netcat-110-r9 with a netcat-110.20180111-r1

/usr/portage/net-analyzer/netcat/netcat-110.20180111-r1.ebuild 2023-10-09 14:52:33.324368447 +0300
3 3

  
4 4
EAPI=7
5 5

  
6
inherit toolchain-funcs
6
inherit toolchain-funcs flag-o-matic
7 7

  
8
PATCH_VER="1.0"
9
MY_P=nc${PV}
8
MY_P="nc${PV}"
10 9
DESCRIPTION="The network swiss army knife"
11 10
HOMEPAGE="https://nc110.sourceforge.io"
12
SRC_URI="mirror://sourceforge/nc110/${MY_P}.tgz
13
	ftp://sith.mimuw.edu.pl/pub/users/baggins/IPv6/nc-v6-20000918.patch.gz
14
	mirror://gentoo/${P}-patches-${PATCH_VER}.tar.bz2
15
"
16
S="${WORKDIR}"
11
SRC_URI="mirror://sourceforge/nc110/${MY_P}.tar.xz"
12
S="${WORKDIR}/nc110"
17 13

  
18 14
LICENSE="netcat"
19 15
SLOT="0"
20
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-solaris"
21
IUSE="crypt ipv6 static"
22

  
23
LIB_DEPEND="crypt? ( dev-libs/libmix[static-libs(+)] )"
24
RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
25
DEPEND="
26
	${RDEPEND}
27
	static? ( ${LIB_DEPEND} )
28
"
16
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-solaris"
17
IUSE="ipv6 static"
29 18

  
30 19
src_prepare() {
31 20
	default
32 21

  
33
	eapply "${WORKDIR}"/nc-v6-20000918.patch
34

  
35
	sed -i 's:#define HAVE_BIND:#undef HAVE_BIND:' netcat.c
36
	# bug 34250
37
	sed -i 's:#define FD_SETSIZE 16:#define FD_SETSIZE 1024:' netcat.c
22
	sed -i \
23
		-e '/#define HAVE_BIND/s:#define:#undef:' \
24
		-e '/#define FD_SETSIZE 16/s:16:1024: #34250' \
25
		netcat.c || die
38 26

  
39 27
	if [[ ${CHOST} == *-solaris* ]] ; then
40
		sed -i 's:gethostbyname2(\([^)]\+\)):getipnodebyname(\1, AI_DEFAULT, NULL):' netcat.c || die
28
		sed -i 's:gethostbyname2 *(\([^)]\+\)):getipnodebyname (\1, AI_DEFAULT, NULL):' netcat.c || die
41 29
	fi
42 30
}
43 31

  
44
src_compile() {
45
	export XLIBS=""
46
	export XFLAGS="-DLINUX -DTELNET -DGAPING_SECURITY_HOLE"
47

  
48
	if use ipv6 ; then
49
		XFLAGS+=" -DINET6"
32
src_configure() {
33
	if ! use ipv6 ; then
34
		sed -i '/#define INET6/d' generic.h || die
50 35
	fi
51 36

  
52
	if use static ; then
53
		export STATIC="-static"
54
	fi
37
	append-cppflags -DTELNET -DGAPING_SECURITY_HOLE
38
}
55 39

  
56
	if use crypt ; then
57
		XFLAGS+=" -DAESCRYPT"
58
		XLIBS+=" -lmix"
59
	fi
40
src_compile() {
41
	local xlibs
60 42

  
61
	if [[ ${CHOST} == *-solaris* ]] ; then
62
		XLIBS+=" -lnsl -lsocket"
63
	fi
43
	[[ ${CHOST} == *-solaris* ]] && xlibs+=" -lnsl -lsocket"
64 44

  
65
	emake -e CC="$(tc-getCC) ${CFLAGS} ${LDFLAGS}" nc
45
	emake \
46
		LD="$(tc-getCC) ${LDFLAGS}" \
47
		DFLAGS="${CPPFLAGS}" \
48
		XFLAGS="${CFLAGS}" \
49
		STATIC=$(usex static '-static' '') \
50
		XLIBS="${xlibs}" \
51
		nc
66 52
}
67 53

  
68 54
src_install() {
69 55
	dobin nc
70
	dodoc README* netcat.blurb debian-*
56

  
57
	dodoc README* netcat.blurb
71 58
	doman nc.1
59

  
72 60
	docinto scripts
73 61
	dodoc scripts/*
74 62
}
Thank you!