PortSystem          1.0
name                daemontools
version             0.76
revision            3
categories          sysutils
license             public-domain
maintainers         nomaintainer
description         collection of tools for managing UNIX services
long_description \
   daemontools is an extensive collection of tools for managing UNIX \
   services. It includes tools for starting, restarting, stopping, \
   monitoring and logging any services that you might wish to run.

homepage            https://cr.yp.to/daemontools.html
master_sites        https://cr.yp.to/daemontools/ \
                    http://smarden.org/pape/djb/manpages/:man
distfiles-append    ${distname}-man.tar.gz:man
checksums           ${distname}.tar.gz \
                    rmd160  9819dae18b3f15a366e49fea81ecef76d5b4f53f \
                    sha256  a55535012b2be7a52dcd9eccabb9a198b13be50d0384143bd3b32b8710df4c1f \
                    size    36975 \
                    ${distname}-man.tar.gz \
                    rmd160  d82f0bad55f0751fdfadfa0f3bf2883740fa65d9 \
                    sha256  1b4d77afe0878a0df587672531a3f7bbe0feb7ad0e9acf50395426e3c434600a \
                    size    8005

worksrcdir          admin/${worksrcdir}

patchfiles-append   implicit.patch
patchfiles-append   no-poll.patch

use_configure       no

build.cmd           package/compile
build.target

destroot {
   xinstall -m 755 -W ${worksrcpath}/command envdir envuidgid fghack \
      multilog pgrphack readproctitle setlock setuidgid softlimit supervise \
      svc svok svscan svscanboot svstat tai64n tai64nlocal \
      ${destroot}${prefix}/sbin
   xinstall -m 755 -W ${filespath} svscan-pathwrapper \
      ${destroot}${prefix}/sbin
   reinplace "s|@@PREFIX@@|${prefix}|g" \
      ${destroot}${prefix}/sbin/svscan-pathwrapper
   xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
   xinstall -m 644 -W ${worksrcpath}/src CHANGES TODO \
      ${destroot}${prefix}/share/doc/${name}

   xinstall -m 644 {*}[glob ${workpath}/daemontools-man/*.8] \
      ${destroot}${prefix}/share/man/man8
   xinstall -m 644 ${workpath}/daemontools-man/README \
      ${destroot}${prefix}/share/doc/${name}/README_MANPAGES
   xinstall -m 755 -d ${destroot}${prefix}/var/svscan/service
}

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

notes "
To use svscan, a startupitem has been created, but you must use\
${prefix}/var/svscan/service for it instead of just /service
"

startupitem.create       yes
startupitem.name         svscan
startupitem.executable   ${prefix}/sbin/svscan-pathwrapper ${prefix}/var/svscan/service

livecheck.url       https://cr.yp.to/daemontools/install.html
