aports/s6/APKBUILD-s6.template

41 lines
992 B
Plaintext
Raw Normal View History

2022-11-01 15:04:41 +00:00
. ../../APKBUILD.template
: ${pkgname:?"No package prefix provided"}
: ${_rx_s6_svcname:="redxen.$_rx_pkgname"}
pkgname="$pkgname-s6-$_rx_pkgname"
pkgdesc="RedXen s6 configuration: $_rx_pkgname"
depends="nnd-s6-services $_rx_pkgname redxen-config-$_rx_pkgname"
rx_s6_svc_install() {
mkdir -p "$(rx_cpkgdir)"/etc/s6/dist/rc
mv "$builddir"/rc "$(rx_cpkgdir)"/etc/s6/dist/rc/"${1:-$_rx_s6_svcname}"
}
rx_s6_env_install() {
mkdir -p "$(rx_cpkgdir)"/etc/s6/dist/env
mv "$builddir"/env "$(rx_cpkgdir)"/etc/s6/dist/env/"${1:-$_rx_s6_svcname}"
}
rx_s6_bundle_add() {
mkdir -p "$(rx_cpkgdir)"/etc/s6/dist/rc/bundle.redxen/contents.d/
touch "$(rx_cpkgdir)"/etc/s6/dist/rc/bundle.redxen/contents.d/"${1:-$_rx_s6_svcname}"
}
# Override defaults
prepare() {
default_prepare
cp -R "$startdir"/rc "$builddir"
if [ -d "$startdir"/env ]; then
cp -R "$startdir"/env "$builddir"
fi
}
package() {
rx_s6_svc_install
rx_s6_bundle_add
if [ -d "$builddir"/env ]; then
rx_s6_env_install
fi
}