commit:     789ec15b80a0ad2902d59be5bdb7c5fa6fcd0092
Author:     David Michael <fedora.dm0 <AT> gmail <DOT> com>
AuthorDate: Mon Jun 14 16:00:14 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Jun 19 20:43:15 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=789ec15b

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 <AT> gmail.com>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/21239

 eclass/fcaps.eclass | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 4bef00d40ac..a5f88e9284a 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:
 # [email protected]
+# @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

Reply via email to