# -*- 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                icpld
version             1.1.5
revision            0
checksums           md5     b6faa64bdbe4d31b3e0cfdbde2a9b0e9 \
                    sha1    cbe04ed210607f9e18b2a91a586f7e17f8018938 \
                    rmd160  457df771324d94867ed481e790cd0caa224945a0

categories          net sysutils
license             BSD
maintainers         nomaintainer

description         network connection performance tracking monitor

long_description    ICPLD is a connection monitor which allows you to \
                    keep track of your network connection perfomance. \
                    It will log each occasion of broken networking. It \
                    runs as a background process, and sends ICMP \
                    requests to an ip of your choice. When a reply \
                    isn't received within proper amount of time, it \
                    will consider the connection as unavailable and \
                    put a stamp in its log.

homepage            http://icpld.northernmost.org/
master_sites        http://www.ibiblio.org/icpld/download/
use_bzip2           yes

patchfiles          configure.patch \
                    patch-src-fork.cpp

post-patch {
    reinplace "s|/doc|/share/doc|" ${worksrcpath}/Makefile.in
}

configure.args      --mandir=${prefix}/share/man \
                    --enable-ipv6

post-destroot {
    xinstall -m 644 ${worksrcpath}/icpld.conf.sample ${destroot}${prefix}/etc/
}

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}
    }
}
