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"
|
2022-11-02 09:26:35 +00:00
|
|
|
depends="redxen-s6-bundle $_rx_pkgname redxen-config-$_rx_pkgname"
|
2022-11-01 15:04:41 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|