# -*- 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           compiler_blacklist_versions 1.0
PortGroup           github 1.0

# strnlen, getline, dprintf
# https://github.com/aircrack-ng/aircrack-ng/issues/1682
# clock_gettime
PortGroup           legacysupport 1.1
legacysupport.newest_darwin_requires_legacy 15

epoch               1
github.setup        aircrack-ng aircrack-ng 1.7
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            1
checksums           rmd160  aa9ff18ba8a667abed846f7d2a47d0992ce90d82 \
                    sha256  05a704e3c8f7792a17315080a21214a4448fd2452c1b0dd5226a3a55f90b58c3 \
                    size    7740634

categories          security
license             GPL-2+ BSD OpenSSL
maintainers         {ryandesign @ryandesign} openmaintainer

description         Aircrack-ng is the next generation of aircrack with lots of new features

long_description    aircrack is an 802.11 WEP and WPA-PSK keys cracking \
                    program that can recover keys once enough data packets \
                    have been captured. It implements the standard FMS \
                    attack along with some optimizations like KoreK attacks, \
                    thus making the attack much faster compared to other WEP \
                    cracking tools. In fact, aircrack is a set of tools for \
                    auditing wireless networks.

homepage            https://aircrack-ng.org
master_sites        https://download.aircrack-ng.org

depends_build       port:autoconf \
                    port:automake \
                    port:gmake \
                    port:libtool \
                    path:bin/pkg-config:pkgconfig

depends_lib         port:hwloc \
                    port:libpcap \
                    path:lib/libssl.dylib:openssl \
                    port:pcre \
                    port:sqlite3

patchfiles-append   aircrack_ng_mac.m4.patch

compiler.cxx_standard \
                    2011

# cpuid, cpuid_count, get_cpuid_max
# https://github.com/aircrack-ng/aircrack-ng/issues/1717
compiler.blacklist-append {clang < 503}

# No configure script in tarball.
configure.cmd       ./autogen.sh

configure.args      --disable-silent-rules \
                    --with-libpcap-include=${prefix}/include \
                    --with-libpcap-lib=${prefix}/lib \
                    --with-openssl=${prefix} \
                    --with-sqlite3=${prefix} \
                    --without-duma \
                    --without-experimental \
                    --without-ext-scripts \
                    --without-gcrypt \
                    --without-xcode

build.cmd           ${prefix}/bin/gmake

test.run            yes
test.target         check