Introduce the dinit eclass
Signed-off-by: Shin'ya Minazuki <shinyoukai@chaotic.ninja>
This commit is contained in:
parent
3f8dfa1614
commit
eca4b12489
1 changed files with 61 additions and 0 deletions
61
eclass/dinit.eclass
Normal file
61
eclass/dinit.eclass
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
# Copyright 2026 Shin'ya Minazuki
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# @ECLASS: dinit.eclass
|
||||||
|
# @MAINTAINER:
|
||||||
|
# Shin'ya Minazuki <shinyoukai@chaotic.ninja>
|
||||||
|
# @AUTHOR:
|
||||||
|
# Shin'ya Minazuki <shinyoukai@chaotic.ninja>
|
||||||
|
# @SUPPORTED_EAPIS: 8
|
||||||
|
# @BLURB: helper functions to install service units for sys-process/dinit
|
||||||
|
# @DESCRIPTION:
|
||||||
|
# This eclass provides a set of functions to install unit files for
|
||||||
|
# https://davmac.org/projects/dinit
|
||||||
|
# @EXAMPLE:
|
||||||
|
#
|
||||||
|
# @CODE:
|
||||||
|
# inherit dinit
|
||||||
|
#
|
||||||
|
# src_install() {
|
||||||
|
# dinit_newservice "${FILESDIR}/gitea.dinit" "${PN}"
|
||||||
|
# }
|
||||||
|
# @CODE
|
||||||
|
|
||||||
|
case ${EAPI} in
|
||||||
|
8) ;;
|
||||||
|
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ ! ${_DINIT_ECLASS} ]]; then
|
||||||
|
_DINIT_ECLASS=1
|
||||||
|
|
||||||
|
# @FUNCTION: dinit_doservice
|
||||||
|
# @USAGE: <service>
|
||||||
|
# @DESCRIPTION:
|
||||||
|
# Install dinit service(s).
|
||||||
|
# This function uses doins, therefore it is fatal
|
||||||
|
dinit_doservice() {
|
||||||
|
debug-print-function "${FUNCNAME}" "$@"
|
||||||
|
|
||||||
|
(
|
||||||
|
insopts -m 0644
|
||||||
|
insinto "${D}/etc/dinit.d"
|
||||||
|
doins "${@}"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
# @FUNCTION: dinit_newservice
|
||||||
|
# @USAGE: <old-name> <new-name>
|
||||||
|
# @DESCRIPTION:
|
||||||
|
# Install dinit service with a new name.
|
||||||
|
# This function uses newins, therefore it is fatal
|
||||||
|
dinit_newservice() {
|
||||||
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
|
(
|
||||||
|
insopts -m 0644
|
||||||
|
insinto "${D}/etc/dinit.d"
|
||||||
|
newins "${@}"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fi
|
||||||
Loading…
Add table
Add a link
Reference in a new issue