Skip to content

Commit

Permalink
systemd.eclass: drop support for EAPI 5 and 6
Browse files Browse the repository at this point in the history
Signed-off-by: David Seifert <[email protected]>
  • Loading branch information
SoapGentoo committed Oct 8, 2024
1 parent d5184aa commit 8d9c839
Showing 1 changed file with 7 additions and 59 deletions.
66 changes: 7 additions & 59 deletions eclass/systemd.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# @ECLASS: systemd.eclass
# @MAINTAINER:
# [email protected]
# @SUPPORTED_EAPIS: 5 6 7 8
# @SUPPORTED_EAPIS: 7 8
# @BLURB: helper functions to install systemd units
# @DESCRIPTION:
# This eclass provides a set of functions to install unit files for
Expand All @@ -24,22 +24,17 @@
# }
# @CODE

if [[ -z ${_SYSTEMD_ECLASS} ]]; then
_SYSTEMD_ECLASS=1

case ${EAPI} in
6)
ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated EAPI ${EAPI}!"
ewarn "${CATEGORY}/${PF}: Support will be removed on 2024-10-08. Please port to newer EAPI."
;;
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

inherit toolchain-funcs

if [[ ${EAPI} == [56] ]]; then
DEPEND="virtual/pkgconfig"
else
BDEPEND="virtual/pkgconfig"
fi
BDEPEND="virtual/pkgconfig"

# @FUNCTION: _systemd_get_dir
# @USAGE: <variable-name> <fallback-directory>
Expand Down Expand Up @@ -85,15 +80,6 @@ systemd_get_systemunitdir() {
_systemd_get_dir systemdsystemunitdir /lib/systemd/system
}

# @FUNCTION: systemd_get_unitdir
# @DESCRIPTION:
# Deprecated alias for systemd_get_systemunitdir.
systemd_get_unitdir() {
[[ ${EAPI} == 5 ]] || die "${FUNCNAME} is banned in EAPI 6, use systemd_get_systemunitdir instead"

systemd_get_systemunitdir
}

# @FUNCTION: systemd_get_userunitdir
# @DESCRIPTION:
# Output the path for the systemd user unit directory (not including
Expand Down Expand Up @@ -339,46 +325,6 @@ systemd_enable_ntpunit() {
return ${ret}
}

# @FUNCTION: systemd_with_unitdir
# @USAGE: [<configure-option-name>]
# @DESCRIPTION:
# Note: deprecated and banned in EAPI 6. Please use full --with-...=
# parameter for improved ebuild readability.
#
# Output '--with-systemdsystemunitdir' as expected by systemd-aware configure
# scripts. This function always succeeds. Its output may be quoted in order
# to preserve whitespace in paths. systemd_to_myeconfargs() is preferred over
# this function.
#
# If upstream does use invalid configure option to handle installing systemd
# units (e.g. `--with-systemdunitdir'), you can pass the 'suffix' as an optional
# argument to this function (`$(systemd_with_unitdir systemdunitdir)'). Please
# remember to report a bug upstream as well.
systemd_with_unitdir() {
[[ ${EAPI} == 5 ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}, use --with-${1:-systemdsystemunitdir}=\"\$(systemd_get_systemunitdir)\" instead"

debug-print-function ${FUNCNAME} "${@}"
local optname=${1:-systemdsystemunitdir}

echo --with-${optname}="$(systemd_get_systemunitdir)"
}

# @FUNCTION: systemd_with_utildir
# @DESCRIPTION:
# Note: deprecated and banned in EAPI 6. Please use full --with-...=
# parameter for improved ebuild readability.
#
# Output '--with-systemdsystemutildir' as used by some packages to install
# systemd helpers. This function always succeeds. Its output may be quoted
# in order to preserve whitespace in paths.
systemd_with_utildir() {
[[ ${EAPI} == 5 ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}, use --with-systemdutildir=\"\$(systemd_get_utildir)\" instead"

debug-print-function ${FUNCNAME} "${@}"

echo --with-systemdutildir="$(systemd_get_utildir)"
}

# @FUNCTION: systemd_update_catalog
# @DESCRIPTION:
# Update the journald catalog. This needs to be called after installing
Expand Down Expand Up @@ -448,3 +394,5 @@ systemd_reenable() {
fi
done
}

fi

0 comments on commit 8d9c839

Please sign in to comment.