[PATCH v3 1/5] selinux-policy-2.eclass: introduce SELINUX_POLICY_USEDEP
Rahul Sandhu <[email protected]>
| Newsgroups | gmane.linux.gentoo.devel |
|---|---|
| Message-ID | <[email protected]> |
Policy packages need to apply the same, consistent set of constraints
for the various policy types onto any dependencies. As such, introduce
SELINUX_POLICY_USEDEP for consumers to easily append such constraints:
> sec-policy/selinux-foo[${SELINUX_USEDEP}]
Signed-off-by: Rahul Sandhu <[email protected]>
---
eclass/selinux-policy-2.eclass | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass
index 96bf57746f68..fff8adea6ae9 100644
--- a/eclass/selinux-policy-2.eclass
+++ b/eclass/selinux-policy-2.eclass
@@ -84,6 +84,12 @@ fi
# The default value is the 'master' branch.
: "${SELINUX_GIT_BRANCH:="master"}"
+# @ECLASS_VARIABLE: SELINUX_POLICY_USEDEP
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# This variable contains the USE dependency constraints for policy packages.
+SELINUX_POLICY_USEDEP="selinux_policy_types_targeted(-)?,selinux_policy_types_strict(-)?,selinux_policy_types_mcs(-)?,selinux_policy_types_mls(-)?"
+
case ${BASEPOL} in
9999)
inherit git-r3
@@ -127,15 +133,10 @@ if [[ ${EAPI} = 7 ]]; then
>=sec-policy/selinux-base-policy-${_BASE_POLICY_VERSION}
"
else
- RDEPEND=">=sys-apps/policycoreutils-2.5"
- for _poltype in selinux_policy_types_{targeted,strict,mcs,mls}; do
- RDEPEND+="
- ${_poltype}? (
- >=sec-policy/selinux-base-policy-${_BASE_POLICY_VERSION}[${_poltype}]
- )
- "
- done
- unset _poltype
+ RDEPEND="
+ >=sys-apps/policycoreutils-2.5
+ >=sec-policy/selinux-base-policy-${_BASE_POLICY_VERSION}[${SELINUX_POLICY_USEDEP}]
+ "
fi
unset _BASE_POLICY_VERSION
--
2.53.0