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

name                lft
version             4.01
revision            0
categories          net security
maintainers         {@pwhois} openmaintainer
license             Copyleft
description         Layer Four Traceroute - advanced traceroute tool
long_description    LFT, short for Layer Four Traceroute, is a traceroute that \
                    uses TCP, UDP, ICMP and adaptive probes to pass through \
                    firewalls, exposes ECMP forks, discovers the path MTU, \
                    labels every network in the path with its AS and netname, \
                    and traces IPv4 and IPv6 end to end. Output styles include \
                    text, XML, JSON, GeoJSON, KML, SVG, GraphViz and Mermaid, \
                    plus an ncurses watch mode. Also includes whob, a prefix \
                    whois client for pWhoIs, RADB, Team Cymru and RIPE RIS.
homepage            https://pwhois.org/lft/
master_sites        https://pwhois.org/get/

checksums           rmd160  a6984c6c7d9ca38a7fdb7d07781650cd68ae30c1 \
                    sha256  77a2923dbd10b1e3d2b55d8f3c4144795a80f73772d4f41f5e27751d1f3f0c62 \
                    size    517603

depends_build       path:bin/pkg-config:pkgconfig
depends_lib         port:libpcap \
                    port:c-ares \
                    port:ncurses

configure.args      --with-pcap=${prefix} \
                    --with-cares=${prefix} \
                    --with-ncurses=${prefix} \
                    --mandir=${prefix}/share/man

# 4.x installs honour DESTDIR; the old prefix= override is no longer needed.

variant universal {
    configure.args-append \
                    --enable-universal
}

variant gtod description {Use gettimeofday() instead of PCAP arrival time for latency metrics} {
    configure.args-append \
                    --enable-gtod
}

variant rfc1393 description {Enable the historic RFC 1393 tracing method behind -P} {
    configure.args-append \
                    --enable-rfc1393
}

notes "
lft needs raw-socket and BPF access. Run it with sudo, or make it setuid root:\
    sudo chown root ${prefix}/bin/lft && sudo chmod u+s ${prefix}/bin/lft
whob needs no privileges.
"

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
