# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 91635 2012-04-07 02:01:34Z ryandesign@macports.org $

PortSystem          1.0

name                kismet
version             2011-01-R1
description         Wireless network detector and sniffer
long_description    Kismet is an 802.11 layer2 wireless network detector, \
                    sniffer, and intrusion detection system.  Kismet will work \
                    with any wireless card which supports raw monitoring \
                    (rfmon) mode, and can sniff 802.11b, 802.11a, 802.11n, and \
                    802.11g traffic (devices and drivers permitting). It can \
                    work with MacBook and MacBook Pro Atheros-based cards with \
                    which currently KisMac is unable to. Kismet identifies \
                    networks by passively collecting packets and detecting \
                    standard named networks, detecting (and given time, \
                    decloaking) hidden networks, and inferring the presence of \
                    non-beaconing networks via data traffic.
license             GPL
maintainers         snc openmaintainer
categories          net
platforms           darwin

homepage            http://www.kismetwireless.net/
master_sites        ${homepage}code

checksums           rmd160  5c4ab94b58c3ded97f4751fd0436c019073910d4 \
                    sha256  99e76f8f7684199b9176a7a2f6b1bb5c637d89f6906d6de279794fb1fb22cde1

depends_lib         port:libpcap port:ncurses

patchfiles          patch-kis_panel_frontend.h.diff \
                    patch-plugintracker.h.diff

configure.cflags-append -fnested-functions

# Dependency building command fails but dependecies are built nevertheless
pre-build {
    system "(cd ${worksrcpath} && gnumake depend ) || true"
}

build.type          gnu

set docdir          ${prefix}/share/doc/${name}-${version}

post-destroot {
    xinstall -d ${destroot}${docdir}
    xinstall -W ${worksrcpath} README ${destroot}${docdir}
    file rename ${destroot}${prefix}/etc/kismet.conf ${destroot}${prefix}/etc/kismet.conf-dist
}

notes "
Read ${docdir}/README and check ${prefix}/etc/kismet.conf-dist.\
In ${prefix}/etc/kismet.conf set source=darwin,en1,airport_extreme\
and replace your_user_here in suiduser with your username
"
