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

# Upstream's only tag, v1.0.0, is the 2015 initial implementation. Master adds
# the --lsbsysinit and --regex options from Ubuntu, a fix for script names
# containing spaces, and the LICENSE file the tag predates, so the port pins a
# commit and dates the version after it.
github.setup        ikysil run-parts 77e151f5bfab925f339179640e05622c542bb32c
github.tarball_from archive
version             20221201
revision            0

categories          sysutils
license             public-domain
maintainers         {@jrjsmrtn gmail.com:jrjsmrtn} openmaintainer
supported_archs     noarch

description         Run every executable in a directory

long_description    A bash implementation of run-parts, which runs every \
                    executable in a directory in name order. The concept comes \
                    from Debian, with the --lsbsysinit and --regex extensions \
                    from Ubuntu.

checksums           rmd160  5ea9cada1a144830d5e558f0d1399378a7aec005 \
                    sha256  0c98a73d91257e51754ab9494ae6f46bdab04064208fc209f362059394968ac2 \
                    size    4149

# The --regex option has never worked in either documented form: its case arm
# matches a bare --regex while its body strips up to an "=", so --regex=PATTERN
# matches no arm and --regex PATTERN sets the pattern to the literal "--regex".
# The neighbouring --umask and --arg arms are written correctly.
# Reported upstream: https://github.com/ikysil/run-parts/issues/9
patchfiles          patch-regex-option.diff

use_configure       no

build {}

destroot {
    xinstall -d ${destroot}${prefix}/bin
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/${name}

    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0644 -W ${worksrcpath} LICENSE README.md \
        ${destroot}${prefix}/share/doc/${name}
}

# The default livecheck compares against v1.0.0, which is older than this
# version and so reports nothing useful; watch the branch the port pins.
github.livecheck.branch \
                    master
