# -*- 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    mct tcptraceroute 1.5beta7 tcptraceroute-
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball

categories      net
license         GPL-2
maintainers     nomaintainer
description     a traceroute implementation using TCP packets
long_description    {*}${description}

checksums       rmd160  d8f2a04420ec13423210872a69fca2879b0473f2 \
                sha256  3b27b7c67e2eb00ef800c83e496f1198b992f038de5d3d13aa530ee3b22c77bb \
                size    119068
revision        1

# remove if new version
dist_subdir     ${name}/${version}_1

depends_lib     port:libnet port:libpcap

configure.args  --mandir=${prefix}/share/man
configure.cflags-append "-I${prefix}/include"

platform darwin arm {
    depends_build-append    port:automake

    post-patch {
        # Use newer config.guess and config.sub to support Apple Silicon.
        set automake_dirs [glob -directory ${prefix}/share automake-*]
        set automake_dir [lindex [lsort -command vercmp $automake_dirs] end]
        copy -force ${automake_dir}/config.guess ${automake_dir}/config.sub \
            ${worksrcpath}
    }
}
