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>
---
Hi,
This is from https://github.com/gentoo/gentoo/pull/21239 .
I noticed a note in the PMS about how ebuilds with later EAPIs should be
remain source-able by old package managers for EAPI parsing. Does that
extend to eclasses? It would seem unfortunate for global scope to be
permanently restricted to bash 3.0 syntax.
Thanks.
David
eclass/fcaps.eclass | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 4bef00d40ac..291157fb4a6 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.
@@ -33,15 +34,12 @@ _FCAPS_ECLASS=1
IUSE="+filecaps"
-# Since it is needed in pkg_postinst() it must be in RDEPEND
+# Since it is needed in pkg_postinst() it must be in IDEPEND
case "${EAPI:-0}" in
- [0-6])
- RDEPEND="filecaps? ( sys-libs/libcap )"
- ;;
- *)
- BDEPEND="filecaps? ( sys-libs/libcap )"
- RDEPEND="${BDEPEND}"
- ;;
+ 7) BDEPEND="filecaps? ( sys-libs/libcap )" ;&
+ 6) RDEPEND="filecaps? ( sys-libs/libcap )" ;;
+ 8) IDEPEND="filecaps? ( sys-libs/libcap )" ;;
+ *) die "EAPI ${EAPI:-0} is unsupported" ;;
esac
# @ECLASS-VARIABLE: FILECAPS
--
2.31.1
- 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>
---
Hi,
This is from https://github.com/gentoo/gentoo/pull/21239 .
I noticed a note in the PMS about how ebuilds with later EAPIs should be
remain source-able by old package managers for EAPI parsing. Does that
extend to eclasses? It would seem unfortunate for global scope to be
permanently restricted to bash 3.0 syntax.
Thanks.
David
eclass/fcaps.eclass | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 4bef00d40ac..291157fb4a6 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.
@@ -33,15 +34,12 @@ _FCAPS_ECLASS=1
IUSE="+filecaps"
-# Since it is needed in pkg_postinst() it must be in RDEPEND
+# Since it is needed in pkg_postinst() it must be in IDEPEND
case "${EAPI:-0}" in
- [0-6])
- RDEPEND="filecaps? ( sys-libs/libcap )"
- ;;
- *)
- BDEPEND="filecaps? ( sys-libs/libcap )"
- RDEPEND="${BDEPEND}"
- ;;
+ 7) BDEPEND="filecaps? ( sys-libs/libcap )" ;&
+ 6) RDEPEND="filecaps? ( sys-libs/libcap )" ;;
+ 8) IDEPEND="filecaps? ( sys-libs/libcap )" ;;
+ *) die "EAPI ${EAPI:-0} is unsupported" ;;
esac
# @ECLASS-VARIABLE: FILECAPS
--
2.31.1