kismet: drop in favor of gentoo

This commit is contained in:
Rick Farina (Zero_Chaos) 2025-09-10 10:37:42 -04:00
parent 59aa430d35
commit de0298c3e2
No known key found for this signature in database
GPG key ID: A29433C0AA431DDC
10 changed files with 0 additions and 707 deletions

View file

@ -1 +0,0 @@
DIST kismet-20250512.gh.tar.gz 13341796 BLAKE2B 302f765f8a2da4a9d278678de660a70c84d5385a0187d8915adb293ce668d2e3d488d74588395c7cbabcfe65fe9926c17b8f2877e982b1ddfb9989c32d1cff7e SHA512 5d936d53e8d806220789ade9179bd7ccedfaaaebd7ee30873b7a737312bc138a1cc41829e537fa61892449e205de9c5ea60d620c46a2f02347d8a1e035cd14a7

View file

@ -1,280 +0,0 @@
From d3732f93cbdc9edf39d31c7c50b72cc6a79be0dc Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz93@gmail.com>
Date: Fri, 5 Apr 2024 00:42:29 -0400
Subject: [PATCH] configure.ac: bashism: fix critical existence failure on
systems with dash
Remove the consistent use of bashisms. An autoconf generated script is
designed to work with POSIX sh, and contains a /bin/sh shebang. As a
result, it *cannot* assume it will be run with bash, as it won't be.
The bashism in question is the double equals (`==`) operator for the
test command. It is actually a bash-specific alias for the single equals
operator. It behaves exactly the same, except more confusing. It
contains no added functionality and no behavior changes, it is merely an
additional alternate spelling. In exchange for doing nothing whatsoever,
even in bash, it breaks muscle memory when writing POSIX sh scripts and
tricks developers into writing the wrong thing.
It is terrible and should never be used under any circumstances.
Ideally it would be removed altogether from GNU bash.
Fixes the following warnings when running configure:
```
./configure: 5011: test: x: unexpected operator
./configure: 5014: test: x: unexpected operator
./configure: 5017: test: x: unexpected operator
./configure: 8056: test: nox: unexpected operator
./configure: 8109: test: yesx: unexpected operator
./configure: 8120: test: 3: unexpected operator
./configure: 8144: test: unexpected operator
./configure: 9089: test: stdc++x: unexpected operator
./configure: 9937: test: 0: unexpected operator
./configure: 10084: test: 0: unexpected operator
./configure: 10207: test: 0: unexpected operator
./configure: 10283: test: 0: unexpected operator
./configure: 11363: test: x: unexpected operator
./configure: 11561: test: x: unexpected operator
./configure: 11634: test: xno: unexpected operator
./configure: 11663: test: xno: unexpected operator
./configure: 12490: test: 3: unexpected operator
./configure: 13150: test: no: unexpected operator
./configure: 13167: test: no: unexpected operator
```
And the following fatal errors when trying to compile, since the
resulting conditionals failed to define $(PROTOCBIN):
```
make -j8
cpp_out=./protobuf_cpp/ -I protobuf_definitions/ protobuf_definitions/kismet.proto
cpp_out=./protobuf_cpp/ -I protobuf_definitions/ protobuf_definitions/http.proto
/bin/sh: 1: -I: not found
make: [Makefile:808: protobuf_cpp/kismet.pb.h] Error 127 (ignored)
cpp_out=./protobuf_cpp/ -I protobuf_definitions/ protobuf_definitions/datasource.proto
cpp_out=./protobuf_cpp/ -I protobuf_definitions/ protobuf_definitions/linuxbluetooth.proto
/bin/sh: 1: -I: not found
make: [Makefile:808: protobuf_cpp/http.pb.h] Error 127 (ignored)
cpp_out=./protobuf_cpp/ -I protobuf_definitions/ protobuf_definitions/eventbus.proto
/bin/sh: 1: -I: not found
make: [Makefile:808: protobuf_cpp/linuxbluetooth.pb.h] Error 127 (ignored)
cpp_out=./protobuf_cpp/ -I protobuf_definitions/ protobuf_definitions/kismet.proto
/bin/sh: 1: -I: not found
cpp_out=./protobuf_cpp/ -I protobuf_definitions/ protobuf_definitions/http.proto
/bin/sh: 1: -I: not found
/bin/sh: 1: -I: not found
make: [Makefile:808: protobuf_cpp/datasource.pb.h] Error 127 (ignored)
make: [Makefile:808: protobuf_cpp/eventbus.pb.h] Error 127 (ignored)
make: [Makefile:806: protobuf_cpp/kismet.pb.cc] Error 127 (ignored)
cpp_out=./protobuf_cpp/ -I protobuf_definitions/ protobuf_definitions/datasource.proto
cpp_out=./protobuf_cpp/ -I protobuf_definitions/ protobuf_definitions/linuxbluetooth.proto
cpp_out=./protobuf_cpp/ -I protobuf_definitions/ protobuf_definitions/eventbus.proto
/bin/sh: 1: -I: not found
```
For extra interest, the failing command begins with `--flag` i.e. a flag
passed to protoc, which Make then interprets as "ignore errors for this
command", which means output files are not created but the build then
continues and produces significantly more confusing errors such as:
```
kis_external.h:51:10: fatal error: protobuf_cpp/kismet.pb.h: No such file or directory
```
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
configure.ac | 46 +++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/configure.ac b/configure.ac
index a967e3418..d3c961821 100644
--- a/configure.ac
+++ b/configure.ac
@@ -179,13 +179,13 @@ else
GCC_MINOR=$(echo $GCC_VERSION | cut -s -d'.' -f2)
GCC_PATCH=$(echo $GCC_VERSION | cut -s -d'.' -f3)
- if test "$GCC_MAJOR"x == x; then
+ if test "$GCC_MAJOR"x = x; then
GCC_MAJOR=$GCC_VERSION
fi
- if test "$GCC_MINOR"x == x; then
+ if test "$GCC_MINOR"x = x; then
GCC_MINOR=0
fi
- if test "$GCC_PATCH"x == x; then
+ if test "$GCC_PATCH"x = x; then
GCC_PATCH=0
fi
@@ -318,7 +318,7 @@ AC_ARG_ENABLE([element-typesafety],
esac],
[want_te_typesafety=no]
)
-if test "$want_te_typesafety"x == "yes"x; then
+if test "$want_te_typesafety"x = "yes"x; then
AC_DEFINE(TE_TYPE_SAFETY, 1, Enforce runtime type safety)
else
AC_DEFINE(TE_TYPE_SAFETY, 0, Do not enforce runtime type safety)
@@ -357,7 +357,7 @@ AS_IF([test "x$with_python_interpreter" != "x"],
[]
)
-if test "$want_python"x == "no"x; then
+if test "$want_python"x = "no"x; then
BUILD_PYTHON_MODULES=0
BUILD_CAPTURE_SDR_RTL433=0
BUILD_CAPTURE_SDR_RTLAMR=0
@@ -367,11 +367,11 @@ if test "$want_python"x == "no"x; then
BUILD_CAPTURE_PROXY_ADSB=0
AC_MSG_WARN([Disabling Python and Python-related tools])
else
- if test "$PYTHON_VERSION" == 3; then
+ if test "$PYTHON_VERSION" = 3; then
AC_PYTHON3_MODULE(setuptools)
fi
- if test "$HAVE_PYMOD_SETUPTOOLS" == "no"; then
+ if test "$HAVE_PYMOD_SETUPTOOLS" = "no"; then
AC_MSG_ERROR([Missing python setuptools, if you would like to build without python entirely, use --disable-python-tools, otherwise install python setuptools for your python version])
else
DATASOURCE_BINS="$DATASOURCE_BINS \$(CAPTURE_SDR_RTL433) \$(CAPTURE_SDR_RTLAMR) \$(CAPTURE_SDR_RTLADSB) \$(CAPTURE_FREAKLABS_ZIGBEE)"
@@ -675,7 +675,7 @@ CC="$CXX"
AC_CHECK_LIB([stdc++], [main],
foundcxxl="stdc++" CXXLIBS="$CXXLIBS -lstdc++")
-if test "$foundcxxl"x == "x" -a "$caponly" != 1; then
+if test "$foundcxxl"x = "x" -a "$caponly" != 1; then
AC_MSG_ERROR(No standard stdc++ libraries found.)
fi
CC="$oCC"
@@ -939,7 +939,7 @@ if test "${wantpcre}x" = "nox" -a "${needpcre2}x" = "yesx"; then
AC_MSG_ERROR([Can not combine --disable-pcre and --enable-require-pcre2])
fi
-if test "$caponly" == 0; then
+if test "$caponly" = 0; then
if test "$HAVE_CXX17" = "1"; then
AC_MSG_CHECKING([Checking C++17 parallel functions])
@@ -1017,7 +1017,7 @@ if test "$caponly" == 0; then
fi
# Dont' check pcre if we're only building datasources
-if test "$caponly" == 0; then
+if test "$caponly" = 0; then
if test "$wantpcre" = "yes"; then
# Check for pcre2 first
@@ -1046,22 +1046,22 @@ if test "$caponly" == 0; then
LIBS="$OLIBS"
if test "$pcre2" != "yes"; then
- if test "${needpcre2}x" == "yesx"; then
+ if test "${needpcre2}x" = "yesx"; then
AC_MSG_ERROR([Could not find libpcre2 and --enable-require-pcre2 selected])
fi
AC_CHECK_LIB([pcre], [pcre_compile], pcre1=yes, pcre1=no)
- if test "$pcre1" == "yes"; then
+ if test "$pcre1" = "yes"; then
AC_CHECK_HEADER([pcre.h], pcre1=yes, pcre1=no)
fi
fi
- if test "$pcre2" == "yes"; then
+ if test "$pcre2" = "yes"; then
AC_DEFINE(HAVE_LIBPCRE2, 1, libpcre2 regex support)
LIBS="$LIBS -lpcre2-8"
- elif test "$pcre1" == "yes"; then
+ elif test "$pcre1" = "yes"; then
AC_DEFINE(HAVE_LIBPCRE, 1, libpcre1 regex support)
LIBS="$LIBS -lpcre"
else
@@ -1071,7 +1071,7 @@ if test "$caponly" == 0; then
fi
# Don't check for sqlite3 if we're only building datasources
-if test "$caponly" == 0; then
+if test "$caponly" = 0; then
# Check for sqlite3
sql3l=no
AC_CHECK_LIB([sqlite3], [sqlite3_libversion], sql3l=yes, sql3l=no)
@@ -1098,7 +1098,7 @@ if test "$caponly" == 0; then
fi # caponly
# don't check for openssl if we're only building datasources
-if test "$caponly" == 0; then
+if test "$caponly" = 0; then
AX_CHECK_OPENSSL(AC_DEFINE(HAVE_OPENSSL, 1, openssl library present),
AC_MSG_ERROR(Failed to find OpenSSL library))
fi # caponly
@@ -1212,7 +1212,7 @@ if test "$caponly" = 0 || test "$want_python" = "yes"; then
[ --with-protoc[=PATH] Custom location of the protoc protobuf compiler],
[ ])
- if test x"$with_protoc" == "x"; then
+ if test x"$with_protoc" = "x"; then
PROTOCBIN=protoc
AC_CHECK_PROG(protoc, [protoc], yes)
if test x"$protoc" != x"yes"; then
@@ -1254,7 +1254,7 @@ AC_ARG_WITH(protocc,
[ --with-protocc[=PATH] Custom location of the protoc protobuf compiler],
[ PROTOCCBIN=$withval ]
)
-if test x"$with_protocc" == "x"; then
+if test x"$with_protocc" = "x"; then
PROTOCCBIN="protoc-c"
AC_CHECK_PROG(protocc, [protoc-c], yes)
if test x"$protocc" != x"yes"; then
@@ -1282,7 +1282,7 @@ AC_ARG_ENABLE(btgeiger,
[want_btgeiger=no]
)
-AS_IF([test "x$want_btgeiger" == "xyes"], [
+AS_IF([test "x$want_btgeiger" = "xyes"], [
AS_IF([test "x$want_python" != "xyes"], [
AC_MSG_ERROR([Can not enable btgeiger without enabling python])
])
@@ -1301,7 +1301,7 @@ AC_ARG_ENABLE(bladerf,
[want_bladerf=no]
)
-AS_IF([test "x$want_bladerf" == "xyes"], [
+AS_IF([test "x$want_bladerf" = "xyes"], [
PKG_CHECK_MODULES([libbladeRF], [libbladeRF],
[
],
@@ -1529,7 +1529,7 @@ if test "$havenetlink" = "yes"; then
fi
if test "$nlname" != ""; then
- if test "$picked_nl" == "tiny"; then
+ if test "$picked_nl" = "tiny"; then
NLLIBS="-lnl-tiny"
else
NLLIBS=`pkg-config --libs $nlname`
@@ -1837,7 +1837,7 @@ AC_ARG_ENABLE(asan,
esac],
[want_asan=no]
)
-if test "$want_asan" == "yes"; then
+if test "$want_asan" = "yes"; then
CPPFLAGS="$CPPFLAGS -fsanitize=address -fno-omit-frame-pointer"
LDFLAGS="$LDFLAGS -fsanitize=address"
fi
@@ -1850,7 +1850,7 @@ AC_ARG_ENABLE(tsan,
esac],
[want_tsan=no]
)
-if test "$want_tsan" == "yes"; then
+if test "$want_tsan" = "yes"; then
CPPFLAGS="$CPPFLAGS -fsanitize=thread -fno-omit-frame-pointer"
LDFLAGS="$LDFLAGS -fsanitize=thread"
fi
--
2.43.2

View file

@ -1,14 +0,0 @@
set pagination off
handle SIGPIPE nostop noprint pass
handle SIGINT nostop noprint pass
set logging file kismet-gdb.txt
set logging on
run --debug --no-ncurses
catch throw
bt
info threads
thread apply all bt full
quit
end

View file

@ -1,147 +0,0 @@
From 8264835a935de9c754c0ff28c632695103b2dc2f Mon Sep 17 00:00:00 2001
From: Mike Kershaw / Dragorn <dragorn@kismetwireless.net>
Date: Fri, 6 Jan 2023 15:22:52 -0500
Subject: [PATCH] python: Merge patch from Rick Farina / Zero_Chaos to make
gentoo not complain about python build parameters
---
capture_bt_geiger/Makefile.in | 4 +++-
capture_freaklabs_zigbee/Makefile.in | 4 +++-
capture_proxy_adsb/Makefile.in | 4 +++-
capture_sdr_rtl433/Makefile.in | 4 +++-
capture_sdr_rtladsb/Makefile.in | 4 +++-
capture_sdr_rtlamr/Makefile.in | 4 +++-
6 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/capture_bt_geiger/Makefile.in b/capture_bt_geiger/Makefile.in
index 646069fed..4f644535b 100644
--- a/capture_bt_geiger/Makefile.in
+++ b/capture_bt_geiger/Makefile.in
@@ -2,6 +2,8 @@ KIS_SRC_DIR ?= ..
include $(KIS_SRC_DIR)/Makefile.inc
+DESTDIR ?= /
+
DATASOURCE_NAME := $(shell $(PYTHON) setup.py --name)
PROTOBUF_DIR = $(KIS_SRC_DIR)/protobuf_definitions
@@ -19,7 +21,7 @@ $(DATASOURCE_NAME)/kismetexternal/%_pb2.py: $(PROTOBUF_DIR)/%.proto
sed -i -E 's/^import kismet_/from . import kismet_/' $@
install:
- $(PYTHON) setup.py install --root="/$(DESTDIR)" --prefix="$(prefix)"
+ $(PYTHON) setup.py install --root="$(DESTDIR)" --prefix="$(prefix)"
clean:
@-$(PYTHON) setup.py clean
diff --git a/capture_freaklabs_zigbee/Makefile.in b/capture_freaklabs_zigbee/Makefile.in
index 646069fed..4f644535b 100644
--- a/capture_freaklabs_zigbee/Makefile.in
+++ b/capture_freaklabs_zigbee/Makefile.in
@@ -2,6 +2,8 @@ KIS_SRC_DIR ?= ..
include $(KIS_SRC_DIR)/Makefile.inc
+DESTDIR ?= /
+
DATASOURCE_NAME := $(shell $(PYTHON) setup.py --name)
PROTOBUF_DIR = $(KIS_SRC_DIR)/protobuf_definitions
@@ -19,7 +21,7 @@ $(DATASOURCE_NAME)/kismetexternal/%_pb2.py: $(PROTOBUF_DIR)/%.proto
sed -i -E 's/^import kismet_/from . import kismet_/' $@
install:
- $(PYTHON) setup.py install --root="/$(DESTDIR)" --prefix="$(prefix)"
+ $(PYTHON) setup.py install --root="$(DESTDIR)" --prefix="$(prefix)"
clean:
@-$(PYTHON) setup.py clean
diff --git a/capture_proxy_adsb/Makefile.in b/capture_proxy_adsb/Makefile.in
index d16ba601f..96ba6ceca 100644
--- a/capture_proxy_adsb/Makefile.in
+++ b/capture_proxy_adsb/Makefile.in
@@ -2,6 +2,8 @@ KIS_SRC_DIR ?= ..
include $(KIS_SRC_DIR)/Makefile.inc
+DESTDIR ?= /
+
DATASOURCE_NAME := $(shell $(PYTHON) setup.py --name)
PROTOBUF_DIR = $(KIS_SRC_DIR)/protobuf_definitions
@@ -22,7 +24,7 @@ $(DATASOURCE_NAME)/kismetexternal/%_pb2.py: $(PROTOBUF_DIR)/%.proto
sed -i -E 's/^import kismet_/from . import kismet_/' $@
install:
- $(PYTHON) setup.py install --root="/$(DESTDIR)" --prefix="$(prefix)"
+ $(PYTHON) setup.py install --root="$(DESTDIR)" --prefix="$(prefix)"
clean:
@-$(PYTHON) setup.py clean
diff --git a/capture_sdr_rtl433/Makefile.in b/capture_sdr_rtl433/Makefile.in
index 646069fed..4f644535b 100644
--- a/capture_sdr_rtl433/Makefile.in
+++ b/capture_sdr_rtl433/Makefile.in
@@ -2,6 +2,8 @@ KIS_SRC_DIR ?= ..
include $(KIS_SRC_DIR)/Makefile.inc
+DESTDIR ?= /
+
DATASOURCE_NAME := $(shell $(PYTHON) setup.py --name)
PROTOBUF_DIR = $(KIS_SRC_DIR)/protobuf_definitions
@@ -19,7 +21,7 @@ $(DATASOURCE_NAME)/kismetexternal/%_pb2.py: $(PROTOBUF_DIR)/%.proto
sed -i -E 's/^import kismet_/from . import kismet_/' $@
install:
- $(PYTHON) setup.py install --root="/$(DESTDIR)" --prefix="$(prefix)"
+ $(PYTHON) setup.py install --root="$(DESTDIR)" --prefix="$(prefix)"
clean:
@-$(PYTHON) setup.py clean
diff --git a/capture_sdr_rtladsb/Makefile.in b/capture_sdr_rtladsb/Makefile.in
index d16ba601f..96ba6ceca 100644
--- a/capture_sdr_rtladsb/Makefile.in
+++ b/capture_sdr_rtladsb/Makefile.in
@@ -2,6 +2,8 @@ KIS_SRC_DIR ?= ..
include $(KIS_SRC_DIR)/Makefile.inc
+DESTDIR ?= /
+
DATASOURCE_NAME := $(shell $(PYTHON) setup.py --name)
PROTOBUF_DIR = $(KIS_SRC_DIR)/protobuf_definitions
@@ -22,7 +24,7 @@ $(DATASOURCE_NAME)/kismetexternal/%_pb2.py: $(PROTOBUF_DIR)/%.proto
sed -i -E 's/^import kismet_/from . import kismet_/' $@
install:
- $(PYTHON) setup.py install --root="/$(DESTDIR)" --prefix="$(prefix)"
+ $(PYTHON) setup.py install --root="$(DESTDIR)" --prefix="$(prefix)"
clean:
@-$(PYTHON) setup.py clean
diff --git a/capture_sdr_rtlamr/Makefile.in b/capture_sdr_rtlamr/Makefile.in
index 646069fed..4f644535b 100644
--- a/capture_sdr_rtlamr/Makefile.in
+++ b/capture_sdr_rtlamr/Makefile.in
@@ -2,6 +2,8 @@ KIS_SRC_DIR ?= ..
include $(KIS_SRC_DIR)/Makefile.inc
+DESTDIR ?= /
+
DATASOURCE_NAME := $(shell $(PYTHON) setup.py --name)
PROTOBUF_DIR = $(KIS_SRC_DIR)/protobuf_definitions
@@ -19,7 +21,7 @@ $(DATASOURCE_NAME)/kismetexternal/%_pb2.py: $(PROTOBUF_DIR)/%.proto
sed -i -E 's/^import kismet_/from . import kismet_/' $@
install:
- $(PYTHON) setup.py install --root="/$(DESTDIR)" --prefix="$(prefix)"
+ $(PYTHON) setup.py install --root="$(DESTDIR)" --prefix="$(prefix)"
clean:
@-$(PYTHON) setup.py clean

View file

@ -1,2 +0,0 @@
#!/bin/sh
gdb kismet --command=/usr/share/kismet/gdb

View file

@ -1,11 +0,0 @@
# /etc/conf.d/kismet - configuration file for /etc/init.d/kismet
# Kismet configuration is done in /etc/kismet/kismet_site.conf
# To use the kismet init script, you must have "logtemplate" set to a location
# e.g.
# log_template=%h/kismet_log/%n-%d-%i.%l
# Options to pass to kismet_server, see `kismet --help`
# --no-ncurses is passed unconditionally
KISMET_SERVER_OPTIONS=""

View file

@ -1,11 +0,0 @@
#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
name="kismet"
command="/usr/bin/kismet"
command_args="--no-ncurses ${KISMET_SERVER_OPTIONS}"
supervisor="supervise-daemon"
output_log="/var/log/kismet.log"
error_log="${output_log}"
pidfile="/run/kismet.pid"

View file

@ -1 +0,0 @@
kismet-9999.ebuild

View file

@ -1,211 +0,0 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} )
inherit autotools eapi9-ver python-single-r1 udev systemd
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="https://www.kismetwireless.net/git/${PN}.git"
inherit git-r3
RESTRICT="strip"
elif [[ ${PV} =~ ^[0-9]{8}$ ]] ; then
HASH_COMMIT="85b84a24289c69a8742ae803f762fa0f6b366eeb"
SRC_URI="https://github.com/kismetwireless/kismet/archive/${HASH_COMMIT}.tar.gz -> ${P}.gh.tar.gz"
S="${WORKDIR}/${PN}-${HASH_COMMIT}"
# RESTRICT="strip"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
else
MY_P=${P/\./-}
MY_P=${MY_P/_beta/-BETA}
MY_P=${MY_P/./-R}
SRC_URI="https://www.kismetwireless.net/code/${MY_P}.tar.xz"
S=${WORKDIR}/${MY_P/BETA/beta}
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
fi
DESCRIPTION="IEEE 802.11 wireless LAN sniffer"
HOMEPAGE="https://www.kismetwireless.net"
LICENSE="GPL-2"
SLOT="0/${PV}"
IUSE="libusb lm-sensors mqtt networkmanager +pcre protobuf rtlsdr selinux +suid ubertooth udev +wext"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
# upstream said protobuf-26.1 breaks everything
# details are unclear at this time but adding restriction for safety
CDEPEND="
${PYTHON_DEPS}
mqtt? ( app-misc/mosquitto )
networkmanager? ( net-misc/networkmanager )
dev-libs/glib:2
dev-libs/elfutils
dev-libs/openssl:=
sys-libs/zlib:=
dev-db/sqlite:3
net-libs/libwebsockets:=[client,lejp]
kernel_linux? ( sys-libs/libcap
dev-libs/libnl:3
net-libs/libpcap
)
libusb? ( virtual/libusb:1 )
protobuf? ( dev-libs/protobuf-c:=
<dev-libs/protobuf-29:= )
$(python_gen_cond_dep '
protobuf? ( dev-python/protobuf[${PYTHON_USEDEP}] )
dev-python/websockets[${PYTHON_USEDEP}]
')
lm-sensors? ( sys-apps/lm-sensors:= )
pcre? ( dev-libs/libpcre2:= )
suid? ( sys-libs/libcap )
ubertooth? ( net-wireless/ubertooth )
"
RDEPEND="${CDEPEND}
acct-user/kismet
acct-group/kismet
$(python_gen_cond_dep '
dev-python/pyserial[${PYTHON_USEDEP}]
')
rtlsdr? (
$(python_gen_cond_dep '
dev-python/numpy[${PYTHON_USEDEP}]
')
net-wireless/rtl-sdr:=
)
selinux? ( sec-policy/selinux-kismet )
"
DEPEND="${CDEPEND}
dev-libs/boost
dev-libs/libfmt
sys-libs/libcap
"
BDEPEND="virtual/pkgconfig"
src_prepare() {
#sed -i -e "s:^\(logtemplate\)=\(.*\):\1=/tmp/\2:" \
# conf/kismet_logging.conf || die
#sed -i -e 's#root#kismet#g' packaging/systemd/kismet.service.in
rm -r boost || die
rm -r fmt || die
# bundles mpack but I failed to successfully unbundle
# rm -r mpack || die
#dev-libs/jsoncpp
#rm -r json || die
#sed -i 's#"json/json.h"#<json/json.h>#' jsoncpp.cc kis_net_beast_httpd.h \
# log_tools/kismetdb_clean.cc log_tools/kismetdb_dump_devices.cc \
# log_tools/kismetdb_statistics.cc log_tools/kismetdb_to_gpx.cc \
# log_tools/kismetdb_to_kml.cc log_tools/kismetdb_to_pcap.cc \
# log_tools/kismetdb_to_wiglecsv.cc trackedcomponent.h \
# trackedelement.h trackedelement_workers.h
default
if [ "${PV}" = "9999" ]; then
sed -i -e 's#-Wno-dangling-reference##g' configure.ac || die
eautoreconf
# Untested by should fix same in non-live
#else
# sed -i -e 's#-Wno-unknown-warning-option ##g' configure || die
fi
#this was added to quiet macosx builds but it makes gcc builds noisier
sed -i -e 's#-Wno-unknown-warning-option ##g' Makefile.inc.in || die
}
src_configure() {
econf \
$(use_enable libusb libusb) \
$(use_enable libusb wifi-coconut) \
$(use_enable mqtt mosquitto) \
$(use_enable pcre) \
$(use_enable pcre require-pcre2) \
$(use_enable lm-sensors lmsensors) \
$(use_enable networkmanager libnm) \
$(use_enable protobuf) \
$(use_enable ubertooth) \
$(use_enable wext linuxwext) \
$(use_enable rtlsdr librtlsdr) \
--sysconfdir=/etc/kismet \
--disable-optimization
}
src_install() {
emake DESTDIR="${D}" commoninstall
python_optimize
emake DESTDIR="${D}" forceconfigs
use udev && udev_dorules packaging/udev/*.rules
insinto /usr/share/${PN}
doins Makefile.inc
if [ "${PV}" = "9999" ];then
doins "${FILESDIR}"/gdb
dobin "${FILESDIR}"/kismet-gdb
fi
dodoc README*
newinitd "${FILESDIR}"/${PN}.initd-r3 kismet
newconfd "${FILESDIR}"/${PN}.confd-r2 kismet
systemd_dounit packaging/systemd/kismet.service
}
pkg_preinst() {
if use suid; then
fowners root:kismet /usr/bin/kismet_cap_linux_bluetooth
fowners root:kismet /usr/bin/kismet_cap_linux_wifi
fowners root:kismet /usr/bin/kismet_cap_pcapfile
# Need to set the permissions after chowning.
# See chown(2)
fperms 4550 /usr/bin/kismet_cap_linux_bluetooth
fperms 4550 /usr/bin/kismet_cap_linux_wifi
fperms 4550 /usr/bin/kismet_cap_pcapfile
elog "Kismet has been installed with a setuid-root helper binary"
elog "to enable minimal-root operation. Users need to be part of"
elog "the 'kismet' group to perform captures from physical devices."
fi
if ! use suid; then
ewarn "It is highly discouraged to run a sniffer as root,"
ewarn "Please consider enabling the suid use flag and adding"
ewarn "your user to the kismet group."
fi
}
migrate_config() {
einfo "Kismet Configuration files are now read from /etc/kismet/"
ewarn "Please keep user specific settings in /etc/kismet/kismet_site.conf"
if [ -n "$(ls "${EROOT}"/etc/kismet_*.conf 2> /dev/null)" ]; then
ewarn "Files at /etc/kismet_*.conf will not be read and should be removed"
fi
if [ -f "${EROOT}/etc/kismet_site.conf" ] && [ ! -f "${EROOT}/etc/kismet/kismet_site.conf" ]; then
mv /etc/kismet_site.conf /etc/kismet/kismet_site.conf || die "Failed to migrate kismet_site.conf to new location"
ewarn "Your /etc/kismet_site.conf file has been automatically moved to /etc/kismet/kismet_site.conf"
elif [ -f "${EROOT}/etc/kismet_site.conf" ] && [ -f "${EROOT}/etc/kismet/kismet_site.conf" ]; then
ewarn "Both /etc/kismet_site.conf and /etc/kismet/kismet_site.conf exist, please migrate needed bits"
ewarn "into /etc/kismet/kismet_site.conf and remove /etc/kismet_site.conf"
fi
}
pkg_postinst() {
if ver_replacing -lt 2019.07.2 || ver_replacing -eq 9999; then
migrate_config
fi
udev_reload
if use !wext; then
# duplicate configure.ac warning:
ewarn "Linux Wireless Extensions were disabled. Compiling without wext on a"
ewarn "Linux system is certainly possible, however nearly all of the packet"
ewarn "sources will be disabled (including capture sources for Cisco, Madwifi,"
ewarn "Orinoco, Prism, and just about every other live capture method). Make"
ewarn "sure this is what you want to do"
fi
}
pkg_postrm() {
udev_reload
}

View file

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>zerochaos@gentoo.org</email>
<name>Rick Farina</name>
</maintainer>
<use>
<flag name="libusb">Support libusb based capture sources such as mousejack, cc2540(ble), and nrf51822(ble)</flag>
<flag name="mqtt">Enable MQTT support</flag>
<flag name="pcre">Build with pcre support</flag>
<flag name="protobuf">Support old protobuf message passing in case of remote capture sources which are not up to date.</flag>
<flag name="rtlsdr">Enable rtlsdr based kismet capture sources</flag>
<flag name="suid">
Install a setuid root helper binary with limited functionality;
this allows running kismet as a normal user, significantly
reducing security risks
</flag>
<flag name="ubertooth">Enable capture source for ubertooth to sniff bluetooth low energy</flag>
<flag name="wext">
Enable building kismet with support for the deprecated Linux Wireless Extensions.
This is required for some out of tree and staging drivers, and kismet has not
been well tested with it disabled, so it defaults to on.
</flag>
</use>
<upstream>
<remote-id type="github">kismetwireless/kismet</remote-id>
</upstream>
</pkgmetadata>