@@ -17,45 +17,32 @@ HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
17
17
if [[ ${PV} == 9999 ]]; then
18
18
inherit git-r3
19
19
EGIT_REPO_URI=" https://github.com/SELinuxProject/selinux.git"
20
- SRC_URI=" !vanilla? ( https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER} .tar.bz2 ) "
20
+ SRC_URI=" https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER} .tar.bz2"
21
21
S1=" ${WORKDIR} /${P} /${PN} "
22
22
S2=" ${WORKDIR} /policycoreutils-extra"
23
23
S=" ${S1} "
24
24
else
25
25
SRC_URI=" https://github.com/SELinuxProject/selinux/releases/download/${MY_PV} /${MY_P} .tar.gz
26
- !vanilla? ( https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER} .tar.bz2 ) "
27
- KEYWORDS=" amd64 ~ arm ~ arm64 ~riscv x86"
26
+ https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER} .tar.bz2"
27
+ KEYWORDS=" amd64 arm arm64 ~riscv x86"
28
28
S1=" ${WORKDIR} /${MY_P} "
29
29
S2=" ${WORKDIR} /policycoreutils-extra"
30
30
S=" ${S1} "
31
31
fi
32
32
33
33
LICENSE=" GPL-2"
34
34
SLOT=" 0"
35
- IUSE=" audit pam split-usr vanilla +python"
36
- REQUIRED_USE="
37
- !vanilla? ( python ${PYTHON_REQUIRED_USE} )
38
- "
39
-
40
- DEPEND="
41
- python? (
42
- >=sys-libs/libselinux-${PV} :=[python,${PYTHON_USEDEP} ]
43
- >=sys-libs/libsemanage-${PV} :=[python(+),${PYTHON_USEDEP} ]
44
- audit? ( >=sys-process/audit-1.5.1[python,${PYTHON_USEDEP} ] )
45
- ${PYTHON_DEPS}
46
- )
47
- !python? (
48
- >=sys-libs/libselinux-${PV} :=
49
- >=sys-libs/libsemanage-${PV} :=
50
- audit? ( >=sys-process/audit-1.5.1 )
51
- )
35
+ IUSE=" audit pam split-usr"
36
+ REQUIRED_USE=" ${PYTHON_REQUIRED_USE} "
37
+
38
+ DEPEND=" >=sys-libs/libselinux-${PV} :=[python,${PYTHON_USEDEP} ]
39
+ >=sys-libs/libsemanage-${PV} :=[python(+),${PYTHON_USEDEP} ]
52
40
>=sys-libs/libsepol-${PV} :=
53
41
sys-libs/libcap-ng:=
42
+ >=app-admin/setools-4.2.0[${PYTHON_USEDEP} ]
43
+ audit? ( >=sys-process/audit-1.5.1[python,${PYTHON_USEDEP} ] )
54
44
pam? ( sys-libs/pam:= )
55
- !vanilla? (
56
- >=app-admin/setools-4.2.0[${PYTHON_USEDEP} ]
57
- )
58
- "
45
+ ${PYTHON_DEPS} "
59
46
60
47
# Avoid dependency loop in the cross-compile case, bug #755173
61
48
# (Still exists in native)
@@ -66,7 +53,7 @@ RDEPEND="${DEPEND}
66
53
app-misc/pax-utils"
67
54
68
55
PDEPEND=" sys-apps/semodule-utils
69
- python? ( sys-apps/selinux-python ) "
56
+ sys-apps/selinux-python"
70
57
71
58
src_unpack () {
72
59
# Override default one because we need the SRC_URI ones even in case of 9999 ebuilds
@@ -84,96 +71,69 @@ src_prepare() {
84
71
eapply " ${FILESDIR} /policycoreutils-3.1-0001-newrole-not-suid.patch"
85
72
fi
86
73
87
- if ! use vanilla; then
88
- # rlpkg is more useful than fixfiles
89
- sed -i -e ' /^all/s/fixfiles//' " ${S} /scripts/Makefile" \
90
- || die " fixfiles sed 1 failed"
91
- sed -i -e ' /fixfiles/d' " ${S} /scripts/Makefile" \
92
- || die " fixfiles sed 2 failed"
93
- fi
74
+ # rlpkg is more useful than fixfiles
75
+ sed -i -e ' /^all/s/fixfiles//' " ${S} /scripts/Makefile" \
76
+ || die " fixfiles sed 1 failed"
77
+ sed -i -e ' /fixfiles/d' " ${S} /scripts/Makefile" \
78
+ || die " fixfiles sed 2 failed"
94
79
95
80
eapply_user
96
81
97
82
sed -i ' s/-Werror//g' " ${S1} " /* /Makefile || die " Failed to remove Werror"
98
83
99
- if ! use vanilla; then
100
- python_copy_sources
101
- # Our extra code is outside the regular directory, so set it to the extra
102
- # directory. We really should optimize this as it is ugly, but the extra
103
- # code is needed for Gentoo at the same time that policycoreutils is present
104
- # (so we cannot use an additional package for now).
105
- S=" ${S2} "
106
- python_copy_sources
107
- fi
84
+ python_copy_sources
85
+ # Our extra code is outside the regular directory, so set it to the extra
86
+ # directory. We really should optimize this as it is ugly, but the extra
87
+ # code is needed for Gentoo at the same time that policycoreutils is present
88
+ # (so we cannot use an additional package for now).
89
+ S=" ${S2} "
90
+ python_copy_sources
108
91
}
109
92
110
93
src_compile () {
111
94
building () {
112
- local build_dir=${1}
113
- emake -C " ${build_dir} " \
95
+ emake -C " ${BUILD_DIR} " \
114
96
AUDIT_LOG_PRIVS=" y" \
115
97
AUDITH=" $( usex audit y n) " \
116
98
PAMH=" $( usex pam y n) " \
117
99
SESANDBOX=" n" \
118
100
CC=" $( tc-getCC) " \
119
101
LIBDIR=" \$ (PREFIX)/$( get_libdir) "
120
102
}
121
- if ! use vanilla; then
122
- building_with_python () {
123
- building " ${BUILD_DIR} "
124
- }
125
- S=" ${S1} " # Regular policycoreutils
126
- python_foreach_impl building_with_python
127
- S=" ${S2} " # Extra set
128
- python_foreach_impl building_with_python
129
- unset -f building_with_python
130
- else
131
- S=" ${S1} " # Regular policycoreutils
132
- building " ${S} "
133
- fi
134
- unset -f building
103
+ S=" ${S1} " # Regular policycoreutils
104
+ python_foreach_impl building
105
+ S=" ${S2} " # Extra set
106
+ python_foreach_impl building
135
107
}
136
108
137
109
src_install () {
138
- installation-policycoreutils-base () {
139
- local build_dir= ${1}
110
+ # Python scripts are present in many places. There are no extension modules.
111
+ installation-policycoreutils () {
140
112
einfo " Installing policycoreutils"
141
- emake -C " ${build_dir } " DESTDIR=" ${D} " \
113
+ emake -C " ${BUILD_DIR } " DESTDIR=" ${D} " \
142
114
AUDIT_LOG_PRIVS=" y" \
143
115
AUDITH=" $( usex audit y n) " \
144
116
PAMH=" $( usex pam y n) " \
145
117
SESANDBOX=" n" \
146
118
CC=" $( tc-getCC) " \
147
119
LIBDIR=" \$ (PREFIX)/$( get_libdir) " \
148
120
install
121
+ python_optimize
149
122
}
150
123
151
- if ! use vanilla; then
152
- # Python scripts are present in many places. There are no extension modules.
153
- installation-policycoreutils () {
154
- installation-policycoreutils-base " ${BUILD_DIR} "
155
- python_optimize
156
- }
157
-
158
- installation-extras () {
159
- einfo " Installing policycoreutils-extra"
160
- emake -C " ${BUILD_DIR} " \
161
- DESTDIR=" ${D} " \
162
- install
163
- python_optimize
164
- }
165
-
166
- S=" ${S1} " # policycoreutils
167
- python_foreach_impl installation-policycoreutils
168
- S=" ${S2} " # extras
169
- python_foreach_impl installation-extras
170
- S=" ${S1} " # back for later
171
- unset -f installation-extras installation-policycoreutils
172
- else
173
- S=" ${S1} " # policycoreutils
174
- installation-policycoreutils-base " ${S} "
175
- fi
176
- unset -f installation-policycoreutils-base
124
+ installation-extras () {
125
+ einfo " Installing policycoreutils-extra"
126
+ emake -C " ${BUILD_DIR} " \
127
+ DESTDIR=" ${D} " \
128
+ install
129
+ python_optimize
130
+ }
131
+
132
+ S=" ${S1} " # policycoreutils
133
+ python_foreach_impl installation-policycoreutils
134
+ S=" ${S2} " # extras
135
+ python_foreach_impl installation-extras
136
+ S=" ${S1} " # back for later
177
137
178
138
# remove redhat-style init script
179
139
rm -fR " ${D} /etc/rc.d" || die
@@ -192,12 +152,10 @@ src_install() {
192
152
dodir /var/lib/selinux
193
153
keepdir /var/lib/selinux
194
154
195
- if ! use vanilla; then
196
- # Set version-specific scripts
197
- for pyscript in rlpkg; do
198
- python_replicate_script " ${ED} /usr/sbin/${pyscript} "
199
- done
200
- fi
155
+ # Set version-specific scripts
156
+ for pyscript in rlpkg; do
157
+ python_replicate_script " ${ED} /usr/sbin/${pyscript} "
158
+ done
201
159
}
202
160
203
161
pkg_postinst () {
0 commit comments