# -*- 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        rpodgorny uptimed 0.4.7 v
revision            0
checksums           rmd160  670d7ce47cf9882db2dde8ba782dac7d327486d6 \
                    sha256  2f669d2968ca1d0865b7a97791c9dbcca759631a1afc5d6702964f070a57252b \
                    size    56796

categories          sysutils
license             GPL-2
maintainers         nomaintainer

description         uptime record daemon

long_description    uptimed is an uptime record daemon keeping track \
                    of the highest uptimes a computer system ever had.

github.tarball_from archive

# No configure script in tarball.
use_autoreconf      yes
autoreconf.cmd      ./autogen.sh
autoreconf.args

depends_build-append \
                    port:autoconf \
                    port:automake \
                    port:libtool

patchfiles          patch-Makefile.am.diff \
                    patch-etc-uptimed.conf-dist.diff \
                    patch-libuptimed-urec.h.diff \
                    patch-src-uptimed.c.diff

post-patch {
    reinplace -W ${worksrcpath} "s|@PREFIX@|${prefix}|g" \
        etc/uptimed.conf-dist \
        libuptimed/urec.h \
        src/uptimed.c
}

post-destroot {
    xinstall -d ${destroot}${prefix}/var/spool/uptimed
    touch ${destroot}${prefix}/var/spool/uptimed/bootid
}

startupitem.create      yes
startupitem.executable  ${prefix}/sbin/uptimed -f

github.livecheck.regex  {([0-9.]+)}
