1 |
Closes: https://bugs.gentoo.org/778812 |
2 |
Signed-off-by: David Seifert <soap@g.o> |
3 |
--- |
4 |
eclass/selinux-policy-2.eclass | 49 +++++++++++++++++----------------- |
5 |
1 file changed, 25 insertions(+), 24 deletions(-) |
6 |
|
7 |
diff --git a/eclass/selinux-policy-2.eclass b/eclass/selinux-policy-2.eclass |
8 |
index f00e3555b6b..84e95678a67 100644 |
9 |
--- a/eclass/selinux-policy-2.eclass |
10 |
+++ b/eclass/selinux-policy-2.eclass |
11 |
@@ -7,7 +7,7 @@ |
12 |
# @ECLASS: selinux-policy-2.eclass |
13 |
# @MAINTAINER: |
14 |
# selinux@g.o |
15 |
-# @SUPPORTED_EAPIS: 6 7 |
16 |
+# @SUPPORTED_EAPIS: 7 |
17 |
# @BLURB: This eclass supports the deployment of the various SELinux modules in sec-policy |
18 |
# @DESCRIPTION: |
19 |
# The selinux-policy-2.eclass supports deployment of the various SELinux modules |
20 |
@@ -18,6 +18,14 @@ |
21 |
# Also, it supports for bundling patches to make the whole thing just a bit more |
22 |
# manageable. |
23 |
|
24 |
+case ${EAPI} in |
25 |
+ 7) ;; |
26 |
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; |
27 |
+esac |
28 |
+ |
29 |
+if [[ ! ${_SELINUX_POLICY_2_ECLASS} ]]; then |
30 |
+_SELINUX_POLICY_2_ECLASS=1 |
31 |
+ |
32 |
# @ECLASS_VARIABLE: MODS |
33 |
# @DESCRIPTION: |
34 |
# This variable contains the (upstream) module name for the SELinux module. |
35 |
@@ -74,12 +82,6 @@ |
36 |
# The default value is the 'master' branch. |
37 |
: ${SELINUX_GIT_BRANCH:="master"}; |
38 |
|
39 |
-case "${EAPI:-0}" in |
40 |
- 0|1|2|3|4|5) die "EAPI<6 is not supported";; |
41 |
- 6|7) : ;; |
42 |
- *) die "unknown EAPI" ;; |
43 |
-esac |
44 |
- |
45 |
case ${BASEPOL} in |
46 |
9999) inherit git-r3 |
47 |
EGIT_REPO_URI="${SELINUX_GIT_REPO}"; |
48 |
@@ -113,17 +115,12 @@ else |
49 |
RDEPEND=">=sys-apps/policycoreutils-2.0.82 |
50 |
>=sec-policy/selinux-base-policy-${PV}" |
51 |
fi |
52 |
-if [[ ${EAPI} == 6 ]]; then |
53 |
- DEPEND="${RDEPEND} |
54 |
- sys-devel/m4 |
55 |
- >=sys-apps/checkpolicy-2.0.21" |
56 |
-else |
57 |
- DEPEND="${RDEPEND}" |
58 |
- BDEPEND="sys-devel/m4 |
59 |
- >=sys-apps/checkpolicy-2.0.21" |
60 |
-fi |
61 |
|
62 |
-EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm |
63 |
+DEPEND="${RDEPEND}" |
64 |
+BDEPEND=" |
65 |
+ sys-devel/m4 |
66 |
+ >=sys-apps/checkpolicy-2.0.21 |
67 |
+" |
68 |
|
69 |
# @FUNCTION: selinux-policy-2_src_unpack |
70 |
# @DESCRIPTION: |
71 |
@@ -219,7 +216,7 @@ selinux-policy-2_src_compile() { |
72 |
for i in ${POLICY_TYPES}; do |
73 |
# Support USE flags in builds |
74 |
export M4PARAM="${makeuse}" |
75 |
- emake NAME=$i SHAREDIR="${ROOT%/}"/usr/share/selinux -C "${S}"/${i} || die "${i} compile failed" |
76 |
+ emake NAME=$i SHAREDIR="${EPREFIX}"/usr/share/selinux -C "${S}"/${i} |
77 |
done |
78 |
} |
79 |
|
80 |
@@ -255,8 +252,8 @@ selinux-policy-2_src_install() { |
81 |
selinux-policy-2_pkg_postinst() { |
82 |
# Set root path and don't load policy into the kernel when cross compiling |
83 |
local root_opts="" |
84 |
- if [[ "${ROOT%/}" != "" ]]; then |
85 |
- root_opts="-p ${ROOT%/} -n" |
86 |
+ if [[ -n ${ROOT} ]]; then |
87 |
+ root_opts="-p ${ROOT} -n" |
88 |
fi |
89 |
|
90 |
# build up the command in the case of multiple modules |
91 |
@@ -274,7 +271,7 @@ selinux-policy-2_pkg_postinst() { |
92 |
|
93 |
einfo "Inserting the following modules into the $i module store: ${MODS}" |
94 |
|
95 |
- cd "${ROOT%/}/usr/share/selinux/${i}" || die "Could not enter /usr/share/selinux/${i}" |
96 |
+ cd "${ROOT}/usr/share/selinux/${i}" || die "Could not enter /usr/share/selinux/${i}" |
97 |
for j in ${MODS} ; do |
98 |
if [[ -f "${j}.pp" ]] ; then |
99 |
COMMAND="${j}.pp ${COMMAND}" |
100 |
@@ -323,7 +320,7 @@ selinux-policy-2_pkg_postinst() { |
101 |
done |
102 |
|
103 |
# Don't relabel when cross compiling |
104 |
- if [[ "${ROOT%/}" == "" ]]; then |
105 |
+ if [[ -z ${ROOT} ]]; then |
106 |
# Relabel depending packages |
107 |
local PKGSET=""; |
108 |
if [[ -x /usr/bin/qdepends ]] ; then |
109 |
@@ -346,8 +343,8 @@ selinux-policy-2_pkg_postrm() { |
110 |
if [[ -z "${REPLACED_BY_VERSION}" ]]; then |
111 |
# Set root path and don't load policy into the kernel when cross compiling |
112 |
local root_opts="" |
113 |
- if [[ "${ROOT%/}" != "" ]]; then |
114 |
- root_opts="-p ${ROOT%/} -n" |
115 |
+ if [[ -n ${ROOT} ]]; then |
116 |
+ root_opts="-p ${ROOT} -n" |
117 |
fi |
118 |
|
119 |
# build up the command in the case of multiple modules |
120 |
@@ -368,3 +365,7 @@ selinux-policy-2_pkg_postrm() { |
121 |
done |
122 |
fi |
123 |
} |
124 |
+ |
125 |
+fi |
126 |
+ |
127 |
+EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm |
128 |
-- |
129 |
2.39.0 |