| 1 |
1 |
# Copyright 1999-2025 Gentoo Authors
|
| 2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
3 |
|
| 4 |
|
EAPI=7
|
|
4 |
EAPI=8
|
| 5 |
5 |
|
| 6 |
6 |
inherit autotools fcaps
|
| 7 |
7 |
|
| 8 |
8 |
DESCRIPTION="Watches network traffic and displays media from TCP streams observed"
|
| 9 |
|
HOMEPAGE="http://www.ex-parrot.com/~chris/driftnet/"
|
|
9 |
HOMEPAGE="https://chris.ex-parrot.com/driftnet/"
|
| 10 |
10 |
SRC_URI="https://github.com/deiv/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
| 11 |
11 |
|
| 12 |
12 |
LICENSE="GPL-2"
|
| 13 |
|
KEYWORDS="amd64 ~arm64 ppc -sparc x86"
|
| 14 |
13 |
SLOT="0"
|
| 15 |
|
IUSE="debug gtk suid test"
|
|
14 |
KEYWORDS="amd64 ~arm64 ppc -sparc x86"
|
|
15 |
IUSE="debug gtk httpd suid test"
|
|
16 |
RESTRICT="!test? ( test )"
|
| 16 |
17 |
|
| 17 |
18 |
RDEPEND="
|
| 18 |
19 |
net-libs/libpcap
|
| 19 |
|
net-libs/libwebsockets:=[client,http-proxy,socks5]
|
|
20 |
media-libs/libwebp:=
|
| 20 |
21 |
gtk? (
|
|
22 |
dev-libs/glib:2
|
| 21 |
23 |
media-libs/giflib:=
|
|
24 |
media-libs/libjpeg-turbo:=
|
| 22 |
25 |
media-libs/libpng:=
|
| 23 |
|
virtual/jpeg:0
|
| 24 |
|
x11-libs/gtk+:2
|
|
26 |
x11-libs/cairo
|
|
27 |
x11-libs/gtk+:3[X]
|
| 25 |
28 |
)
|
| 26 |
|
"
|
| 27 |
|
BDEPEND="
|
| 28 |
|
virtual/pkgconfig
|
|
29 |
httpd? ( net-libs/libwebsockets:=[client,http-proxy,socks5] )
|
| 29 |
30 |
"
|
| 30 |
31 |
DEPEND="
|
| 31 |
32 |
${RDEPEND}
|
| 32 |
33 |
test? ( dev-util/cmocka )
|
| 33 |
34 |
"
|
| 34 |
|
RESTRICT="!test? ( test )"
|
| 35 |
|
DOCS="
|
| 36 |
|
Changelog CREDITS README.md TODO
|
| 37 |
|
"
|
|
35 |
BDEPEND="virtual/pkgconfig"
|
|
36 |
|
| 38 |
37 |
PATCHES=(
|
| 39 |
|
"${FILESDIR}"/${PN}-1.3.0-CFLAGS.patch
|
| 40 |
|
"${FILESDIR}"/${PN}-1.3.0-gtk.patch
|
| 41 |
|
"${FILESDIR}"/${PN}-1.3.0-musl-stdint.patch
|
| 42 |
|
"${FILESDIR}"/${PN}-1.3.0-libwebsocket_compat.patch
|
|
38 |
# Respect user flags
|
|
39 |
"${FILESDIR}"/${PN}-1.6.0-CFLAGS.patch
|
|
40 |
# https://github.com/deiv/driftnet/pull/56.patch
|
|
41 |
"${FILESDIR}"/${PN}-1.5.0-fix_test.patch
|
|
42 |
"${FILESDIR}"/${PN}-1.5.0-use_uint.patch
|
|
43 |
# https://github.com/deiv/driftnet/pull/57.patch
|
|
44 |
"${FILESDIR}"/${PN}-1.5.0-libwebsocket_compat.patch
|
| 43 |
45 |
)
|
| 44 |
46 |
|
|
47 |
FILECAPS=( cap_dac_read_search,cap_net_raw,cap_net_admin usr/bin/driftnet )
|
|
48 |
|
|
49 |
# EXTRA_DIST
|
|
50 |
DOCS=( Changelog CREDITS )
|
|
51 |
|
| 45 |
52 |
src_prepare() {
|
| 46 |
53 |
default
|
| 47 |
54 |
eautoreconf
|
| 48 |
55 |
}
|
| 49 |
56 |
|
| 50 |
57 |
src_configure() {
|
| 51 |
|
econf $(use_enable gtk display)
|
|
58 |
local myeconfargs=(
|
|
59 |
$(use_enable debug)
|
|
60 |
$(use_enable gtk display)
|
|
61 |
$(use_enable httpd http-display)
|
|
62 |
--htmldir="${EPREFIX}"/usr/share/driftnet/static-html
|
|
63 |
)
|
|
64 |
econf "${myeconfargs[@]}"
|
| 52 |
65 |
}
|
| 53 |
66 |
|
| 54 |
67 |
src_install() {
|
| ... | ... | |
| 57 |
70 |
gzip -d "${ED}"/usr/share/man/man1/${PN}.1.gz || die
|
| 58 |
71 |
|
| 59 |
72 |
if use suid ; then
|
| 60 |
|
elog "marking the no-display driftnet as setuid root."
|
|
73 |
elog "marking driftnet as setuid root."
|
| 61 |
74 |
fowners root:wheel "/usr/bin/driftnet"
|
| 62 |
75 |
fperms 710 "/usr/bin/driftnet"
|
| 63 |
76 |
fperms u+s "/usr/bin/driftnet"
|
| 64 |
77 |
fi
|
| 65 |
78 |
}
|
| 66 |
|
|
| 67 |
|
pkg_postinst() {
|
| 68 |
|
fcaps \
|
| 69 |
|
cap_dac_read_search,cap_net_raw,cap_net_admin \
|
| 70 |
|
"${EROOT}"/usr/bin/driftnet
|
| 71 |
|
}
|