summaryrefslogtreecommitdiff
blob: dd093b2fb892c4a9394d280fc5f9bf00a2b61720 (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
66
67
68
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit autotools fcaps toolchain-funcs

DESCRIPTION="Watches network traffic and displays media from TCP streams observed"
HOMEPAGE="http://www.ex-parrot.com/~chris/driftnet/"
SRC_URI="https://github.com/deiv/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2"
KEYWORDS="~amd64 ~arm64 ~ppc -sparc x86"
SLOT="0"
IUSE="debug gtk suid test"

RDEPEND="
	net-libs/libpcap
	net-libs/libwebsockets:=[client,http-proxy,socks5]
	gtk? (
		media-libs/giflib:=
		media-libs/libpng:=
		virtual/jpeg:0
		x11-libs/gtk+:2
	)
"
BDEPEND="
	virtual/pkgconfig
"
DEPEND="
	${RDEPEND}
	test? ( dev-util/cmocka )
"
RESTRICT="!test? ( test )"
DOCS="
	Changelog CREDITS README.md TODO
"
PATCHES=(
	"${FILESDIR}"/${PN}-1.3.0-CFLAGS.patch
	"${FILESDIR}"/${PN}-1.3.0-gtk.patch
)

src_prepare() {
	default
	eautoreconf
}

src_configure() {
	econf $(use_enable gtk display)
}

src_install() {
	default

	gzip -d "${ED}"/usr/share/man/man1/${PN}.1.gz || die

	if use suid ; then
		elog "marking the no-display driftnet as setuid root."
		fowners root:wheel "/usr/bin/driftnet"
		fperms 710 "/usr/bin/driftnet"
		fperms u+s "/usr/bin/driftnet"
	fi
}

pkg_postinst() {
	fcaps \
		cap_dac_read_search,cap_net_raw,cap_net_admin \
		"${EROOT}"/usr/bin/driftnet
}