summaryrefslogtreecommitdiff
path: root/net-analyzer/hping/hping-3_pre20141226.ebuild
blob: 37a6553b3be0c7872759eb1c84081aa315d6c8c2 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit flag-o-matic toolchain-funcs

HPING_COMMIT="3547c7691742c6eaa31f8402e0ccbb81387c1b99"
DESCRIPTION="A ping-like TCP/IP packet assembler/analyzer"
HOMEPAGE="http://www.hping.org"
SRC_URI="https://github.com/antirez/${PN}/archive/${HPING_COMMIT}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN}-${HPING_COMMIT}"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ppc sparc x86"
IUSE="tcl"

DEPEND="
	net-libs/libpcap
	tcl? ( dev-lang/tcl:0= )
"
RDEPEND="${DEPEND}"

PATCHES=(
	"${FILESDIR}"/${PN}-3_pre20051105-libtcl.patch
	"${FILESDIR}"/${PN}-3_pre20051105-tcl.patch
	"${FILESDIR}"/${PN}-3_pre20051105-tclsh-proper-escaping.patch
	"${FILESDIR}"/${PN}-3_pre20141226-compile.patch
	"${FILESDIR}"/${PN}-3_pre20141226-hping2-2-hping.patch
	"${FILESDIR}"/${PN}-3_pre20141226-indent.patch
	"${FILESDIR}"/${PN}-3_pre20141226-pcap-bpf.patch
	"${FILESDIR}"/${PN}-3_pre20141226-scan-overflow.patch
	"${FILESDIR}"/${PN}-3_pre20141226-unused-but-set.patch
	"${FILESDIR}"/${PN}-3_pre20141226-fno-common.patch
)

src_configure() {
	# bug #861161
	filter-lto

	tc-export CC

	# Not an autotools type configure:
	sh configure $(usex tcl '' --no-tcl) || die
}

src_compile() {
	emake \
		DEBUG="" \
		"CFLAGS=${CFLAGS}" \
		"AR=$(tc-getAR)" \
		"RANLIB=$(tc-getRANLIB)" \
		"LIBDIR=$(get_libdir)"
}

src_install() {
	dosbin hping3
	dosym hping3 /usr/sbin/hping
	dosym hping3 /usr/sbin/hping2

	newman docs/hping3.8 hping.8

	dodoc AUTHORS BUGS CHANGES INSTALL NEWS README TODO
}