summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Michael <fedora.dm0@gmail.com>2021-06-14 12:00:14 -0400
committerMike Gilbert <floppym@gentoo.org>2021-06-19 16:43:15 -0400
commit789ec15b80a0ad2902d59be5bdb7c5fa6fcd0092 (patch)
treeb56d3436e1231b43ddb95947ddcd86bd8f84adc8 /eclass/fcaps.eclass
parentsys-apps/intel-performance-counter-monitor: EAPI 8 (diff)
downloadgentoo-789ec15b80a0ad2902d59be5bdb7c5fa6fcd0092.tar.gz
gentoo-789ec15b80a0ad2902d59be5bdb7c5fa6fcd0092.tar.bz2
gentoo-789ec15b80a0ad2902d59be5bdb7c5fa6fcd0092.zip
fcaps.eclass: support EAPI 8
This defines the native install-time libcap dependency as: - EAPI < 7: RDEPEND Only regular ROOT=/ builds can be expected to work. - EAPI = 7: RDEPEND + BDEPEND Also install the native setcap at built time, so cross- compiling will work, but not installing binpkgs in ROOTs. - EAPI > 7: IDEPEND Install native setcap at install-time; it works everywhere. Since all remaining users are EAPI 6 and above, declare eclass compatibility with EAPIs 6, 7, and 8. Signed-off-by: David Michael <fedora.dm0@gmail.com> Signed-off-by: Mike Gilbert <floppym@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/21239
Diffstat (limited to 'eclass/fcaps.eclass')
-rw-r--r--eclass/fcaps.eclass22
1 files changed, 12 insertions, 10 deletions
diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 4bef00d40ac7..a5f88e9284a0 100644
--- a/eclass/fcaps.eclass
+++ b/eclass/fcaps.eclass
@@ -1,9 +1,10 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: fcaps.eclass
# @MAINTAINER:
# base-system@gentoo.org
+# @SUPPORTED_EAPIS: 6 7 8
# @BLURB: function to set POSIX file-based capabilities
# @DESCRIPTION:
# This eclass provides a function to set file-based capabilities on binaries.
@@ -28,20 +29,21 @@
# )
# @CODE
+case ${EAPI} in
+ 6|7|8) ;;
+ *) die "EAPI ${EAPI:-0} is unsupported" ;;
+esac
+
if [[ -z ${_FCAPS_ECLASS} ]]; then
_FCAPS_ECLASS=1
IUSE="+filecaps"
-# Since it is needed in pkg_postinst() it must be in RDEPEND
-case "${EAPI:-0}" in
- [0-6])
- RDEPEND="filecaps? ( sys-libs/libcap )"
- ;;
- *)
- BDEPEND="filecaps? ( sys-libs/libcap )"
- RDEPEND="${BDEPEND}"
- ;;
+# Since it is needed in pkg_postinst() it must be in IDEPEND
+case ${EAPI} in
+ 7) BDEPEND="filecaps? ( sys-libs/libcap )" ;& # fallthrough
+ 6) RDEPEND="filecaps? ( sys-libs/libcap )" ;;
+ *) IDEPEND="filecaps? ( sys-libs/libcap )" ;;
esac
# @ECLASS-VARIABLE: FILECAPS