From 789ec15b80a0ad2902d59be5bdb7c5fa6fcd0092 Mon Sep 17 00:00:00 2001 From: David Michael Date: Mon, 14 Jun 2021 12:00:14 -0400 Subject: 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 Signed-off-by: Mike Gilbert Closes: https://github.com/gentoo/gentoo/pull/21239 --- eclass/fcaps.eclass | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'eclass/fcaps.eclass') 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 -- cgit v1.2.3-65-gdbad