# -*- 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           cmake 1.1
PortGroup           github 1.0
PortGroup           legacysupport 1.1

github.setup        zmap zmap 4.3.4 v
github.tarball_from archive
revision            0

categories          net
installs_libs       no
license             Apache-2
maintainers         {@artkiver gmail.com:artkiver} openmaintainer

description         ZMap is a fast network scanner
long_description    designed for Internet-wide network surveys capable of \
                    scanning the entire IPv4 address space in 5 minutes from \
                    a 10GbE connection.
homepage            https://zmap.io/

checksums           rmd160  537c6a4dace3c3d7b6224f5dfd64cdb44c38b359 \
                    sha256  b5936bf5b5390fb50203140e81beac28866374371b1c68329cbbe932cc5ee1d3 \
                    size    212269

depends_build-append \
                    port:byacc \
                    port:flex \
                    port:gengetopt \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:gmp \
                    port:libdnet \
                    port:libpcap \
                    port:libunistring \
                    port:json-c \
                    port:judy

post-patch {
    reinplace "s|ZMAP_VERSION \".*\"|ZMAP_VERSION \"${version}\"|" ${worksrcpath}/src/CMakeVersion.txt
}

# needed for getline, strndup and clock_gettime
legacysupport.newest_darwin_requires_legacy 15

# cc1: error: unrecognized command line option "-std=gnu11"
compiler.c_standard 2011

configure.args-append \
                    -DRESPECT_INSTALL_PREFIX_CONFIG=yes
