# -*- 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                s6
version             2.15.0.0
revision            0
categories          sysutils
license             ISC
maintainers         nomaintainer
description         toolbox for low-level process and service administration

long_description \
    s6 is a small suite of programs for UNIX, designed to allow \
    process supervision (a.k.a service supervision), in the line of \
    daemontools and runit, as well as various operations on processes \
    and daemons. It is meant to be a toolbox for low-level process and \
    service administration, providing different sets of independent \
    tools that can be used within or without the framework, and that \
    can be assembled together to achieve powerful functionality with \
    a very small amount of code.

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

depends_build-append \
                    port:execline \
                    port:pkgconfig \
                    port:skalibs

depends_run         port:execline

checksums           rmd160  0c5633be159049cc473da63898e817717baaab3c \
                    sha256  27dff73d626285540133e075e75887087f5117fd51de59503ef7d29e96f69e4c \
                    size    276915

configure.args-append \
                    --enable-pkgconfig \
                    --with-pkgconfig

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

    xinstall -m 0755 -d ${destroot}${prefix}/var/s6-svscan/service
}

destroot.keepdirs   ${destroot}${prefix}/var/s6-svscan/service

post-activate {
    ui_msg "A startupitem for s6-svscan has been created."
    ui_msg "The startupitem assumes a scandir of"
    ui_msg "${prefix}/var/s6-svscan/service"
}

startupitem.create       yes
startupitem.name         s6-svscan
startupitem.executable   ${prefix}/bin/s6-svscan ${prefix}/var/s6-svscan/service
