ports/main/nnd-s6-services/APKBUILD

53 lines
1.2 KiB
Plaintext

# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
. ../../APKBUILD.template
pkgname=nnd-s6-services
pkgver=2.52
pkgrel=0
pkgdesc="Base services for s6"
depends="s6-rc s6-portable-utils s6-linux-utils"
builddir="$srcdir/"
_distpfx="usr/share/nnd/s6/dist"
options=""
prepare() {
default_prepare
cp -R "$startdir"/rc "$builddir"/rc
cp -R "$startdir"/env "$builddir"/env
cp -R "$startdir"/tmpl "$builddir"/tmpl
cp "$startdir"/manage.sh "$builddir"/manage.sh
}
package() {
# Distributed bundles
mkdir -p "$pkgdir/$_distpfx"
mv "$builddir"/rc "$pkgdir/$_distpfx"/rc
mv "$builddir"/env "$pkgdir/$_distpfx"/env
mkdir -p "$pkgdir/usr/libexec/nnd/"
mv "$builddir"/tmpl "$pkgdir/usr/libexec/nnd"/s6
# Manager
install -Dm755 "$builddir"/manage.sh "$pkgdir"/usr/bin/nnd-s6
# Defaults
mkdir -p "$pkgdir"/etc/s6/sv
mkdir -p "$pkgdir"/etc/s6/env
mkdir -p "$pkgdir"/etc/s6/rc
mkdir -p "$pkgdir"/etc/s6/rc/default/contents.d
echo bundle > "$pkgdir"/etc/s6/rc/default/type
}
check() {
s6-rc-compile "$builddir"/compiled "$builddir"/rc
}
_bundle() {
local _BNAME="${subpkgname##$pkgname-}"
[ -d "$pkgdir/$_distpfx/env/$_BNAME" ] && amove "$_distpfx/env/$_BNAME"
amove "$_distpfx/rc/$_BNAME"
}