The current situation of RDEPEND/BDEPEND is problematic if you are emerging from binpkgs, as there is no guarantee that sys-libs/libcap will be merged before packages inheriting fcaps.eclass. I reproduced this by chrooting into a fresh stage3 (stage3-amd64-20200514T210257Z.tar.xz) and updating the system: sys-libs/pam is merged before sys-libs/libcap, thus pkg_postinst() fails.
Created attachment 639408 [details] merge.log
Created attachment 639410 [details] make.conf
Adding it to DEPEND will not help if you are using binpkgs.
In #gentoo-portage, we discussed moving sys-libs/pam from RDEPEND to PDEPEND in sys-lib/libcap to resolve the circular runtime dep and force libcap to be installed first.
Ouch, you are right, I didn't do my homework. Then I guess I'll look forward to one of the two solutions :)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c80be5a22f00558e763c473e572f0c5c22c9870e commit c80be5a22f00558e763c473e572f0c5c22c9870e Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2020-05-17 18:07:55 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2020-05-17 18:11:05 +0000 sys-libs/libcap: move sys-libs/pam from RDEPEND to PDEPEND Fixes install order for binpkgs. Bug: https://bugs.gentoo.org/723278 Bug: https://bugs.gentoo.org/723352 Signed-off-by: Mike Gilbert <floppym@gentoo.org> sys-libs/libcap/libcap-2.26-r2.ebuild | 5 +++-- sys-libs/libcap/libcap-2.27.ebuild | 5 +++-- sys-libs/libcap/libcap-2.33.ebuild | 5 +++-- sys-libs/libcap/libcap-2.34.ebuild | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-)
commit 789ec15b80a0ad2902d59be5bdb7c5fa6fcd0092 Author: David Michael <fedora.dm0@gmail.com> Date: Mon Jun 14 12:00:14 2021 -0400 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