# -*- 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 67926 2010-05-21 19:42:47Z snc@macports.org $

PortSystem          1.0

name                kismet
version             2010-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           md5     a6d6edcf65d5bb2cb5de6472bcc16f19 \
                    sha1    4ac00edd8607196dffc450535487104edef76c1d \
                    rmd160  fb77368ccf702971bb877d83d5c7e819daeecbb3

depends_lib         port:libpcap

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}
}

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