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

# clock_gettime, through the statically linked Skarnet libraries.
legacysupport.newest_darwin_requires_legacy 15

name                s6-dns
version             2.4.1.3
revision            0
categories          net
license             ISC
maintainers         @bjornpagen openmaintainer
description         DNS client programs and libraries

long_description    s6-dns is a suite of DNS client programs and libraries \
                    for Unix systems, as an alternative to the BIND or \
                    djbdns clients. It provides synchronous and \
                    asynchronous resolution libraries and the skadns \
                    resolution daemon, which s6-networking builds on.

homepage            https://skarnet.org/software/s6-dns/
master_sites        ${homepage}

checksums           rmd160  154f13dbcd7e2fc06c1139eeba50648fad21eab1 \
                    sha256  f9e9deb4648c5507a8485548364bd1c56dabda394bc9ee2d7f1cbb16a036cd76 \
                    size    97239

depends_build-append \
                    port:pkgconfig \
                    port:skalibs

# Match the normalized target recorded by skalibs.
# https://trac.macports.org/ticket/74350
configure.args-append \
                    --enable-pkgconfig \
                    --with-pkgconfig \
                    --build=${build_arch}-apple-darwin${os.major} \
                    --target=${build_arch}-apple-darwin${os.major}

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} \
        AUTHORS \
        COPYING \
        INSTALL \
        NEWS \
        README \
        ${destroot}${docdir}
    xinstall -m 0644 {*}[glob ${worksrcpath}/doc/*.html] \
        ${destroot}${docdir}
    foreach sub {libs6dns skadns} {
        xinstall -d ${destroot}${docdir}/${sub}
        xinstall -m 0644 {*}[glob ${worksrcpath}/doc/${sub}/*.html] \
            ${destroot}${docdir}/${sub}
    }
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     "${name}-(\[0-9.\]+)\\.tar\\.gz"
