[www-plugins/google-talkplugin] Updated ebuild and manifest.
[underlay.git] / net-wireless / kismet / kismet-2010.07.1.ebuild
blob2d2871b89879b5de3927c3ec8b6a99da6b5f389f
1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
5 EAPI="2"
7 inherit eutils
9 MY_P=${P/\./-}
10 MY_P=${MY_P/./-R}
12 DESCRIPTION="IEEE 802.11 wireless LAN sniffer"
13 HOMEPAGE="http://www.kismetwireless.net/"
14 SRC_URI="http://www.kismetwireless.net/code/${MY_P}.tar.gz"
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS="~amd64 ~arm ~ppc ~x86"
20 KISMET_PLUGINS="autowep btscan ptw spectools"
21 IUSE="+client kernel_linux +pcre +pcap +suid ${KISMET_PLUGINS}"
23 RDEPEND="btscan? ( net-wireless/bluez )
24         client? ( sys-libs/ncurses )
25         kernel_linux? (
26                 dev-libs/libnl
27                 sys-libs/libcap
28         )
29         pcap? ( net-libs/libpcap )
30         pcre? ( dev-libs/libpcre )
31         ptw? ( dev-libs/openssl )"
32 DEPEND="${RDEPEND}
33         dev-util/pkgconfig"
35 S=${WORKDIR}/${MY_P}
37 src_prepare() {
38         sed -i -e 's:# *logprefix=.*:logprefix=/tmp:' conf/kismet.conf.in \
39                 || die "failed to change logprefix"
42 src_configure() {
43         econf --with-suidgroup=kismet \
44                 $(use_enable client) \
45                 $(use_enable kernel_linux linuxwext) \
46                 $(use_enable pcre) \
47                 $(use_enable pcap)
50 src_compile() {
51         emake || die "emake failed"
53         for plugin in ${KISMET_PLUGINS}; do
54                 if use ${plugin}; then
55                         emake -C plugin-${plugin} KIS_SRC_DIR="${S}" \
56                                 || die "emake in plugin-${plugin} failed"
57                 fi
58         done
61 src_install() {
62         emake DESTDIR="${D}" commoninstall || die "emake install failed"
64         for plugin in ${KISMET_PLUGINS}; do
65                 if use ${plugin}; then
66                         emake -C plugin-${plugin} KIS_SRC_DIR="${S}" DESTDIR="${D}" install \
67                                 || die "emake install in plugin-${plugin} failed"
68                 fi
69         done
71         dodoc README RELEASENOTES.txt docs/{DEVEL.client,README.newcore} || die
73         insinto /etc
74         doins conf/kismet{,_drone}.conf || die
76         newinitd "${FILESDIR}"/${PN}.initd kismet || die
77         newconfd "${FILESDIR}"/${PN}.confd kismet || die
79         if use suid; then
80                 dobin kismet_capture || die
81         fi
84 pkg_preinst() {
85         if use suid; then
86                 enewgroup kismet
87                 fowners root:kismet /usr/bin/kismet_capture || die
88                 # Need to set the permissions after chowning.
89                 # See chown(2)
90                 fperms 4550 /usr/bin/kismet_capture || die
91                 elog "Kismet has been installed with a setuid-root helper binary"
92                 elog "to enable minimal-root operation.  Users need to be part of"
93                 elog "the 'kismet' group to perform captures from physical devices."
94         fi