Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/policycoreutils/
Date: Sat, 17 Aug 2019 10:09:31
Message-Id: 1566034396.57443662e1200e6a2841cfebc4ca8e87cd8a1b39.perfinion@gentoo
1 commit: 57443662e1200e6a2841cfebc4ca8e87cd8a1b39
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 17 09:33:16 2019 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 17 09:33:16 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57443662
7
8 sys-apps/policycoreutils: drop old
9
10 Package-Manager: Portage-2.3.69, Repoman-2.3.16
11 Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
12
13 sys-apps/policycoreutils/Manifest | 2 -
14 .../policycoreutils/policycoreutils-2.7.ebuild | 181 ---------------------
15 .../policycoreutils/policycoreutils-2.8.ebuild | 178 --------------------
16 .../policycoreutils/policycoreutils-2.9_rc1.ebuild | 178 --------------------
17 4 files changed, 539 deletions(-)
18
19 diff --git a/sys-apps/policycoreutils/Manifest b/sys-apps/policycoreutils/Manifest
20 index b4571501e02..13349b63e59 100644
21 --- a/sys-apps/policycoreutils/Manifest
22 +++ b/sys-apps/policycoreutils/Manifest
23 @@ -1,5 +1,3 @@
24 -DIST policycoreutils-2.7.tar.gz 2796707 BLAKE2B 4b1c03f2d12252b453950c3d6bcde75780926a1b91263d3881f741399c5630c707f0429b9b144c657b017b7b0c1500b63b6463610dea3caaef8c2f7c3f69fd8f SHA512 ce97d659f72058fd23d8dab8db98fc7c0003806a636c521fa15da465d7358d40ccc8e3eaa9675f00a9b0b8aaa1465d3fb650bc0ebbbf00164e121230673256fb
25 DIST policycoreutils-2.8.tar.gz 2796775 BLAKE2B 36115cc2faf72a4b647312f8faaf4762d7f2fb56bf0531ccadeb46b100c9e577f3148fe6890925d3fed94ac22803dc61729781e54bd0ddeb1539ccce2ec2a29b SHA512 2b4a70836fd8727a16b8f8d4afcc39c9461ab6f5bc1ba5ce5833d41150da921ebb3c9bdbd1cfa7dd31fd382ba18b5433ca9b63bce58bd290db81fa9bedfe29f3
26 -DIST policycoreutils-2.9-rc1.tar.gz 2797222 BLAKE2B 25f51cc1b17744e573450245064b8b65e44fff44693d886e89097308c80ed61b2cb46822d581e8b970053a771262722bdb4a59619d6a94e09505b71e476e45b3 SHA512 6a3a7d4652b44e54c287b327ad691dd0575c6a45fbf1f4676b8182e05760defc37dfa6aaf2e6ab5a77e124d76d1f699c4859c0595a3f9e8ade04ff5ad186fb32
27 DIST policycoreutils-2.9.tar.gz 2819360 BLAKE2B b0af912e3b4fb2c9598b10ce413c8ffb3f5972a4d5d59270cff40abe8d4e385e0664e24a4f533a95ad2d1657644f3368213f955ac63d9f8c46a661417b07c8b3 SHA512 d8356115671ba66de05f1c13193ab47fab69cc4d09603a92171ed40afafc084dd191591bf336b7d722de637378ad09622ebb6eca85c06063ca9ddd6db10e02a2
28 DIST policycoreutils-extra-1.36.tar.bz2 8830 BLAKE2B 6d98e41ea379d3e95221a6e53d8a8b144e4e15ca5581381e76a529dbbaca304d5587b30419797c8c70cbd7c2b2588e5ecd62adcf97294e429950899c1c318346 SHA512 c6a18e6fb2d65f51dc55b88907f23241f2fbfc033d3d2888b109596d9ed31d509b2c93456727ea4d1f98544831afb15c449ff72d6aedf93b9e474b27817f7fb3
29
30 diff --git a/sys-apps/policycoreutils/policycoreutils-2.7.ebuild b/sys-apps/policycoreutils/policycoreutils-2.7.ebuild
31 deleted file mode 100644
32 index 39b802e8f62..00000000000
33 --- a/sys-apps/policycoreutils/policycoreutils-2.7.ebuild
34 +++ /dev/null
35 @@ -1,181 +0,0 @@
36 -# Copyright 1999-2019 Gentoo Authors
37 -# Distributed under the terms of the GNU General Public License v2
38 -
39 -EAPI="6"
40 -PYTHON_COMPAT=( python{2_7,3_5,3_6} )
41 -PYTHON_REQ_USE="xml"
42 -
43 -inherit multilib python-r1 toolchain-funcs bash-completion-r1
44 -
45 -MY_P="${P//_/-}"
46 -
47 -MY_RELEASEDATE="20170804"
48 -EXTRAS_VER="1.36"
49 -SEMNG_VER="${PV}"
50 -SELNX_VER="${PV}"
51 -SEPOL_VER="${PV}"
52 -
53 -IUSE="audit pam dbus"
54 -REQUIRED_USE="${PYTHON_REQUIRED_USE}"
55 -
56 -DESCRIPTION="SELinux core utilities"
57 -HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
58 -
59 -if [[ ${PV} == 9999 ]] ; then
60 - inherit git-r3
61 - EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
62 - SRC_URI="https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
63 - S1="${WORKDIR}/${MY_P}/${PN}"
64 - S2="${WORKDIR}/policycoreutils-extra"
65 - S="${S1}"
66 -else
67 - SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz
68 - https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
69 - KEYWORDS="amd64 ~arm64 ~mips x86"
70 - S1="${WORKDIR}/${MY_P}"
71 - S2="${WORKDIR}/policycoreutils-extra"
72 - S="${S1}"
73 -fi
74 -
75 -LICENSE="GPL-2"
76 -SLOT="0"
77 -
78 -DEPEND=">=sys-libs/libselinux-${SELNX_VER}:=[python,${PYTHON_USEDEP}]
79 - >=sys-libs/glibc-2.4
80 - >=sys-libs/libcap-1.10-r10:=
81 - >=sys-libs/libsemanage-${SEMNG_VER}:=[python,${PYTHON_USEDEP}]
82 - sys-libs/libcap-ng:=
83 - >=sys-libs/libsepol-${SEPOL_VER}:=
84 - >=app-admin/setools-4.1.1[${PYTHON_USEDEP}]
85 - sys-devel/gettext
86 - dev-python/ipy[${PYTHON_USEDEP}]
87 - dbus? (
88 - sys-apps/dbus
89 - dev-libs/dbus-glib:=
90 - )
91 - audit? ( >=sys-process/audit-1.5.1[python,${PYTHON_USEDEP}] )
92 - pam? ( sys-libs/pam:= )
93 - ${PYTHON_DEPS}
94 - !<sec-policy/selinux-base-policy-2.20151208-r6"
95 -# 2.20151208-r6 and higher has support for new setfiles
96 -
97 -### libcgroup -> seunshare
98 -### dbus -> restorecond
99 -
100 -# pax-utils for scanelf used by rlpkg
101 -RDEPEND="${DEPEND}
102 - app-misc/pax-utils
103 - !<sys-apps/openrc-0.14"
104 -
105 -PDEPEND="sys-apps/semodule-utils
106 - sys-apps/selinux-python"
107 -
108 -src_unpack() {
109 - # Override default one because we need the SRC_URI ones even in case of 9999 ebuilds
110 - default
111 - if [[ ${PV} == 9999 ]] ; then
112 - git-r3_src_unpack
113 - fi
114 -}
115 -
116 -src_prepare() {
117 - S="${S1}"
118 - cd "${S}" || die "Failed to switch to ${S}"
119 - if [[ ${PV} != 9999 ]] ; then
120 - # If needed for live ebuilds please use /etc/portage/patches
121 - eapply "${FILESDIR}/policycoreutils-2.7-0001-newrole-not-suid.patch"
122 - fi
123 -
124 - # rlpkg is more useful than fixfiles
125 - sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
126 - || die "fixfiles sed 1 failed"
127 - sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
128 - || die "fixfiles sed 2 failed"
129 -
130 - eapply_user
131 -
132 - sed -i 's/-Werror//g' "${S1}"/*/Makefile || die "Failed to remove Werror"
133 -
134 - python_copy_sources
135 - # Our extra code is outside the regular directory, so set it to the extra
136 - # directory. We really should optimize this as it is ugly, but the extra
137 - # code is needed for Gentoo at the same time that policycoreutils is present
138 - # (so we cannot use an additional package for now).
139 - S="${S2}"
140 - python_copy_sources
141 -}
142 -
143 -src_compile() {
144 - building() {
145 - emake -C "${BUILD_DIR}" \
146 - AUDIT_LOG_PRIVS="y" \
147 - AUDITH="$(usex audit y n)" \
148 - PAMH="$(usex pam y n)" \
149 - INOTIFYH="$(usex dbus y n)" \
150 - SESANDBOX="n" \
151 - CC="$(tc-getCC)" \
152 - PYLIBVER="${EPYTHON}" \
153 - LIBDIR="\$(PREFIX)/$(get_libdir)"
154 - }
155 - S="${S1}" # Regular policycoreutils
156 - python_foreach_impl building
157 - S="${S2}" # Extra set
158 - python_foreach_impl building
159 -}
160 -
161 -src_install() {
162 - # Python scripts are present in many places. There are no extension modules.
163 - installation-policycoreutils() {
164 - einfo "Installing policycoreutils"
165 - emake -C "${BUILD_DIR}" DESTDIR="${D}" \
166 - AUDITH="$(usex audit y n)" \
167 - PAMH="$(usex pam y n)" \
168 - INOTIFYH="$(usex dbus y n)" \
169 - SESANDBOX="n" \
170 - AUDIT_LOG_PRIV="y" \
171 - LIBDIR="\$(PREFIX)/$(get_libdir)" \
172 - install
173 - python_optimize
174 - }
175 -
176 - installation-extras() {
177 - einfo "Installing policycoreutils-extra"
178 - emake -C "${BUILD_DIR}" \
179 - DESTDIR="${D}" \
180 - INOTIFYH="$(usex dbus)" \
181 - SHLIBDIR="${D}$(get_libdir)/rc" \
182 - install
183 - python_optimize
184 - }
185 -
186 - S="${S1}" # policycoreutils
187 - python_foreach_impl installation-policycoreutils
188 - S="${S2}" # extras
189 - python_foreach_impl installation-extras
190 - S="${S1}" # back for later
191 -
192 - # remove redhat-style init script
193 - rm -fR "${D}/etc/rc.d" || die
194 -
195 - # compatibility symlinks
196 - dosym /sbin/setfiles /usr/sbin/setfiles
197 - bashcomp_alias setsebool getsebool
198 -
199 - # location for policy definitions
200 - dodir /var/lib/selinux
201 - keepdir /var/lib/selinux
202 -
203 - # Set version-specific scripts
204 - for pyscript in rlpkg; do
205 - python_replicate_script "${ED}/usr/sbin/${pyscript}"
206 - done
207 -}
208 -
209 -pkg_postinst() {
210 - for POLICY_TYPE in ${POLICY_TYPES} ; do
211 - # There have been some changes to the policy store, rebuilding now.
212 - # https://marc.info/?l=selinux&m=143757277819717&w=2
213 - einfo "Rebuilding store ${POLICY_TYPE} (without re-loading)."
214 - semodule -s "${POLICY_TYPE}" -n -B || die "Failed to rebuild policy store ${POLICY_TYPE}"
215 - done
216 -}
217
218 diff --git a/sys-apps/policycoreutils/policycoreutils-2.8.ebuild b/sys-apps/policycoreutils/policycoreutils-2.8.ebuild
219 deleted file mode 100644
220 index 336f99c3789..00000000000
221 --- a/sys-apps/policycoreutils/policycoreutils-2.8.ebuild
222 +++ /dev/null
223 @@ -1,178 +0,0 @@
224 -# Copyright 1999-2019 Gentoo Authors
225 -# Distributed under the terms of the GNU General Public License v2
226 -
227 -EAPI="6"
228 -PYTHON_COMPAT=( python{2_7,3_5,3_6} )
229 -PYTHON_REQ_USE="xml"
230 -
231 -inherit multilib python-r1 toolchain-funcs bash-completion-r1
232 -
233 -MY_P="${P//_/-}"
234 -
235 -MY_RELEASEDATE="20180524"
236 -EXTRAS_VER="1.36"
237 -SEMNG_VER="${PV}"
238 -SELNX_VER="${PV}"
239 -SEPOL_VER="${PV}"
240 -
241 -IUSE="audit pam dbus"
242 -REQUIRED_USE="${PYTHON_REQUIRED_USE}"
243 -
244 -DESCRIPTION="SELinux core utilities"
245 -HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
246 -
247 -if [[ ${PV} == 9999 ]]; then
248 - inherit git-r3
249 - EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
250 - SRC_URI="https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
251 - S1="${WORKDIR}/${MY_P}/${PN}"
252 - S2="${WORKDIR}/policycoreutils-extra"
253 - S="${S1}"
254 -else
255 - SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz
256 - https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
257 - KEYWORDS="amd64 ~arm64 ~mips x86"
258 - S1="${WORKDIR}/${MY_P}"
259 - S2="${WORKDIR}/policycoreutils-extra"
260 - S="${S1}"
261 -fi
262 -
263 -LICENSE="GPL-2"
264 -SLOT="0"
265 -
266 -DEPEND=">=sys-libs/libselinux-${SELNX_VER}:=[python,${PYTHON_USEDEP}]
267 - >=sys-libs/libcap-1.10-r10:=
268 - >=sys-libs/libsemanage-${SEMNG_VER}:=[python,${PYTHON_USEDEP}]
269 - sys-libs/libcap-ng:=
270 - >=sys-libs/libsepol-${SEPOL_VER}:=
271 - >=app-admin/setools-4.1.1[${PYTHON_USEDEP}]
272 - sys-devel/gettext
273 - dev-python/ipy[${PYTHON_USEDEP}]
274 - dbus? (
275 - sys-apps/dbus
276 - dev-libs/dbus-glib:=
277 - )
278 - audit? ( >=sys-process/audit-1.5.1[python,${PYTHON_USEDEP}] )
279 - pam? ( sys-libs/pam:= )
280 - ${PYTHON_DEPS}
281 - !<sec-policy/selinux-base-policy-2.20151208-r6"
282 -# 2.20151208-r6 and higher has support for new setfiles
283 -
284 -### libcgroup -> seunshare
285 -### dbus -> restorecond
286 -
287 -# pax-utils for scanelf used by rlpkg
288 -RDEPEND="${DEPEND}
289 - app-misc/pax-utils
290 - !<sys-apps/openrc-0.14"
291 -
292 -PDEPEND="sys-apps/semodule-utils
293 - sys-apps/selinux-python"
294 -
295 -src_unpack() {
296 - # Override default one because we need the SRC_URI ones even in case of 9999 ebuilds
297 - default
298 - if [[ ${PV} == 9999 ]] ; then
299 - git-r3_src_unpack
300 - fi
301 -}
302 -
303 -src_prepare() {
304 - S="${S1}"
305 - cd "${S}" || die "Failed to switch to ${S}"
306 - if [[ ${PV} != 9999 ]] ; then
307 - # If needed for live ebuilds please use /etc/portage/patches
308 - eapply "${FILESDIR}/policycoreutils-2.7-0001-newrole-not-suid.patch"
309 - fi
310 -
311 - # rlpkg is more useful than fixfiles
312 - sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
313 - || die "fixfiles sed 1 failed"
314 - sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
315 - || die "fixfiles sed 2 failed"
316 -
317 - eapply_user
318 -
319 - sed -i 's/-Werror//g' "${S1}"/*/Makefile || die "Failed to remove Werror"
320 -
321 - python_copy_sources
322 - # Our extra code is outside the regular directory, so set it to the extra
323 - # directory. We really should optimize this as it is ugly, but the extra
324 - # code is needed for Gentoo at the same time that policycoreutils is present
325 - # (so we cannot use an additional package for now).
326 - S="${S2}"
327 - python_copy_sources
328 -}
329 -
330 -src_compile() {
331 - building() {
332 - emake -C "${BUILD_DIR}" \
333 - AUDIT_LOG_PRIVS="y" \
334 - AUDITH="$(usex audit y n)" \
335 - PAMH="$(usex pam y n)" \
336 - INOTIFYH="$(usex dbus y n)" \
337 - SESANDBOX="n" \
338 - CC="$(tc-getCC)" \
339 - LIBDIR="\$(PREFIX)/$(get_libdir)"
340 - }
341 - S="${S1}" # Regular policycoreutils
342 - python_foreach_impl building
343 - S="${S2}" # Extra set
344 - python_foreach_impl building
345 -}
346 -
347 -src_install() {
348 - # Python scripts are present in many places. There are no extension modules.
349 - installation-policycoreutils() {
350 - einfo "Installing policycoreutils"
351 - emake -C "${BUILD_DIR}" DESTDIR="${D}" \
352 - AUDIT_LOG_PRIVS="y" \
353 - AUDITH="$(usex audit y n)" \
354 - PAMH="$(usex pam y n)" \
355 - INOTIFYH="$(usex dbus y n)" \
356 - SESANDBOX="n" \
357 - CC="$(tc-getCC)" \
358 - LIBDIR="\$(PREFIX)/$(get_libdir)" \
359 - install
360 - python_optimize
361 - }
362 -
363 - installation-extras() {
364 - einfo "Installing policycoreutils-extra"
365 - emake -C "${BUILD_DIR}" \
366 - DESTDIR="${D}" \
367 - install
368 - python_optimize
369 - }
370 -
371 - S="${S1}" # policycoreutils
372 - python_foreach_impl installation-policycoreutils
373 - S="${S2}" # extras
374 - python_foreach_impl installation-extras
375 - S="${S1}" # back for later
376 -
377 - # remove redhat-style init script
378 - rm -fR "${D}/etc/rc.d" || die
379 -
380 - # compatibility symlinks
381 - dosym /sbin/setfiles /usr/sbin/setfiles
382 - bashcomp_alias setsebool getsebool
383 -
384 - # location for policy definitions
385 - dodir /var/lib/selinux
386 - keepdir /var/lib/selinux
387 -
388 - # Set version-specific scripts
389 - for pyscript in rlpkg; do
390 - python_replicate_script "${ED}/usr/sbin/${pyscript}"
391 - done
392 -}
393 -
394 -pkg_postinst() {
395 - for POLICY_TYPE in ${POLICY_TYPES} ; do
396 - # There have been some changes to the policy store, rebuilding now.
397 - # https://marc.info/?l=selinux&m=143757277819717&w=2
398 - einfo "Rebuilding store ${POLICY_TYPE} (without re-loading)."
399 - semodule -s "${POLICY_TYPE}" -n -B || die "Failed to rebuild policy store ${POLICY_TYPE}"
400 - done
401 -}
402
403 diff --git a/sys-apps/policycoreutils/policycoreutils-2.9_rc1.ebuild b/sys-apps/policycoreutils/policycoreutils-2.9_rc1.ebuild
404 deleted file mode 100644
405 index 09b451dfda9..00000000000
406 --- a/sys-apps/policycoreutils/policycoreutils-2.9_rc1.ebuild
407 +++ /dev/null
408 @@ -1,178 +0,0 @@
409 -# Copyright 1999-2019 Gentoo Authors
410 -# Distributed under the terms of the GNU General Public License v2
411 -
412 -EAPI="6"
413 -PYTHON_COMPAT=( python{3_5,3_6} )
414 -PYTHON_REQ_USE="xml"
415 -
416 -inherit multilib python-r1 toolchain-funcs bash-completion-r1
417 -
418 -MY_P="${P//_/-}"
419 -
420 -MY_RELEASEDATE="20190125"
421 -EXTRAS_VER="1.36"
422 -SEMNG_VER="${PV}"
423 -SELNX_VER="${PV}"
424 -SEPOL_VER="${PV}"
425 -
426 -IUSE="audit pam dbus"
427 -REQUIRED_USE="${PYTHON_REQUIRED_USE}"
428 -
429 -DESCRIPTION="SELinux core utilities"
430 -HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
431 -
432 -if [[ ${PV} == 9999 ]]; then
433 - inherit git-r3
434 - EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
435 - SRC_URI="https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
436 - S1="${WORKDIR}/${MY_P}/${PN}"
437 - S2="${WORKDIR}/policycoreutils-extra"
438 - S="${S1}"
439 -else
440 - SRC_URI="https://github.com/SELinuxProject/selinux/releases/download/${MY_RELEASEDATE}/${MY_P}.tar.gz
441 - https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
442 - KEYWORDS="~amd64 ~arm64 ~mips ~x86"
443 - S1="${WORKDIR}/${MY_P}"
444 - S2="${WORKDIR}/policycoreutils-extra"
445 - S="${S1}"
446 -fi
447 -
448 -LICENSE="GPL-2"
449 -SLOT="0"
450 -
451 -DEPEND=">=sys-libs/libselinux-${SELNX_VER}:=[python,${PYTHON_USEDEP}]
452 - >=sys-libs/libcap-1.10-r10:=
453 - >=sys-libs/libsemanage-${SEMNG_VER}:=[python,${PYTHON_USEDEP}]
454 - sys-libs/libcap-ng:=
455 - >=sys-libs/libsepol-${SEPOL_VER}:=
456 - >=app-admin/setools-4.2.0[${PYTHON_USEDEP}]
457 - sys-devel/gettext
458 - dev-python/ipy[${PYTHON_USEDEP}]
459 - dbus? (
460 - sys-apps/dbus
461 - dev-libs/dbus-glib:=
462 - )
463 - audit? ( >=sys-process/audit-1.5.1[python,${PYTHON_USEDEP}] )
464 - pam? ( sys-libs/pam:= )
465 - ${PYTHON_DEPS}
466 - !<sec-policy/selinux-base-policy-2.20151208-r6"
467 -# 2.20151208-r6 and higher has support for new setfiles
468 -
469 -### libcgroup -> seunshare
470 -### dbus -> restorecond
471 -
472 -# pax-utils for scanelf used by rlpkg
473 -RDEPEND="${DEPEND}
474 - app-misc/pax-utils
475 - !<sys-apps/openrc-0.14"
476 -
477 -PDEPEND="sys-apps/semodule-utils
478 - sys-apps/selinux-python"
479 -
480 -src_unpack() {
481 - # Override default one because we need the SRC_URI ones even in case of 9999 ebuilds
482 - default
483 - if [[ ${PV} == 9999 ]] ; then
484 - git-r3_src_unpack
485 - fi
486 -}
487 -
488 -src_prepare() {
489 - S="${S1}"
490 - cd "${S}" || die "Failed to switch to ${S}"
491 - if [[ ${PV} != 9999 ]] ; then
492 - # If needed for live ebuilds please use /etc/portage/patches
493 - eapply "${FILESDIR}/policycoreutils-2.7-0001-newrole-not-suid.patch"
494 - fi
495 -
496 - # rlpkg is more useful than fixfiles
497 - sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
498 - || die "fixfiles sed 1 failed"
499 - sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
500 - || die "fixfiles sed 2 failed"
501 -
502 - eapply_user
503 -
504 - sed -i 's/-Werror//g' "${S1}"/*/Makefile || die "Failed to remove Werror"
505 -
506 - python_copy_sources
507 - # Our extra code is outside the regular directory, so set it to the extra
508 - # directory. We really should optimize this as it is ugly, but the extra
509 - # code is needed for Gentoo at the same time that policycoreutils is present
510 - # (so we cannot use an additional package for now).
511 - S="${S2}"
512 - python_copy_sources
513 -}
514 -
515 -src_compile() {
516 - building() {
517 - emake -C "${BUILD_DIR}" \
518 - AUDIT_LOG_PRIVS="y" \
519 - AUDITH="$(usex audit y n)" \
520 - PAMH="$(usex pam y n)" \
521 - INOTIFYH="$(usex dbus y n)" \
522 - SESANDBOX="n" \
523 - CC="$(tc-getCC)" \
524 - LIBDIR="\$(PREFIX)/$(get_libdir)"
525 - }
526 - S="${S1}" # Regular policycoreutils
527 - python_foreach_impl building
528 - S="${S2}" # Extra set
529 - python_foreach_impl building
530 -}
531 -
532 -src_install() {
533 - # Python scripts are present in many places. There are no extension modules.
534 - installation-policycoreutils() {
535 - einfo "Installing policycoreutils"
536 - emake -C "${BUILD_DIR}" DESTDIR="${D}" \
537 - AUDIT_LOG_PRIVS="y" \
538 - AUDITH="$(usex audit y n)" \
539 - PAMH="$(usex pam y n)" \
540 - INOTIFYH="$(usex dbus y n)" \
541 - SESANDBOX="n" \
542 - CC="$(tc-getCC)" \
543 - LIBDIR="\$(PREFIX)/$(get_libdir)" \
544 - install
545 - python_optimize
546 - }
547 -
548 - installation-extras() {
549 - einfo "Installing policycoreutils-extra"
550 - emake -C "${BUILD_DIR}" \
551 - DESTDIR="${D}" \
552 - install
553 - python_optimize
554 - }
555 -
556 - S="${S1}" # policycoreutils
557 - python_foreach_impl installation-policycoreutils
558 - S="${S2}" # extras
559 - python_foreach_impl installation-extras
560 - S="${S1}" # back for later
561 -
562 - # remove redhat-style init script
563 - rm -fR "${D}/etc/rc.d" || die
564 -
565 - # compatibility symlinks
566 - dosym /sbin/setfiles /usr/sbin/setfiles
567 - bashcomp_alias setsebool getsebool
568 -
569 - # location for policy definitions
570 - dodir /var/lib/selinux
571 - keepdir /var/lib/selinux
572 -
573 - # Set version-specific scripts
574 - for pyscript in rlpkg; do
575 - python_replicate_script "${ED}/usr/sbin/${pyscript}"
576 - done
577 -}
578 -
579 -pkg_postinst() {
580 - for POLICY_TYPE in ${POLICY_TYPES} ; do
581 - # There have been some changes to the policy store, rebuilding now.
582 - # https://marc.info/?l=selinux&m=143757277819717&w=2
583 - einfo "Rebuilding store ${POLICY_TYPE} (without re-loading)."
584 - semodule -s "${POLICY_TYPE}" -n -B || die "Failed to rebuild policy store ${POLICY_TYPE}"
585 - done
586 -}