# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 75291 2011-01-20 03:17:47Z snc@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           sha1    412f9ef7028d4fe89a4f81e9758f74631128185f \
                    rmd160  5c4ab94b58c3ded97f4751fd0436c019073910d4

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"
