# -*- 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.13.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       port:execline \
                    port:skalibs
depends_run         port:execline

checksums           rmd160  82fbbd376e707cafd227fe406a9ce67b83afbd4e \
                    sha256  7e46f8f55d80bb0e2025a64d5d649af4a4ac21e348020caaadde30ba5e5b4830 \
                    size    256126

configure.args      --disable-shared \
                    --with-lib=${prefix}/lib/execline \
                    --with-lib=${prefix}/lib/skalibs

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} \
        AUTHORS \
        COPYING \
        NEWS \
        README \
        README.macos \
        ${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
