Gentoo Archives: gentoo-commits

From: Rick Farina <zerochaos@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-wireless/kismet/
Date: Mon, 09 Mar 2020 20:00:27
Message-Id: 1583784001.11096c2ee914ca9226a404d4dd2631ef65c72391.zerochaos@gentoo
1 commit: 11096c2ee914ca9226a404d4dd2631ef65c72391
2 Author: Rick Farina <zerochaos <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 9 20:00:01 2020 +0000
4 Commit: Rick Farina <zerochaos <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 9 20:00:01 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11096c2e
7
8 net-wireless/kismet: bump
9
10 Package-Manager: Portage-2.3.93, Repoman-2.3.20
11 Signed-off-by: Rick Farina <zerochaos <AT> gentoo.org>
12
13 net-wireless/kismet/Manifest | 1 +
14 net-wireless/kismet/kismet-2020.03.1.ebuild | 175 ++++++++++++++++++++++++++++
15 2 files changed, 176 insertions(+)
16
17 diff --git a/net-wireless/kismet/Manifest b/net-wireless/kismet/Manifest
18 index c0260b51a57..9ec3e67b55f 100644
19 --- a/net-wireless/kismet/Manifest
20 +++ b/net-wireless/kismet/Manifest
21 @@ -1,3 +1,4 @@
22 DIST kismet-2016-07-R1.tar.xz 709364 BLAKE2B 5b667a02b517bd413d569f40df1f2a2e1158357c602fa807d712870543a7fade25077f449c07c023ad1d2150870352aa754484846d8c2a0d9f027113bb57c1fc SHA512 88891a0cd5ef94a4815d259e433f946f52552c125e05a5d8ac447d04e6090f2bd92f8bd8573440f0dfe446b29233bef81d9889e53170757ad0116ddfc2cb8416
23 DIST kismet-2019-09-R1.tar.xz 3034832 BLAKE2B 9f7818549e5260dc081ac39ea8323c70f2e4d0b959bc42dacc253c9d72bf72c2547f7c6d65d84ee7d0ca4a41068f5973028e48f6f9f3c5a7cd50c35246570814 SHA512 eeaf069718206f2b6d292c41792217afc9c72c10ffa014c8c670de64195bd28d44f33364dba7d338610f17a5af2be3c125ccd1297cce362159a4968c9ddabb88
24 DIST kismet-2019-12-R2.tar.xz 3127064 BLAKE2B b7ffac6a6a4d7d7893d3564f9471080e055798c325b102f98fa0e86db37bcbab33422afae9c2694b747ae0c369259b62c218a77c673d0e0c05969a56e42311c2 SHA512 b1e3de74a6d314150d849ac3d95c8b99324bba14522dc4f00244d1c09acb690cce40d35dbe33845ffb1060a69cd38f036d59a0283ed9b1a70b022e3d57cde5a0
25 +DIST kismet-2020-03-R1.tar.xz 3137312 BLAKE2B c20137677f598c0856e21e3c34b52b1edea1262cc0049638f31554a78780d37860200dae85ac65e35cda8425be6798fe98ac3de08e8dcbff33ea0b7b9fdb945f SHA512 a237d31ef953729571232693cc51029add808002dfcb350e6dbb0a5360f85b3c608e4d49273d4b377e91ba83feff198527a13930f1976b2182eee7e5185471a2
26
27 diff --git a/net-wireless/kismet/kismet-2020.03.1.ebuild b/net-wireless/kismet/kismet-2020.03.1.ebuild
28 new file mode 100644
29 index 00000000000..73b8a86810b
30 --- /dev/null
31 +++ b/net-wireless/kismet/kismet-2020.03.1.ebuild
32 @@ -0,0 +1,175 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +PYTHON_COMPAT=( python3_6 )
39 +
40 +inherit autotools eutils multilib user python-single-r1
41 +
42 +if [[ ${PV} == "9999" ]] ; then
43 + EGIT_REPO_URI="https://www.kismetwireless.net/git/${PN}.git"
44 + inherit git-r3
45 + RESTRICT="strip"
46 +else
47 + MY_P=${P/\./-}
48 + MY_P=${MY_P/_beta/-BETA}
49 + MY_P=${MY_P/./-R}
50 + S=${WORKDIR}/${MY_P/BETA/beta}
51 +
52 + #normally we want an official release
53 + SRC_URI="https://www.kismetwireless.net/code/${MY_P}.tar.xz"
54 +
55 + #but sometimes we want a git commit
56 + #COMMIT="6d6d486831c0f7ac712ffb8a3ff122c5063c3b2a"
57 + #SRC_URI="https://github.com/kismetwireless/kismet/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
58 + #S="${WORKDIR}/${PN}-${COMMIT}"
59 +
60 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
61 +fi
62 +
63 +DESCRIPTION="IEEE 802.11 wireless LAN sniffer"
64 +HOMEPAGE="https://www.kismetwireless.net"
65 +
66 +LICENSE="GPL-2"
67 +SLOT="0/${PV}"
68 +IUSE="libusb lm-sensors networkmanager +pcre rtlsdr selinux +suid ubertooth"
69 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
70 +
71 +CDEPEND="
72 + ${PYTHON_DEPS}
73 + networkmanager? ( net-misc/networkmanager:= )
74 + dev-libs/glib:=
75 + dev-libs/elfutils:=
76 + sys-libs/zlib:=
77 + dev-db/sqlite:=
78 + net-libs/libmicrohttpd
79 + kernel_linux? ( sys-libs/libcap
80 + dev-libs/libnl:3
81 + net-libs/libpcap
82 + )
83 + libusb? ( virtual/libusb:1 )
84 + dev-libs/protobuf-c:=
85 + dev-libs/protobuf:=
86 + $(python_gen_cond_dep '
87 + dev-python/protobuf-python[${PYTHON_MULTI_USEDEP}]
88 + ')
89 + sys-libs/ncurses:=
90 + lm-sensors? ( sys-apps/lm-sensors )
91 + pcre? ( dev-libs/libpcre )
92 + suid? ( sys-libs/libcap )
93 + ubertooth? ( net-wireless/ubertooth:= )
94 + "
95 +
96 +DEPEND="${CDEPEND}
97 + virtual/pkgconfig
98 +"
99 +
100 +RDEPEND="${CDEPEND}
101 + $(python_gen_cond_dep '
102 + dev-python/pyserial[${PYTHON_MULTI_USEDEP}]
103 + ')
104 + selinux? ( sec-policy/selinux-kismet )
105 +"
106 +PDEPEND="
107 + rtlsdr? (
108 + $(python_gen_cond_dep '
109 + dev-python/numpy[${PYTHON_MULTI_USEDEP}]
110 + ')
111 + net-wireless/rtl-sdr
112 + )"
113 +
114 +src_prepare() {
115 + sed -i -e "s:^\(logtemplate\)=\(.*\):\1=/tmp/\2:" \
116 + conf/kismet_logging.conf || die
117 +
118 + # Don't strip and set correct mangrp
119 + sed -i -e 's| -s||g' \
120 + -e 's|@mangrp@|root|g' Makefile.in
121 +
122 + eapply_user
123 +
124 + #just use set to fix setup.py
125 + find . -name "Makefile.in" -exec sed -i 's#setup.py install#setup.py install --root=$(DESTDIR)#' {} + || die
126 + find . -name "Makefile" -exec sed -i 's#setup.py install#setup.py install --root=$(DESTDIR)#' {} + || die
127 +
128 + if [ "${PV}" = "9999" ]; then
129 + eautoreconf
130 + fi
131 +}
132 +
133 +src_configure() {
134 + econf \
135 + $(use_enable libusb libusb) \
136 + $(use_enable pcre) \
137 + $(use_enable lm-sensors lmsensors) \
138 + $(use_enable networkmanager libnm) \
139 + $(use_enable ubertooth) \
140 + --sysconfdir=/etc/kismet \
141 + --disable-optimization
142 +}
143 +
144 +src_install() {
145 + emake DESTDIR="${D}" commoninstall
146 + python_optimize
147 + emake DESTDIR="${D}" forceconfigs
148 +
149 + insinto /usr/share/${PN}
150 + doins Makefile.inc
151 +
152 + dodoc CHANGELOG README*
153 + newinitd "${FILESDIR}"/${PN}.initd-r3 kismet
154 + newconfd "${FILESDIR}"/${PN}.confd-r2 kismet
155 +}
156 +
157 +pkg_preinst() {
158 + if use suid; then
159 + enewgroup kismet
160 + fowners root:kismet /usr/bin/kismet_cap_linux_bluetooth
161 + fowners root:kismet /usr/bin/kismet_cap_linux_wifi
162 + fowners root:kismet /usr/bin/kismet_cap_pcapfile
163 + # Need to set the permissions after chowning.
164 + # See chown(2)
165 + fperms 4550 /usr/bin/kismet_cap_linux_bluetooth
166 + fperms 4550 /usr/bin/kismet_cap_linux_wifi
167 + fperms 4550 /usr/bin/kismet_cap_pcapfile
168 + elog "Kismet has been installed with a setuid-root helper binary"
169 + elog "to enable minimal-root operation. Users need to be part of"
170 + elog "the 'kismet' group to perform captures from physical devices."
171 + fi
172 + if ! use suid; then
173 + ewarn "It is highly discouraged to run a sniffer as root,"
174 + ewarn "Please consider enabling the suid use flag and adding"
175 + ewarn "your user to the kismet group."
176 + fi
177 +}
178 +
179 +migrate_config() {
180 + einfo "Kismet Configuration files are now read from /etc/kismet/"
181 + ewarn "Please keep user specific settings in /etc/kismet/kismet_site.conf"
182 + if [ -n "$(ls ${EROOT}/etc/kismet_*.conf 2> /dev/null)" ]; then
183 + ewarn "Files at /etc/kismet_*.conf will not be read and should be removed"
184 + fi
185 + if [ -f "${EROOT}/etc/kismet_site.conf" ] && [ ! -f "${EROOT}/etc/kismet/kismet_site.conf" ]; then
186 + mv /etc/kismet_site.conf /etc/kismet/kismet_site.conf || die "Failed to migrate kismet_site.conf to new location"
187 + ewarn "Your /etc/kismet_site.conf file has been automatically moved to /etc/kismet/kismet_site.conf"
188 + elif [ -f "${EROOT}/etc/kismet_site.conf" ] && [ -f "${EROOT}/etc/kismet/kismet_site.conf" ]; then
189 + ewarn "Both /etc/kismet_site.conf and /etc/kismet/kismet_site.conf exist, please migrate needed bits"
190 + ewarn "into /etc/kismet/kismet_site.conf and remove /etc/kismet_site.conf"
191 + fi
192 +}
193 +
194 +pkg_postinst() {
195 + if [ -n "${REPLACING_VERSIONS}" ]; then
196 + for v in ${REPLACING_VERSIONS}; do
197 + if ver_test ${v} -lt 2019.07.2 ; then
198 + migrate_config
199 + break
200 + fi
201 + if ver_test ${v} -eq 9999 ; then
202 + migrate_config
203 + break
204 + fi
205 + done
206 + fi
207 +}