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/selinux-python/, sys-apps/selinux-python/files/
Date: Sat, 09 Apr 2022 02:55:13
Message-Id: 1649472878.023b1ce085fdc6ef2573de12c30ac248578ac8c3.perfinion@gentoo
1 commit: 023b1ce085fdc6ef2573de12c30ac248578ac8c3
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 9 01:49:33 2022 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 9 02:54:38 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=023b1ce0
7
8 sys-apps/selinux-python: Drop old
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
12
13 sys-apps/selinux-python/Manifest | 2 -
14 .../selinux-python-3.2-optional-networkx.patch | 271 ---------------------
15 .../selinux-python/selinux-python-3.1-r2.ebuild | 93 -------
16 .../selinux-python/selinux-python-3.2-r1.ebuild | 115 ---------
17 4 files changed, 481 deletions(-)
18
19 diff --git a/sys-apps/selinux-python/Manifest b/sys-apps/selinux-python/Manifest
20 index ab68bfe15782..9a42e89573e3 100644
21 --- a/sys-apps/selinux-python/Manifest
22 +++ b/sys-apps/selinux-python/Manifest
23 @@ -1,3 +1 @@
24 -DIST selinux-python-3.1.tar.gz 2100549 BLAKE2B c5d207bad60c379259e3bfc8f029f76d4572818cdd41a263498ed4434a70eaf7ff51af7772cfb27de0e9e4af03bcf9906ab0f6a59e88de10e81cbe0e8c5928b8 SHA512 5dd98f77ae8ea8bac6a89ec7def76e12496b9a9f8c9612c4cc1dac7a8e8c60380a00c857426bfefbcb4273706addd2594e9b467f69408ef284f082a09d45bd49
25 -DIST selinux-python-3.2.tar.gz 2101106 BLAKE2B b4b185a7468de68eb2146011a9bc82ffb7db9878517833c1e8dfa23279aec3dfbf46a27b70b17c1e317a2c939bcf6d1748638fd4a078325b853de34ae3c51a6f SHA512 2c3483e27c4ad6942e23e39897e0eccf61b95d685ace62315678cb49739d300d4ca4a7a51fa7a9aacaa98737446a70923855d15827eb6275ffd6999be0b2a755
26 DIST selinux-python-3.3.tar.gz 2101584 BLAKE2B 603aafbf316b744098bd34c79bf384d55624c086fd75147675a4a0715df3d61710a99d490f30b78d59a2c2a85fcc4db91772c24644a963b31e1a0d305c4bc83e SHA512 a69948a8b139a309f18632440e4204f49832a94b8b6be50e162d3dacb16698effeb1a77c44462e8cc7dc3dd600b887b9ab2fef618c31d3e0fe0de216a6aaebe3
27
28 diff --git a/sys-apps/selinux-python/files/selinux-python-3.2-optional-networkx.patch b/sys-apps/selinux-python/files/selinux-python-3.2-optional-networkx.patch
29 deleted file mode 100644
30 index a9525ddda939..000000000000
31 --- a/sys-apps/selinux-python/files/selinux-python-3.2-optional-networkx.patch
32 +++ /dev/null
33 @@ -1,271 +0,0 @@
34 -Avoid importing networkx which ends up having a Fortran (and other large)
35 -dependencies.
36 -
37 -https://bugs.gentoo.org/809038
38 -https://github.com/SELinuxProject/selinux/commit/ba23ba068364ab11ff51f52bd1e20e3c63798a62
39 -
40 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
41 -Date: Wed, 25 Aug 2021 11:19:40 +0200
42 -Subject: [PATCH] python: Import specific modules from setools for less deps
43 -MIME-Version: 1.0
44 -Content-Type: text/plain; charset=UTF-8
45 -Content-Transfer-Encoding: 8bit
46 -
47 -Import the setools classes needed for Python bindings from specific
48 -setools modules in order to reduce the dependency footprint
49 -of the Python bindings. Importing the top-level module causes all
50 -setools modules to be loaded which includes the modules that require
51 -networkx.
52 -
53 -SELinux packages belong to the group of core system packages on Gentoo
54 -Linux. It is desirable to keep the system set as small as possible,
55 -and the dependency between setools and networkx seems to be the easiest
56 -link to break without major loss of functionality.
57 -
58 -Signed-off-by: Michał Górny <mgorny@g.o>
59 ---- a/semanage/seobject.py
60 -+++ b/semanage/seobject.py
61 -@@ -31,7 +31,8 @@
62 - from semanage import *
63 - PROGNAME = "policycoreutils"
64 - import sepolicy
65 --import setools
66 -+from setools.policyrep import SELinuxPolicy
67 -+from setools.typequery import TypeQuery
68 - import ipaddress
69 -
70 - try:
71 -@@ -1339,7 +1340,7 @@ class ibpkeyRecords(semanageRecords):
72 - def __init__(self, args = None):
73 - semanageRecords.__init__(self, args)
74 - try:
75 -- q = setools.TypeQuery(setools.SELinuxPolicy(sepolicy.get_store_policy(self.store)), attrs=["ibpkey_type"])
76 -+ q = TypeQuery(SELinuxPolicy(sepolicy.get_store_policy(self.store)), attrs=["ibpkey_type"])
77 - self.valid_types = sorted(str(t) for t in q.results())
78 - except:
79 - pass
80 -@@ -1599,7 +1600,7 @@ class ibendportRecords(semanageRecords):
81 - def __init__(self, args = None):
82 - semanageRecords.__init__(self, args)
83 - try:
84 -- q = setools.TypeQuery(setools.SELinuxPolicy(sepolicy.get_store_policy(self.store)), attrs=["ibendport_type"])
85 -+ q = TypeQuery(SELinuxPolicy(sepolicy.get_store_policy(self.store)), attrs=["ibendport_type"])
86 - self.valid_types = set(str(t) for t in q.results())
87 - except:
88 - pass
89 ---- a/sepolicy/sepolicy/__init__.py
90 -+++ b/sepolicy/sepolicy/__init__.py
91 -@@ -4,7 +4,6 @@
92 -
93 - import errno
94 - import selinux
95 --import setools
96 - import glob
97 - import sepolgen.defaults as defaults
98 - import sepolgen.interfaces as interfaces
99 -@@ -13,6 +12,17 @@
100 - import re
101 - import gzip
102 -
103 -+from setools.boolquery import BoolQuery
104 -+from setools.portconquery import PortconQuery
105 -+from setools.policyrep import SELinuxPolicy
106 -+from setools.objclassquery import ObjClassQuery
107 -+from setools.rbacrulequery import RBACRuleQuery
108 -+from setools.rolequery import RoleQuery
109 -+from setools.terulequery import TERuleQuery
110 -+from setools.typeattrquery import TypeAttributeQuery
111 -+from setools.typequery import TypeQuery
112 -+from setools.userquery import UserQuery
113 -+
114 - PROGNAME = "policycoreutils"
115 - try:
116 - import gettext
117 -@@ -168,7 +178,7 @@ def policy(policy_file):
118 - global _pol
119 -
120 - try:
121 -- _pol = setools.SELinuxPolicy(policy_file)
122 -+ _pol = SELinuxPolicy(policy_file)
123 - except:
124 - raise ValueError(_("Failed to read %s policy file") % policy_file)
125 -
126 -@@ -188,7 +198,7 @@ def info(setype, name=None):
127 - init_policy()
128 -
129 - if setype == TYPE:
130 -- q = setools.TypeQuery(_pol)
131 -+ q = TypeQuery(_pol)
132 - q.name = name
133 - results = list(q.results())
134 -
135 -@@ -206,7 +216,7 @@ def info(setype, name=None):
136 - } for x in results)
137 -
138 - elif setype == ROLE:
139 -- q = setools.RoleQuery(_pol)
140 -+ q = RoleQuery(_pol)
141 - if name:
142 - q.name = name
143 -
144 -@@ -217,7 +227,7 @@ def info(setype, name=None):
145 - } for x in q.results())
146 -
147 - elif setype == ATTRIBUTE:
148 -- q = setools.TypeAttributeQuery(_pol)
149 -+ q = TypeAttributeQuery(_pol)
150 - if name:
151 - q.name = name
152 -
153 -@@ -227,7 +237,7 @@ def info(setype, name=None):
154 - } for x in q.results())
155 -
156 - elif setype == PORT:
157 -- q = setools.PortconQuery(_pol)
158 -+ q = PortconQuery(_pol)
159 - if name:
160 - ports = [int(i) for i in name.split("-")]
161 - if len(ports) == 2:
162 -@@ -251,7 +261,7 @@ def info(setype, name=None):
163 - } for x in q.results())
164 -
165 - elif setype == USER:
166 -- q = setools.UserQuery(_pol)
167 -+ q = UserQuery(_pol)
168 - if name:
169 - q.name = name
170 -
171 -@@ -268,7 +278,7 @@ def info(setype, name=None):
172 - } for x in q.results())
173 -
174 - elif setype == BOOLEAN:
175 -- q = setools.BoolQuery(_pol)
176 -+ q = BoolQuery(_pol)
177 - if name:
178 - q.name = name
179 -
180 -@@ -278,7 +288,7 @@ def info(setype, name=None):
181 - } for x in q.results())
182 -
183 - elif setype == TCLASS:
184 -- q = setools.ObjClassQuery(_pol)
185 -+ q = ObjClassQuery(_pol)
186 - if name:
187 - q.name = name
188 -
189 -@@ -372,11 +382,11 @@ def search(types, seinfo=None):
190 - tertypes.append(DONTAUDIT)
191 -
192 - if len(tertypes) > 0:
193 -- q = setools.TERuleQuery(_pol,
194 -- ruletype=tertypes,
195 -- source=source,
196 -- target=target,
197 -- tclass=tclass)
198 -+ q = TERuleQuery(_pol,
199 -+ ruletype=tertypes,
200 -+ source=source,
201 -+ target=target,
202 -+ tclass=tclass)
203 -
204 - if PERMS in seinfo:
205 - q.perms = seinfo[PERMS]
206 -@@ -385,11 +395,11 @@ def search(types, seinfo=None):
207 -
208 - if TRANSITION in types:
209 - rtypes = ['type_transition', 'type_change', 'type_member']
210 -- q = setools.TERuleQuery(_pol,
211 -- ruletype=rtypes,
212 -- source=source,
213 -- target=target,
214 -- tclass=tclass)
215 -+ q = TERuleQuery(_pol,
216 -+ ruletype=rtypes,
217 -+ source=source,
218 -+ target=target,
219 -+ tclass=tclass)
220 -
221 - if PERMS in seinfo:
222 - q.perms = seinfo[PERMS]
223 -@@ -398,11 +408,11 @@ def search(types, seinfo=None):
224 -
225 - if ROLE_ALLOW in types:
226 - ratypes = ['allow']
227 -- q = setools.RBACRuleQuery(_pol,
228 -- ruletype=ratypes,
229 -- source=source,
230 -- target=target,
231 -- tclass=tclass)
232 -+ q = RBACRuleQuery(_pol,
233 -+ ruletype=ratypes,
234 -+ source=source,
235 -+ target=target,
236 -+ tclass=tclass)
237 -
238 - for r in q.results():
239 - toret.append({'source': str(r.source),
240 -@@ -720,11 +730,11 @@ def get_all_entrypoints():
241 -
242 -
243 - def get_entrypoint_types(setype):
244 -- q = setools.TERuleQuery(_pol,
245 -- ruletype=[ALLOW],
246 -- source=setype,
247 -- tclass=["file"],
248 -- perms=["entrypoint"])
249 -+ q = TERuleQuery(_pol,
250 -+ ruletype=[ALLOW],
251 -+ source=setype,
252 -+ tclass=["file"],
253 -+ perms=["entrypoint"])
254 - return [str(x.target) for x in q.results() if x.source == setype]
255 -
256 -
257 -@@ -739,10 +749,10 @@ def get_init_transtype(path):
258 -
259 -
260 - def get_init_entrypoint(transtype):
261 -- q = setools.TERuleQuery(_pol,
262 -- ruletype=["type_transition"],
263 -- source="init_t",
264 -- tclass=["process"])
265 -+ q = TERuleQuery(_pol,
266 -+ ruletype=["type_transition"],
267 -+ source="init_t",
268 -+ tclass=["process"])
269 - entrypoints = []
270 - for i in q.results():
271 - try:
272 -@@ -754,10 +764,10 @@ def get_init_entrypoint(transtype):
273 - return entrypoints
274 -
275 - def get_init_entrypoints_str():
276 -- q = setools.TERuleQuery(_pol,
277 -- ruletype=["type_transition"],
278 -- source="init_t",
279 -- tclass=["process"])
280 -+ q = TERuleQuery(_pol,
281 -+ ruletype=["type_transition"],
282 -+ source="init_t",
283 -+ tclass=["process"])
284 - entrypoints = {}
285 - for i in q.results():
286 - try:
287 -@@ -837,7 +847,7 @@ def get_all_role_allows():
288 - return role_allows
289 - role_allows = {}
290 -
291 -- q = setools.RBACRuleQuery(_pol, ruletype=[ALLOW])
292 -+ q = RBACRuleQuery(_pol, ruletype=[ALLOW])
293 - for r in q.results():
294 - src = str(r.source)
295 - tgt = str(r.target)
296 -@@ -923,7 +933,7 @@ def get_all_roles():
297 - if not _pol:
298 - init_policy()
299 -
300 -- q = setools.RoleQuery(_pol)
301 -+ q = RoleQuery(_pol)
302 - roles = [str(x) for x in q.results() if str(x) != "object_r"]
303 - return roles
304 -
305
306 diff --git a/sys-apps/selinux-python/selinux-python-3.1-r2.ebuild b/sys-apps/selinux-python/selinux-python-3.1-r2.ebuild
307 deleted file mode 100644
308 index cd89ab2c85dc..000000000000
309 --- a/sys-apps/selinux-python/selinux-python-3.1-r2.ebuild
310 +++ /dev/null
311 @@ -1,93 +0,0 @@
312 -# Copyright 1999-2021 Gentoo Authors
313 -# Distributed under the terms of the GNU General Public License v2
314 -
315 -EAPI=7
316 -PYTHON_COMPAT=( python3_{7..9} )
317 -PYTHON_REQ_USE="xml"
318 -
319 -inherit python-r1 toolchain-funcs
320 -
321 -MY_P="${P//_/-}"
322 -
323 -MY_RELEASEDATE="20200710"
324 -SEPOL_VER="${PV}"
325 -SELNX_VER="${PV}"
326 -SEMNG_VER="${PV}"
327 -
328 -REQUIRED_USE="${PYTHON_REQUIRED_USE}"
329 -
330 -DESCRIPTION="SELinux core utilities"
331 -HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
332 -
333 -if [[ ${PV} == 9999 ]] ; then
334 - inherit git-r3
335 - EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
336 - S="${WORKDIR}/${MY_P}/${PN#selinux-}"
337 -else
338 - SRC_URI="https://github.com/SELinuxProject/selinux/releases/download/${MY_RELEASEDATE}/${MY_P}.tar.gz"
339 - KEYWORDS="amd64 ~arm ~arm64 ~mips x86"
340 - S="${WORKDIR}/${MY_P}"
341 -fi
342 -
343 -LICENSE="GPL-2"
344 -SLOT="0"
345 -
346 -DEPEND=">=sys-libs/libselinux-${SELNX_VER}:=[python]
347 - >=sys-libs/libsemanage-${SEMNG_VER}:=[python(+)]
348 - >=sys-libs/libsepol-${SEPOL_VER}:=
349 - >=app-admin/setools-4.2.0[${PYTHON_USEDEP}]
350 - >=sys-process/audit-1.5.1[python,${PYTHON_USEDEP}]
351 - ${PYTHON_DEPS}"
352 -
353 -RDEPEND="${DEPEND}"
354 -
355 -src_prepare() {
356 - default
357 - sed -i 's/-Werror//g' "${S}"/*/Makefile || die "Failed to remove Werror"
358 -
359 - python_copy_sources
360 -}
361 -
362 -src_compile() {
363 - building() {
364 - emake -C "${BUILD_DIR}" \
365 - CC="$(tc-getCC)" \
366 - LIBDIR="\$(PREFIX)/$(get_libdir)"
367 - }
368 - python_foreach_impl building
369 -}
370 -
371 -src_install() {
372 - installation() {
373 - emake -C "${BUILD_DIR}" \
374 - DESTDIR="${D}" \
375 - LIBDIR="\$(PREFIX)/$(get_libdir)" \
376 - install
377 - python_optimize
378 - }
379 - python_foreach_impl installation
380 -
381 - # Set version-specific scripts
382 - for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do
383 - python_replicate_script "${ED}/usr/bin/${pyscript}"
384 - done
385 - for pyscript in semanage; do
386 - python_replicate_script "${ED}/usr/sbin/${pyscript}"
387 - done
388 -
389 - # Create sepolgen.conf with different devel location definition
390 - if [[ -f /etc/selinux/config ]];
391 - then
392 - local selinuxtype=$(awk -F'=' '/^SELINUXTYPE/ {print $2}' /etc/selinux/config);
393 - mkdir -p "${D}"/etc/selinux || die "Failed to create selinux directory";
394 - echo "SELINUX_DEVEL_PATH=/usr/share/selinux/${selinuxtype}/include:/usr/share/selinux/${selinuxtype}" > "${D}"/etc/selinux/sepolgen.conf;
395 - else
396 - local selinuxtype="${POLICY_TYPES%% *}";
397 - if [[ -n "${selinuxtype}" ]];
398 - then
399 - echo "SELINUX_DEVEL_PATH=/usr/share/selinux/${selinuxtype}/include:/usr/share/selinux/${selinuxtype}" > "${D}"/etc/selinux/sepolgen.conf;
400 - else
401 - echo "SELINUX_DEVEL_PATH=/usr/share/selinux/strict/include:/usr/share/selinux/strict" > "${D}"/etc/selinux/sepolgen.conf;
402 - fi
403 - fi
404 -}
405
406 diff --git a/sys-apps/selinux-python/selinux-python-3.2-r1.ebuild b/sys-apps/selinux-python/selinux-python-3.2-r1.ebuild
407 deleted file mode 100644
408 index e9ba19ba5815..000000000000
409 --- a/sys-apps/selinux-python/selinux-python-3.2-r1.ebuild
410 +++ /dev/null
411 @@ -1,115 +0,0 @@
412 -# Copyright 1999-2021 Gentoo Authors
413 -# Distributed under the terms of the GNU General Public License v2
414 -
415 -EAPI=7
416 -PYTHON_COMPAT=( python3_{7..9} )
417 -PYTHON_REQ_USE="xml"
418 -
419 -inherit python-r1 toolchain-funcs
420 -
421 -IUSE="test"
422 -RESTRICT="!test? ( test )"
423 -REQUIRED_USE="${PYTHON_REQUIRED_USE}"
424 -
425 -DESCRIPTION="SELinux core utilities"
426 -HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
427 -
428 -if [[ ${PV} == 9999 ]] ; then
429 - inherit git-r3
430 - EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
431 - S="${WORKDIR}/${P}/${PN#selinux-}"
432 -else
433 - SRC_URI="https://github.com/SELinuxProject/selinux/releases/download/${PV}/${P}.tar.gz"
434 - KEYWORDS="amd64 arm arm64 ~mips x86"
435 -fi
436 -
437 -LICENSE="GPL-2"
438 -SLOT="0"
439 -
440 -RDEPEND=">=sys-libs/libselinux-${PV}:=[python]
441 - >=sys-libs/libsemanage-${PV}:=[python(+)]
442 - >=sys-libs/libsepol-${PV}:=
443 - >=app-admin/setools-4.2.0[${PYTHON_USEDEP}]
444 - >=sys-process/audit-1.5.1[python,${PYTHON_USEDEP}]
445 - ${PYTHON_DEPS}"
446 -DEPEND="${RDEPEND}"
447 -BDEPEND="
448 - test? (
449 - ${RDEPEND}
450 - >=sys-apps/secilc-${PV}
451 - )"
452 -
453 -PATCHES=(
454 - "${FILESDIR}"/${PN}-3.2-optional-networkx.patch
455 -)
456 -
457 -src_prepare() {
458 - default
459 - sed -i 's/-Werror//g' "${S}"/*/Makefile || die "Failed to remove Werror"
460 -
461 - python_copy_sources
462 -}
463 -
464 -src_compile() {
465 - building() {
466 - emake -C "${BUILD_DIR}" \
467 - CC="$(tc-getCC)" \
468 - LIBDIR="\$(PREFIX)/$(get_libdir)"
469 - }
470 - python_foreach_impl building
471 -}
472 -
473 -src_test() {
474 - testing() {
475 - # The different subprojects have some interproject dependencies:
476 - # - audit2allow depens on sepolgen
477 - # - chcat depends on semanage
478 - # and maybe others.
479 - # Add all the modules of the individual subprojects to the
480 - # PYTHONPATH, so they get actually found and used. In
481 - # particular, already installed versions on the system are not
482 - # used.
483 - for dir in audit2allow chcat semanage sepolgen/src sepolicy ; do
484 - PYTHONPATH="${BUILD_DIR}/${dir}:${PYTHONPATH}"
485 - done
486 - PYTHONPATH=${PYTHONPATH} \
487 - emake -C "${BUILD_DIR}" \
488 - test
489 - }
490 - python_foreach_impl testing
491 -}
492 -
493 -src_install() {
494 - installation() {
495 - emake -C "${BUILD_DIR}" \
496 - DESTDIR="${D}" \
497 - LIBDIR="\$(PREFIX)/$(get_libdir)" \
498 - install
499 - python_optimize
500 - }
501 - python_foreach_impl installation
502 -
503 - # Set version-specific scripts
504 - for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do
505 - python_replicate_script "${ED}/usr/bin/${pyscript}"
506 - done
507 - for pyscript in semanage; do
508 - python_replicate_script "${ED}/usr/sbin/${pyscript}"
509 - done
510 -
511 - # Create sepolgen.conf with different devel location definition
512 - if [[ -f /etc/selinux/config ]];
513 - then
514 - local selinuxtype=$(awk -F'=' '/^SELINUXTYPE/ {print $2}' /etc/selinux/config);
515 - mkdir -p "${D}"/etc/selinux || die "Failed to create selinux directory";
516 - echo "SELINUX_DEVEL_PATH=/usr/share/selinux/${selinuxtype}/include:/usr/share/selinux/${selinuxtype}" > "${D}"/etc/selinux/sepolgen.conf;
517 - else
518 - local selinuxtype="${POLICY_TYPES%% *}";
519 - if [[ -n "${selinuxtype}" ]];
520 - then
521 - echo "SELINUX_DEVEL_PATH=/usr/share/selinux/${selinuxtype}/include:/usr/share/selinux/${selinuxtype}" > "${D}"/etc/selinux/sepolgen.conf;
522 - else
523 - echo "SELINUX_DEVEL_PATH=/usr/share/selinux/strict/include:/usr/share/selinux/strict" > "${D}"/etc/selinux/sepolgen.conf;
524 - fi
525 - fi
526 -}