summaryrefslogtreecommitdiff
blob: c2b633f89c711c4787a2e44bbec85fe750db6ebe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/netcat/netcat-110-r4.ebuild,v 1.3 2003/10/05 21:12:18 brad_mssw Exp $

inherit eutils

MY_P=nc${PV}
S=${WORKDIR}/nc-${PV}
DESCRIPTION="A network piping program"
SRC_URI="http://www.atstake.com/research/tools/network_utilities/${MY_P}.tgz
	ipv6?( ftp://sith.mimuw.edu.pl/pub/users/baggins/IPv6/nc-v6-20000918.patch.gz )
	mirror://gentoo/${P}-deb-patches.tbz2"
HOMEPAGE="http://www.atstake.com/research/tools/network_utilities/"

LICENSE="as-is"
SLOT="0"
KEYWORDS="~x86 ~ppc ~sparc ~alpha ~hppa ~amd64"
IUSE="ipv6 static"

DEPEND="virtual/glibc"

src_unpack() {
	mkdir ${S}
	cd ${S}
	unpack ${MY_P}.tgz
	unpack ${P}-deb-patches.tbz2
	[ `use ipv6` ] \
		&& epatch ${DISTDIR}/nc-v6-20000918.patch.gz && rm deb-patches/*_noipv6.patch \
		|| rm deb-patches/*_ipv6.patch
	EPATCH_SUFFIX="patch"
	epatch ${S}/deb-patches/
	echo "#define arm arm_timer" >> generic.h
	sed -i 's:#define HAVE_BIND:#undef HAVE_BIND:' netcat.c
}

src_compile() {
	export XFLAGS="-DLINUX"
	[ `use ipv6` ] && XFLAGS="${XFLAGS} -DINET6"
	[ `use static` ] && export STATIC="-static"
	CC="gcc ${CFLAGS}" make -e nc || die
}

src_install() {
	dobin nc
	dodoc README README.Debian netcat.blurb
	doman nc.1
	docinto scripts
	dodoc scripts/*
}