# -*- 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

PortSystem          1.0
PortGroup           github 1.0

github.setup        t6x reaver-wps-fork-t6x 1.6.6 v
revision            0
checksums           rmd160  54b81c60fe2ed045882bf29bd3458e59bfb2dcc0 \
                    sha256  e329a0da0b6dd888916046535ff86a6aa144644561937954e560bb1810ab6702 \
                    size    337612

name                reaver
categories          security net
platforms           darwin
maintainers         {ryandesign @ryandesign} openmaintainer
license             GPL-2+

description         Brute-force attack against Wi-Fi Protected Setup

long_description    Reaver implements a brute-force attack against Wi-Fi \
                    Protected Setup which can crack the WPS PIN of a wireless \
                    access point in a matter of hours and subsequently recover \
                    the WPA/WPA2 passphrase. Reaver includes Wash, a utility \
                    for identifying potentially vulnerable access points.

github.tarball_from releases
distname            ${name}-${version}
use_xz              yes

depends_lib         port:libpcap

depends_run         port:aircrack-ng

patch.dir           ${worksrcpath}/src
configure.dir       ${patch.dir}
build.dir           ${configure.dir}

configure.universal_args-delete --disable-dependency-tracking

post-destroot {
    xinstall -d ${destroot}${prefix}/share/doc
    copy ${worksrcpath}/docs ${destroot}${prefix}/share/doc/${name}
    move ${destroot}${prefix}/share/doc/${name}/reaver.1 ${destroot}${prefix}/share/man/man1
}

notes "
Reaver is only supported on Linux and may not work well on most Macs. On\
macOS, reaver and wash must be run as root, and you will be disassociated\
from your normal wireless network while using them.
"