| 1 |
|
# Copyright 1999-2025 Gentoo Authors
|
|
1 |
# Copyright 1999-2026 Gentoo Authors
|
| 2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
3 |
|
| 4 |
4 |
EAPI=8
|
| 5 |
5 |
|
| 6 |
|
PYTHON_COMPAT=( python3_{11..13} )
|
|
6 |
PYTHON_COMPAT=( python3_{11..15} )
|
| 7 |
7 |
|
| 8 |
|
inherit autotools eapi9-ver flag-o-matic python-single-r1 udev systemd
|
|
8 |
inherit autotools eapi9-ver python-single-r1 udev systemd
|
| 9 |
9 |
|
| 10 |
10 |
if [[ ${PV} == "9999" ]] ; then
|
| 11 |
11 |
EGIT_REPO_URI="https://www.kismetwireless.net/git/${PN}.git"
|
| 12 |
12 |
inherit git-r3
|
| 13 |
|
RESTRICT="strip"
|
| 14 |
13 |
else
|
| 15 |
14 |
MY_P=${P/\./-}
|
| 16 |
15 |
MY_P=${MY_P/_beta/-BETA}
|
| ... | ... | |
| 18 |
17 |
S=${WORKDIR}/${MY_P/BETA/beta}
|
| 19 |
18 |
|
| 20 |
19 |
#normally we want an official release
|
| 21 |
|
SRC_URI="https://www.kismetwireless.net/code/${MY_P}.tar.xz
|
| 22 |
|
https://dev.gentoo.org/~zerochaos/distfiles/${PN}-2023.07.1-stdint-fix.patch"
|
|
20 |
SRC_URI="https://www.kismetwireless.net/code/${MY_P}.tar.xz"
|
| 23 |
21 |
|
| 24 |
22 |
#but sometimes we want a git commit
|
| 25 |
23 |
#COMMIT="9ca7e469cf115469f392db7436816151867e1654"
|
| 26 |
24 |
#SRC_URI="https://github.com/kismetwireless/kismet/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
|
| 27 |
25 |
#S="${WORKDIR}/${PN}-${COMMIT}"
|
| 28 |
26 |
|
| 29 |
|
PATCHES=(
|
| 30 |
|
"${DISTDIR}/${PN}-2023.07.1-stdint-fix.patch"
|
| 31 |
|
# https://github.com/kismetwireless/kismet/pull/517
|
| 32 |
|
"${FILESDIR}"/0001-configure.ac-bashism-fix-critical-existence-failure-.patch
|
| 33 |
|
)
|
| 34 |
|
|
| 35 |
|
KEYWORDS="amd64 arm ~arm64 ~ppc x86"
|
|
27 |
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
|
| 36 |
28 |
fi
|
| 37 |
29 |
|
| 38 |
30 |
DESCRIPTION="IEEE 802.11 wireless LAN sniffer"
|
| ... | ... | |
| 40 |
32 |
|
| 41 |
33 |
LICENSE="GPL-2"
|
| 42 |
34 |
SLOT="0/${PV}"
|
| 43 |
|
IUSE="libusb lm-sensors networkmanager +pcre rtlsdr selinux +suid ubertooth udev"
|
|
35 |
IUSE="libusb lm-sensors mqtt networkmanager +pcre protobuf rtlsdr selinux +suid ubertooth udev +wext"
|
| 44 |
36 |
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
| 45 |
37 |
|
| 46 |
38 |
# upstream said protobuf-26.1 breaks everything
|
| 47 |
|
# details are unclear at this time but adding restriction for safety
|
|
39 |
# 2026.10.1 should be the last release with protobuf support
|
| 48 |
40 |
CDEPEND="
|
| 49 |
41 |
${PYTHON_DEPS}
|
|
42 |
app-arch/xz-utils
|
|
43 |
app-arch/zstd
|
|
44 |
mqtt? ( app-misc/mosquitto )
|
| 50 |
45 |
networkmanager? ( net-misc/networkmanager )
|
| 51 |
46 |
dev-libs/glib:2
|
| 52 |
47 |
dev-libs/elfutils
|
| 53 |
48 |
dev-libs/openssl:=
|
| 54 |
49 |
virtual/zlib:=
|
| 55 |
50 |
dev-db/sqlite:3
|
| 56 |
|
net-libs/libwebsockets:=[client,lejp]
|
|
51 |
>=net-libs/libwebsockets-4.5.8-r1:=[client,lejp]
|
| 57 |
52 |
kernel_linux? ( sys-libs/libcap
|
| 58 |
53 |
dev-libs/libnl:3
|
| 59 |
54 |
net-libs/libpcap
|
| 60 |
55 |
)
|
| 61 |
56 |
libusb? ( virtual/libusb:1 )
|
| 62 |
|
dev-libs/protobuf-c:=
|
| 63 |
|
<dev-libs/protobuf-26:=
|
|
57 |
protobuf? ( dev-libs/protobuf-c:=
|
|
58 |
<dev-libs/protobuf-26:= )
|
| 64 |
59 |
$(python_gen_cond_dep '
|
| 65 |
|
dev-python/protobuf[${PYTHON_USEDEP}]
|
|
60 |
protobuf? ( dev-python/protobuf[${PYTHON_USEDEP}] )
|
| 66 |
61 |
dev-python/websockets[${PYTHON_USEDEP}]
|
| 67 |
62 |
')
|
| 68 |
63 |
lm-sensors? ( sys-apps/lm-sensors:= )
|
| 69 |
64 |
pcre? ( dev-libs/libpcre2:= )
|
|
65 |
rtlsdr? ( net-wireless/rtl-sdr:= )
|
| 70 |
66 |
suid? ( sys-libs/libcap )
|
| 71 |
|
ubertooth? ( net-wireless/ubertooth )
|
|
67 |
ubertooth? ( net-libs/libbtbb
|
|
68 |
net-wireless/ubertooth )
|
| 72 |
69 |
"
|
| 73 |
70 |
RDEPEND="${CDEPEND}
|
| 74 |
71 |
acct-user/kismet
|
| ... | ... | |
| 80 |
77 |
$(python_gen_cond_dep '
|
| 81 |
78 |
dev-python/numpy[${PYTHON_USEDEP}]
|
| 82 |
79 |
')
|
| 83 |
|
net-wireless/rtl-sdr:=
|
|
80 |
net-wireless/rtl_433
|
| 84 |
81 |
)
|
| 85 |
82 |
selinux? ( sec-policy/selinux-kismet )
|
| 86 |
83 |
"
|
| 87 |
84 |
DEPEND="${CDEPEND}
|
| 88 |
85 |
dev-libs/boost
|
| 89 |
|
=dev-libs/libfmt-9*
|
|
86 |
dev-libs/libfmt
|
| 90 |
87 |
sys-libs/libcap
|
| 91 |
88 |
"
|
| 92 |
89 |
BDEPEND="virtual/pkgconfig"
|
| 93 |
90 |
|
| 94 |
|
src_prepare() {
|
| 95 |
|
#sed -i -e "s:^\(logtemplate\)=\(.*\):\1=/tmp/\2:" \
|
| 96 |
|
# conf/kismet_logging.conf || die
|
| 97 |
|
|
| 98 |
|
#this was added to quiet macosx builds but it makes gcc builds noisier
|
| 99 |
|
sed -i -e 's#-Wno-unknown-warning-option ##g' Makefile.inc.in || die
|
| 100 |
|
|
| 101 |
|
#sed -i -e 's#root#kismet#g' packaging/systemd/kismet.service.in
|
|
91 |
QA_PREBUILT="
|
|
92 |
usr/share/kismet/firmware/morse/bcf_mm_hl2_ext.bin
|
|
93 |
usr/share/kismet/firmware/morse/bcf_mm_hl1_4v3.bin
|
|
94 |
usr/share/kismet/firmware/morse/bcf_mm_hl1.bin
|
|
95 |
usr/share/kismet/firmware/morse/bcf_mm8108_m20_us.bin
|
|
96 |
usr/share/kismet/firmware/morse/bcf_mf28551.bin
|
|
97 |
usr/share/kismet/firmware/morse/bcf_mf15457.bin
|
|
98 |
usr/share/kismet/firmware/morse/bcf_mf08651_us.bin
|
|
99 |
usr/share/kismet/firmware/morse/bcf_mf08651_jp.bin
|
|
100 |
usr/share/kismet/firmware/morse/bcf_mf08651_4v3_us.bin
|
|
101 |
usr/share/kismet/firmware/morse/bcf_aw_hm677.bin
|
|
102 |
usr/share/kismet/firmware/morse/bcf_aw_hm593_4v3.bin
|
|
103 |
usr/share/kismet/firmware/morse/bcf_aw_hm593.bin
|
|
104 |
usr/share/kismet/firmware/morse/mm8108b2-rl.bin
|
|
105 |
"
|
| 102 |
106 |
|
|
107 |
src_prepare() {
|
| 103 |
108 |
rm -r boost || die
|
| 104 |
109 |
rm -r fmt || die
|
| 105 |
110 |
|
| 106 |
|
#dev-libs/jsoncpp
|
| 107 |
|
#rm -r json || die
|
| 108 |
|
#sed -i 's#"json/json.h"#<json/json.h>#' jsoncpp.cc kis_net_beast_httpd.h \
|
| 109 |
|
# log_tools/kismetdb_clean.cc log_tools/kismetdb_dump_devices.cc \
|
| 110 |
|
# log_tools/kismetdb_statistics.cc log_tools/kismetdb_to_gpx.cc \
|
| 111 |
|
# log_tools/kismetdb_to_kml.cc log_tools/kismetdb_to_pcap.cc \
|
| 112 |
|
# log_tools/kismetdb_to_wiglecsv.cc trackedcomponent.h \
|
| 113 |
|
# trackedelement.h trackedelement_workers.h
|
| 114 |
|
|
| 115 |
111 |
default
|
| 116 |
112 |
|
| 117 |
|
eautoreconf
|
|
113 |
if [ "${PV}" = "9999" ]; then
|
|
114 |
sed -i -e 's#-Wno-dangling-reference##g' configure.ac || die
|
|
115 |
eautoreconf
|
|
116 |
fi
|
| 118 |
117 |
}
|
| 119 |
118 |
|
| 120 |
119 |
src_configure() {
|
| 121 |
|
# -Werror=strict-aliasing
|
| 122 |
|
# https://bugs.gentoo.org/877761
|
| 123 |
|
# https://github.com/kismetwireless/kismet/issues/518
|
| 124 |
|
#
|
| 125 |
|
# Do not trust with LTO either.
|
| 126 |
|
append-flags -fno-strict-aliasing
|
| 127 |
|
filter-lto
|
| 128 |
|
|
| 129 |
120 |
econf \
|
| 130 |
121 |
$(use_enable libusb libusb) \
|
|
122 |
$(use_enable libusb mm8108) \
|
|
123 |
$(use_enable libusb usbwifi) \
|
| 131 |
124 |
$(use_enable libusb wifi-coconut) \
|
|
125 |
$(use_enable mqtt mosquitto) \
|
| 132 |
126 |
$(use_enable pcre) \
|
| 133 |
127 |
$(use_enable pcre require-pcre2) \
|
| 134 |
128 |
$(use_enable lm-sensors lmsensors) \
|
| 135 |
129 |
$(use_enable networkmanager libnm) \
|
|
130 |
$(use_enable protobuf) \
|
|
131 |
$(use_enable rtlsdr librtlsdr) \
|
| 136 |
132 |
$(use_enable ubertooth) \
|
|
133 |
$(use_enable wext linuxwext) \
|
| 137 |
134 |
--sysconfdir=/etc/kismet \
|
| 138 |
135 |
--disable-optimization
|
| 139 |
136 |
}
|
| ... | ... | |
| 194 |
191 |
}
|
| 195 |
192 |
|
| 196 |
193 |
pkg_postinst() {
|
| 197 |
|
if ver_replacing -lt 2019.07.2 || ver_replacing -eq 9999 ; then
|
|
194 |
if ver_replacing -lt 2019.07.2 || ver_replacing -eq 9999; then
|
| 198 |
195 |
migrate_config
|
| 199 |
196 |
fi
|
| 200 |
197 |
udev_reload
|