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/files/, sys-apps/policycoreutils/
Date: Fri, 02 Mar 2018 06:27:38
Message-Id: 1519970782.bdc01316917d5975eff7b9a767b9c2fe7f2e3196.perfinion@gentoo
1 commit: bdc01316917d5975eff7b9a767b9c2fe7f2e3196
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Thu Mar 1 15:43:53 2018 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 2 06:06:22 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdc01316
7
8 sys-apps/policycoreutils: drop 2.6
9
10 Package-Manager: Portage-2.3.19, Repoman-2.3.6
11
12 sys-apps/policycoreutils/Manifest | 2 -
13 .../files/0010-remove-sesandbox-support.patch | 9 -
14 ...20-disable-autodetection-of-pam-and-audit.patch | 108 ------------
15 ...030-make-inotify-check-use-flag-triggered.patch | 14 --
16 ...ttempt-fails-with-gentoo-sandbox-approach.patch | 11 --
17 .../files/0110-build-mcstrans-bug-472912.patch | 64 -------
18 ...ailure-for-mcscolor-for-CONTEXT__CONTAINS.patch | 11 --
19 .../policycoreutils/policycoreutils-2.6-r1.ebuild | 187 ---------------------
20 8 files changed, 406 deletions(-)
21
22 diff --git a/sys-apps/policycoreutils/Manifest b/sys-apps/policycoreutils/Manifest
23 index ed6789183b4..38aec9564a6 100644
24 --- a/sys-apps/policycoreutils/Manifest
25 +++ b/sys-apps/policycoreutils/Manifest
26 @@ -1,4 +1,2 @@
27 -DIST policycoreutils-2.6.tar.gz 4660087 BLAKE2B 26ea03db8552b5ad3967acb6912dde0f332315f93682e65e3f6461f19efdc4ec1444c219a946e3172283078012961c0a39bb77203e20544e6c4de48c7a6fa0f9 SHA512 ba289060bc348f9315bce84a5e5daf145600274289fdd2206edc10bb0ee03f9b02a9e40e9c118809961ddfe7844dee7d8952d8c9a239af7282f4fc1614c21e9d
28 DIST policycoreutils-2.7.tar.gz 2796707 BLAKE2B 4b1c03f2d12252b453950c3d6bcde75780926a1b91263d3881f741399c5630c707f0429b9b144c657b017b7b0c1500b63b6463610dea3caaef8c2f7c3f69fd8f SHA512 ce97d659f72058fd23d8dab8db98fc7c0003806a636c521fa15da465d7358d40ccc8e3eaa9675f00a9b0b8aaa1465d3fb650bc0ebbbf00164e121230673256fb
29 -DIST policycoreutils-extra-1.35.tar.bz2 12124 BLAKE2B 78e9651a1d8aa1747ef6a4dfd657e27a1b22e13d6ae36cabbfe8bd80986770a6f3638232db6b56f730cf379e85239e4a945cea4946553d07f18e1e9d1467996f SHA512 8cc3c74afee7ec38d7d085744fdd60849d3ae97a75599d2181b12b5b472a6a4445868e8a6aff707e439c10d9c378fb55e329b4db21c0a771f41180bf3b9eabc1
30 DIST policycoreutils-extra-1.36.tar.bz2 8830 BLAKE2B 6d98e41ea379d3e95221a6e53d8a8b144e4e15ca5581381e76a529dbbaca304d5587b30419797c8c70cbd7c2b2588e5ecd62adcf97294e429950899c1c318346 SHA512 c6a18e6fb2d65f51dc55b88907f23241f2fbfc033d3d2888b109596d9ed31d509b2c93456727ea4d1f98544831afb15c449ff72d6aedf93b9e474b27817f7fb3
31
32 diff --git a/sys-apps/policycoreutils/files/0010-remove-sesandbox-support.patch b/sys-apps/policycoreutils/files/0010-remove-sesandbox-support.patch
33 deleted file mode 100644
34 index 52a34bd1f47..00000000000
35 --- a/sys-apps/policycoreutils/files/0010-remove-sesandbox-support.patch
36 +++ /dev/null
37 @@ -1,9 +0,0 @@
38 -diff -uNr policycoreutils-2.4-rc2.orig/Makefile policycoreutils-2.4-rc2/Makefile
39 ---- policycoreutils-2.4-rc2.orig/Makefile 2014-08-28 20:13:23.212622408 +0200
40 -+++ policycoreutils-2.4-rc2/Makefile 2014-08-28 20:14:24.136624808 +0200
41 -@@ -1,4 +1,4 @@
42 --SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init sandbox secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll
43 -+SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll
44 -
45 - INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null)
46 -
47
48 diff --git a/sys-apps/policycoreutils/files/0020-disable-autodetection-of-pam-and-audit.patch b/sys-apps/policycoreutils/files/0020-disable-autodetection-of-pam-and-audit.patch
49 deleted file mode 100644
50 index a3eeaed901d..00000000000
51 --- a/sys-apps/policycoreutils/files/0020-disable-autodetection-of-pam-and-audit.patch
52 +++ /dev/null
53 @@ -1,108 +0,0 @@
54 -diff -uNr policycoreutils-2.2.1.orig/newrole/Makefile policycoreutils-2.2.1/newrole/Makefile
55 ---- policycoreutils-2.2.1.orig/newrole/Makefile 2013-11-04 21:37:27.197018032 +0100
56 -+++ policycoreutils-2.2.1/newrole/Makefile 2013-11-04 21:37:47.602018075 +0100
57 -@@ -4,8 +4,8 @@
58 - MANDIR ?= $(PREFIX)/share/man
59 - ETCDIR ?= $(DESTDIR)/etc
60 - LOCALEDIR = /usr/share/locale
61 --PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
62 --AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
63 -+PAMH ?= no
64 -+AUDITH ?= no
65 - # Enable capabilities to permit newrole to generate audit records.
66 - # This will make newrole a setuid root program.
67 - # The capabilities used are: CAP_AUDIT_WRITE.
68 -@@ -24,7 +24,7 @@
69 - EXTRA_OBJS =
70 - override CFLAGS += -DVERSION=\"$(VERSION)\" $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
71 - LDLIBS += -lselinux -L$(PREFIX)/lib
72 --ifeq ($(PAMH), /usr/include/security/pam_appl.h)
73 -+ifeq ($(PAMH), yes)
74 - override CFLAGS += -DUSE_PAM
75 - EXTRA_OBJS += hashtab.o
76 - LDLIBS += -lpam -lpam_misc
77 -@@ -32,7 +32,7 @@
78 - override CFLAGS += -D_XOPEN_SOURCE=500
79 - LDLIBS += -lcrypt
80 - endif
81 --ifeq ($(AUDITH), /usr/include/libaudit.h)
82 -+ifeq ($(AUDITH), yes)
83 - override CFLAGS += -DUSE_AUDIT
84 - LDLIBS += -laudit
85 - endif
86 -@@ -49,7 +49,7 @@
87 - IS_SUID=y
88 - endif
89 - ifeq ($(IS_SUID),y)
90 -- MODE := 4555
91 -+ MODE := 0555
92 - LDLIBS += -lcap-ng
93 - else
94 - MODE := 0555
95 -@@ -66,7 +66,7 @@
96 - test -d $(MANDIR)/man1 || install -m 755 -d $(MANDIR)/man1
97 - install -m $(MODE) newrole $(BINDIR)
98 - install -m 644 newrole.1 $(MANDIR)/man1/
99 --ifeq ($(PAMH), /usr/include/security/pam_appl.h)
100 -+ifeq ($(PAMH), yes)
101 - test -d $(ETCDIR)/pam.d || install -m 755 -d $(ETCDIR)/pam.d
102 - ifeq ($(LSPP_PRIV),y)
103 - install -m 644 newrole-lspp.pamd $(ETCDIR)/pam.d/newrole
104 -diff -uNr policycoreutils-2.2.1.orig/run_init/Makefile policycoreutils-2.2.1/run_init/Makefile
105 ---- policycoreutils-2.2.1.orig/run_init/Makefile 2013-11-04 21:37:27.115018032 +0100
106 -+++ policycoreutils-2.2.1/run_init/Makefile 2013-11-04 21:37:47.603018075 +0100
107 -@@ -5,20 +5,20 @@
108 - MANDIR ?= $(PREFIX)/share/man
109 - ETCDIR ?= $(DESTDIR)/etc
110 - LOCALEDIR ?= /usr/share/locale
111 --PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
112 --AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
113 -+PAMH ?= no
114 -+AUDITH ?= no
115 -
116 - CFLAGS ?= -Werror -Wall -W
117 - override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
118 - LDLIBS += -lselinux -L$(PREFIX)/lib
119 --ifeq ($(PAMH), /usr/include/security/pam_appl.h)
120 -+ifeq ($(PAMH), yes)
121 - override CFLAGS += -DUSE_PAM
122 - LDLIBS += -lpam -lpam_misc
123 - else
124 - override CFLAGS += -D_XOPEN_SOURCE=500
125 - LDLIBS += -lcrypt
126 - endif
127 --ifeq ($(AUDITH), /usr/include/libaudit.h)
128 -+ifeq ($(AUDITH), yes)
129 - override CFLAGS += -DUSE_AUDIT
130 - LDLIBS += -laudit
131 - endif
132 -@@ -38,7 +38,7 @@
133 - install -m 755 open_init_pty $(SBINDIR)
134 - install -m 644 run_init.8 $(MANDIR)/man8/
135 - install -m 644 open_init_pty.8 $(MANDIR)/man8/
136 --ifeq ($(PAMH), /usr/include/security/pam_appl.h)
137 -+ifeq ($(PAMH), yes)
138 - install -m 644 run_init.pamd $(ETCDIR)/pam.d/run_init
139 - endif
140 -
141 -diff -uNr policycoreutils-2.2.1.orig/setfiles/Makefile policycoreutils-2.2.1/setfiles/Makefile
142 ---- policycoreutils-2.2.1.orig/setfiles/Makefile 2013-11-04 21:37:27.198018032 +0100
143 -+++ policycoreutils-2.2.1/setfiles/Makefile 2013-11-04 21:37:47.603018075 +0100
144 -@@ -3,7 +3,7 @@
145 - SBINDIR ?= $(DESTDIR)/sbin
146 - MANDIR = $(PREFIX)/share/man
147 - LIBDIR ?= $(PREFIX)/lib
148 --AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
149 -+AUDITH ?= no
150 -
151 - PROGRESS_STEP=$(shell grep "^\#define STAR_COUNT" restore.h | awk -S '{ print $$3 }')
152 - ABORT_ON_ERRORS=$(shell grep "^\#define ABORT_ON_ERRORS" setfiles.c | awk -S '{ print $$3 }')
153 -@@ -12,7 +12,7 @@
154 - override CFLAGS += -I$(PREFIX)/include
155 - LDLIBS = -lselinux -lsepol -L$(LIBDIR)
156 -
157 --ifeq ($(AUDITH), /usr/include/libaudit.h)
158 -+ifeq ($(AUDITH), yes)
159 - override CFLAGS += -DUSE_AUDIT
160 - LDLIBS += -laudit
161 - endif
162
163 diff --git a/sys-apps/policycoreutils/files/0030-make-inotify-check-use-flag-triggered.patch b/sys-apps/policycoreutils/files/0030-make-inotify-check-use-flag-triggered.patch
164 deleted file mode 100644
165 index 6a31e255a95..00000000000
166 --- a/sys-apps/policycoreutils/files/0030-make-inotify-check-use-flag-triggered.patch
167 +++ /dev/null
168 @@ -1,14 +0,0 @@
169 -diff -uNr policycoreutils-2.4-rc2.orig/Makefile policycoreutils-2.4-rc2/Makefile
170 ---- policycoreutils-2.4-rc2.orig/Makefile 2014-08-28 20:22:45.230644554 +0200
171 -+++ policycoreutils-2.4-rc2/Makefile 2014-08-28 20:27:08.642654934 +0200
172 -@@ -1,8 +1,8 @@
173 - SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll
174 -
175 --INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null)
176 -+INOTIFYH ?= no
177 -
178 --ifeq (${INOTIFYH}, /usr/include/sys/inotify.h)
179 -+ifeq (${INOTIFYH}, yes)
180 - SUBDIRS += restorecond
181 - endif
182 -
183
184 diff --git a/sys-apps/policycoreutils/files/0070-remove-symlink-attempt-fails-with-gentoo-sandbox-approach.patch b/sys-apps/policycoreutils/files/0070-remove-symlink-attempt-fails-with-gentoo-sandbox-approach.patch
185 deleted file mode 100644
186 index 7d438983bb7..00000000000
187 --- a/sys-apps/policycoreutils/files/0070-remove-symlink-attempt-fails-with-gentoo-sandbox-approach.patch
188 +++ /dev/null
189 @@ -1,11 +0,0 @@
190 -diff -uNr policycoreutils-2.2.1.orig/load_policy/Makefile policycoreutils-2.2.1/load_policy/Makefile
191 ---- policycoreutils-2.2.1.orig/load_policy/Makefile 2013-11-04 21:41:28.289018546 +0100
192 -+++ policycoreutils-2.2.1/load_policy/Makefile 2013-11-04 21:43:31.118018808 +0100
193 -@@ -19,7 +19,6 @@
194 - test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8
195 - install -m 644 load_policy.8 $(MANDIR)/man8/
196 - -mkdir -p $(USRSBINDIR)
197 -- -ln -sf $(SBINDIR)/load_policy $(USRSBINDIR)/load_policy
198 -
199 - clean:
200 - -rm -f $(TARGETS) *.o
201
202 diff --git a/sys-apps/policycoreutils/files/0110-build-mcstrans-bug-472912.patch b/sys-apps/policycoreutils/files/0110-build-mcstrans-bug-472912.patch
203 deleted file mode 100644
204 index 68033c705cd..00000000000
205 --- a/sys-apps/policycoreutils/files/0110-build-mcstrans-bug-472912.patch
206 +++ /dev/null
207 @@ -1,64 +0,0 @@
208 -diff -uNr policycoreutils-2.4-rc2.orig/Makefile policycoreutils-2.4-rc2/Makefile
209 ---- policycoreutils-2.4-rc2.orig/Makefile 2014-08-28 20:31:19.563664821 +0200
210 -+++ policycoreutils-2.4-rc2/Makefile 2014-08-28 20:32:25.900667435 +0200
211 -@@ -1,4 +1,4 @@
212 --SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll
213 -+SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll mcstrans
214 -
215 - INOTIFYH ?= n
216 -
217 -diff -uNr policycoreutils-2.4-rc2.orig/mcstrans/src/Makefile policycoreutils-2.4-rc2/mcstrans/src/Makefile
218 ---- policycoreutils-2.4-rc2.orig/mcstrans/src/Makefile 2014-08-28 20:31:19.562664821 +0200
219 -+++ policycoreutils-2.4-rc2/mcstrans/src/Makefile 2014-08-28 20:33:39.345670329 +0200
220 -@@ -1,23 +1,10 @@
221 - ARCH = $(shell uname -i)
222 --ifeq "$(ARCH)" "x86_64"
223 -- # In case of 64 bit system, use these lines
224 -- LIBDIR=/usr/lib64
225 --else
226 --ifeq "$(ARCH)" "i686"
227 -- # In case of 32 bit system, use these lines
228 -- LIBDIR=/usr/lib
229 --else
230 --ifeq "$(ARCH)" "i386"
231 -- # In case of 32 bit system, use these lines
232 -- LIBDIR=/usr/lib
233 --endif
234 --endif
235 --endif
236 - # Installation directories.
237 - PREFIX ?= $(DESTDIR)/usr
238 - SBINDIR ?= $(DESTDIR)/sbin
239 - INITDIR ?= $(DESTDIR)/etc/rc.d/init.d
240 - SYSTEMDDIR ?= $(DESTDIR)/usr/lib/systemd
241 -+LIBDIR ?= $(PREFIX)/lib
242 -
243 - PROG_SRC=mcstrans.c mcscolor.c mcstransd.c mls_level.c
244 - PROG_OBJS= $(patsubst %.c,%.o,$(PROG_SRC))
245 -diff -uNr policycoreutils-2.4-rc2.orig/mcstrans/utils/Makefile policycoreutils-2.4-rc2/mcstrans/utils/Makefile
246 ---- policycoreutils-2.4-rc2.orig/mcstrans/utils/Makefile 2014-08-28 20:31:19.556664821 +0200
247 -+++ policycoreutils-2.4-rc2/mcstrans/utils/Makefile 2014-08-28 20:34:14.145671701 +0200
248 -@@ -3,22 +3,7 @@
249 - BINDIR ?= $(PREFIX)/sbin
250 -
251 - ARCH = $(shell uname -i)
252 --ifeq "$(ARCH)" "x86_64"
253 -- # In case of 64 bit system, use these lines
254 -- LIBDIR=/usr/lib64
255 --else
256 --ifeq "$(ARCH)" "i686"
257 -- # In case of 32 bit system, use these lines
258 -- LIBDIR=/usr/lib
259 --else
260 --ifeq "$(ARCH)" "i386"
261 -- # In case of 32 bit system, use these lines
262 -- LIBDIR=/usr/lib
263 --endif
264 --endif
265 --endif
266 --
267 --
268 -+LIBDIR ?= $(PREFIX)/lib
269 - CFLAGS ?= -Wall
270 - override CFLAGS += -I../src -D_GNU_SOURCE
271 - LDLIBS += -L../src ../src/mcstrans.o ../src/mls_level.o -lselinux -lpcre $(LIBDIR)/libsepol.a
272
273 diff --git a/sys-apps/policycoreutils/files/0120-build-failure-for-mcscolor-for-CONTEXT__CONTAINS.patch b/sys-apps/policycoreutils/files/0120-build-failure-for-mcscolor-for-CONTEXT__CONTAINS.patch
274 deleted file mode 100644
275 index cf50664264e..00000000000
276 --- a/sys-apps/policycoreutils/files/0120-build-failure-for-mcscolor-for-CONTEXT__CONTAINS.patch
277 +++ /dev/null
278 @@ -1,11 +0,0 @@
279 -diff -uNr policycoreutils-2.4-rc2.orig/mcstrans/src/mcscolor.c policycoreutils-2.4-rc2/mcstrans/src/mcscolor.c
280 ---- policycoreutils-2.4-rc2.orig/mcstrans/src/mcscolor.c 2014-08-28 21:26:25.125795076 +0200
281 -+++ policycoreutils-2.4-rc2/mcstrans/src/mcscolor.c 2014-08-28 21:27:03.509796589 +0200
282 -@@ -11,6 +11,7 @@
283 - #include <syslog.h>
284 - #include <selinux/selinux.h>
285 - #include <selinux/context.h>
286 -+#include <selinux/av_permissions.h>
287 - #include "mcstrans.h"
288 -
289 - /* Define data structures */
290
291 diff --git a/sys-apps/policycoreutils/policycoreutils-2.6-r1.ebuild b/sys-apps/policycoreutils/policycoreutils-2.6-r1.ebuild
292 deleted file mode 100644
293 index 6a544ae2b9d..00000000000
294 --- a/sys-apps/policycoreutils/policycoreutils-2.6-r1.ebuild
295 +++ /dev/null
296 @@ -1,187 +0,0 @@
297 -# Copyright 1999-2017 Gentoo Foundation
298 -# Distributed under the terms of the GNU General Public License v2
299 -
300 -EAPI="6"
301 -PYTHON_COMPAT=( python{2_7,3_4,3_5} )
302 -PYTHON_REQ_USE="xml"
303 -
304 -inherit multilib python-r1 toolchain-funcs bash-completion-r1
305 -
306 -MY_P="${P//_/-}"
307 -
308 -MY_RELEASEDATE="20161014"
309 -EXTRAS_VER="1.35"
310 -SEMNG_VER="${PV}"
311 -SELNX_VER="${PV}"
312 -SEPOL_VER="${PV}"
313 -
314 -IUSE="audit pam dbus"
315 -REQUIRED_USE="${PYTHON_REQUIRED_USE}"
316 -
317 -DESCRIPTION="SELinux core utilities"
318 -HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
319 -
320 -if [[ ${PV} == 9999 ]] ; then
321 - inherit git-r3
322 - EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
323 - SRC_URI="https://dev.gentoo.org/~swift/distfiles/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
324 - S1="${WORKDIR}/${MY_P}/${PN}"
325 - S2="${WORKDIR}/policycoreutils-extra"
326 - S="${S1}"
327 -else
328 - SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz
329 - https://dev.gentoo.org/~swift/distfiles/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
330 - KEYWORDS="amd64 ~arm64 ~mips x86"
331 - S1="${WORKDIR}/${MY_P}"
332 - S2="${WORKDIR}/policycoreutils-extra"
333 - S="${S1}"
334 -fi
335 -
336 -LICENSE="GPL-2"
337 -SLOT="0"
338 -
339 -DEPEND=">=sys-libs/libselinux-${SELNX_VER}:=[python,${PYTHON_USEDEP}]
340 - >=sys-libs/glibc-2.4
341 - >=sys-libs/libcap-1.10-r10:=
342 - >=sys-libs/libsemanage-${SEMNG_VER}:=[python,${PYTHON_USEDEP}]
343 - sys-libs/libcap-ng:=
344 - >=sys-libs/libsepol-${SEPOL_VER}:=
345 - >=app-admin/setools-4.0[${PYTHON_USEDEP}]
346 - sys-devel/gettext
347 - dev-python/ipy[${PYTHON_USEDEP}]
348 - dbus? (
349 - sys-apps/dbus
350 - dev-libs/dbus-glib:=
351 - )
352 - audit? ( >=sys-process/audit-1.5.1[python,${PYTHON_USEDEP}] )
353 - pam? ( sys-libs/pam:= )
354 - ${PYTHON_DEPS}
355 - !<sec-policy/selinux-base-policy-2.20151208-r6"
356 -# 2.20151208-r6 and higher has support for new setfiles
357 -
358 -### libcgroup -> seunshare
359 -### dbus -> restorecond
360 -
361 -# pax-utils for scanelf used by rlpkg
362 -RDEPEND="${DEPEND}
363 - dev-python/sepolgen[${PYTHON_USEDEP}]
364 - app-misc/pax-utils
365 - !<sys-apps/openrc-0.14"
366 -
367 -src_unpack() {
368 - # Override default one because we need the SRC_URI ones even in case of 9999 ebuilds
369 - default
370 - if [[ ${PV} == 9999 ]] ; then
371 - git-r3_src_unpack
372 - fi
373 -}
374 -
375 -src_prepare() {
376 - S="${S1}"
377 - cd "${S}" || die "Failed to switch to ${S}"
378 - if [[ ${PV} != 9999 ]] ; then
379 - # If needed for live ebuilds please use /etc/portage/patches
380 - eapply "${FILESDIR}/0010-remove-sesandbox-support.patch"
381 - eapply "${FILESDIR}/0020-disable-autodetection-of-pam-and-audit.patch"
382 - eapply "${FILESDIR}/0030-make-inotify-check-use-flag-triggered.patch"
383 - eapply "${FILESDIR}/0070-remove-symlink-attempt-fails-with-gentoo-sandbox-approach.patch"
384 - eapply "${FILESDIR}/0110-build-mcstrans-bug-472912.patch"
385 - eapply "${FILESDIR}/0120-build-failure-for-mcscolor-for-CONTEXT__CONTAINS.patch"
386 - fi
387 -
388 - # rlpkg is more useful than fixfiles
389 - sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
390 - || die "fixfiles sed 1 failed"
391 - sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
392 - || die "fixfiles sed 2 failed"
393 -
394 - eapply_user
395 -
396 - sed -i 's/-Werror//g' "${S1}"/*/Makefile || die "Failed to remove Werror"
397 -
398 - python_copy_sources
399 - # Our extra code is outside the regular directory, so set it to the extra
400 - # directory. We really should optimize this as it is ugly, but the extra
401 - # code is needed for Gentoo at the same time that policycoreutils is present
402 - # (so we cannot use an additional package for now).
403 - S="${S2}"
404 - python_copy_sources
405 -}
406 -
407 -src_compile() {
408 - building() {
409 - emake -C "${BUILD_DIR}" \
410 - AUDIT_LOG_PRIVS="y" \
411 - AUDITH="$(usex audit)" \
412 - PAMH="$(usex pam)" \
413 - INOTIFYH="$(usex dbus)" \
414 - SESANDBOX="n" \
415 - CC="$(tc-getCC)" \
416 - PYLIBVER="${EPYTHON}" \
417 - LIBDIR="\$(PREFIX)/$(get_libdir)"
418 - }
419 - S="${S1}" # Regular policycoreutils
420 - python_foreach_impl building
421 - S="${S2}" # Extra set
422 - python_foreach_impl building
423 -}
424 -
425 -src_install() {
426 - # Python scripts are present in many places. There are no extension modules.
427 - installation-policycoreutils() {
428 - einfo "Installing policycoreutils"
429 - emake -C "${BUILD_DIR}" DESTDIR="${D}" \
430 - AUDITH="$(usex audit)" \
431 - PAMH="$(usex pam)" \
432 - INOTIFYH="$(usex dbus)" \
433 - SESANDBOX="n" \
434 - AUDIT_LOG_PRIV="y" \
435 - PYLIBVER="${EPYTHON}" \
436 - LIBDIR="\$(PREFIX)/$(get_libdir)" \
437 - install
438 - python_optimize
439 - }
440 -
441 - installation-extras() {
442 - einfo "Installing policycoreutils-extra"
443 - emake -C "${BUILD_DIR}" DESTDIR="${D}" INOTIFYH="$(usex dbus)" SHLIBDIR="${D}$(get_libdir)/rc" install
444 - python_optimize
445 - }
446 -
447 - S="${S1}" # policycoreutils
448 - python_foreach_impl installation-policycoreutils
449 - S="${S2}" # extras
450 - python_foreach_impl installation-extras
451 - S="${S1}" # back for later
452 -
453 - # remove redhat-style init script
454 - rm -fR "${D}/etc/rc.d" || die
455 -
456 - # compatibility symlinks
457 - dosym /sbin/setfiles /usr/sbin/setfiles
458 - bashcomp_alias setsebool getsebool
459 -
460 - # location for policy definitions
461 - dodir /var/lib/selinux
462 - keepdir /var/lib/selinux
463 -
464 - # Set version-specific scripts
465 - for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do
466 - python_replicate_script "${ED}/usr/bin/${pyscript}"
467 - done
468 - for pyscript in semanage rlpkg; do
469 - python_replicate_script "${ED}/usr/sbin/${pyscript}"
470 - done
471 -
472 - dodir /usr/share/doc/${PF}/mcstrans/examples
473 - cp -dR "${S1}"/mcstrans/share/examples/* "${D}/usr/share/doc/${PF}/mcstrans/examples" || die
474 -}
475 -
476 -pkg_postinst() {
477 - for POLICY_TYPE in ${POLICY_TYPES} ; do
478 - # There have been some changes to the policy store, rebuilding now.
479 - # https://marc.info/?l=selinux&m=143757277819717&w=2
480 - einfo "Rebuilding store ${POLICY_TYPE} (without re-loading)."
481 - semodule -s "${POLICY_TYPE}" -n -B || die "Failed to rebuild policy store ${POLICY_TYPE}"
482 - done
483 -}