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

gitlab.setup    procps-ng procps 4.0.4 v
name            watch
revision        0

categories      sysutils
license         GPL-2
maintainers     {gmail.com:stuartwesterman @stuartwesterman} openmaintainer

description     watch executes a program periodically, showing output fullscreen
long_description \
                watch is like "top" for arbitrary commands. It runs command repeatedly, \
                displaying its output (the first screen full). This  allows you to watch \
                the program output change over time. This is part of the linux "procps" \
                package.

checksums       rmd160  630e3ed123e86d2f52230780b56b0ec29c62894d \
                sha256  65d8e4eba8c1a264418f4fada87e06d59cedb96f04b7346f5c249bfeba72f410 \
                size    1423198

patchfiles      patch-autogen.sh.diff \
                patch-configure.ac.diff

post-patch {
    reinplace "s|@@VERSION@@|${version}|g" ${worksrcpath}/configure.ac
}

use_autoreconf  yes
autoreconf.cmd  ./autogen.sh
autoreconf.args

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

depends_lib-append \
                port:ncurses

# Disable gettext due to linking problems
# and we are not going to install any catalogs anyway
configure.args  --disable-nls

variant universal {}

build.target    src/watch
# LDADD is set to libprocps, which isn't needed for watch and fails to build on Darwin
build.args      CC="${configure.cc} [get_canonical_archflags cc]" \
                LDFLAGS="${configure.ldflags}" \
                AM_LDFLAGS="" \
                LDADD=""

destroot {
        xinstall -m 0755 ${worksrcpath}/src/watch ${destroot}${prefix}/bin
        xinstall -m 0644 ${worksrcpath}/man/watch.1 \
                ${destroot}${prefix}/share/man/man1
}

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