Skip to content

Commit 63260ab

Browse files
committed
app-admin/setools: Add from Gentoo
It's from Gentoo commit dd8f1e13525265315752f252be7515f18e80334a.
1 parent 0035927 commit 63260ab

File tree

5 files changed

+153
-0
lines changed

5 files changed

+153
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DIST setools-4.5.1.tar.bz2 264998 BLAKE2B 479cec6f541c1e7125d641928ba49aee949e538612a478840cec2d70106dcf9f7fa5b8049c9d18c560587670ee624a3a744714667d52b99cff24c51e72026db7 SHA512 1045c223423fcb056ffbc2f93c4dc0ccc6ae078ce7d2acbe3a3c65de19440fe801b5b9f71038cde62bf9851f52d868c845aafbe33691ee531cf9854217e061d8
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/setup.py b/setup.py
2+
index 05aac33..c685791 100644
3+
--- a/setup.py
4+
+++ b/setup.py
5+
@@ -70,13 +70,10 @@ setup(name='setools',
6+
author='Chris PeBenito',
7+
author_email='[email protected]',
8+
url='https://github.com/SELinuxProject/setools',
9+
- packages=['setools', 'setools.checker', 'setools.diff', 'setoolsgui', 'setoolsgui.widgets',
10+
- 'setoolsgui.widgets.criteria', 'setoolsgui.widgets.details',
11+
- 'setoolsgui.widgets.models', 'setoolsgui.widgets.views'],
12+
- scripts=['apol', 'sediff', 'seinfo', 'seinfoflow', 'sesearch', 'sedta', 'sechecker'],
13+
+ packages=['setools', 'setools.checker', 'setools.diff'],
14+
+ scripts=['sediff', 'seinfo', 'seinfoflow', 'sesearch', 'sedta', 'sechecker'],
15+
data_files=installed_data,
16+
- package_data={'': ['*.css', '*.html'],
17+
- 'setools': ['perm_map', 'policyrep.pyi', 'py.typed']},
18+
+ package_data={'setools': ['perm_map', 'policyrep.pyi', 'py.typed']},
19+
ext_modules=cythonize(ext_py_mods, include_path=['setools/policyrep'],
20+
annotate=cython_annotate,
21+
compiler_directives={"language_level": 3,
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
3+
<pkgmetadata>
4+
<maintainer type="project">
5+
<email>[email protected]</email>
6+
<name>SELinux Team</name>
7+
</maintainer>
8+
<upstream>
9+
<remote-id type="github">SELinuxProject/setools</remote-id>
10+
</upstream>
11+
</pkgmetadata>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Copyright 1999-2025 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=8
5+
6+
DISTUTILS_EXT=1
7+
DISTUTILS_USE_PEP517=setuptools
8+
PYTHON_COMPAT=( python3_{10..13} )
9+
10+
inherit distutils-r1
11+
12+
DESCRIPTION="Policy Analysis Tools for SELinux"
13+
HOMEPAGE="https://github.com/SELinuxProject/setools/wiki"
14+
15+
if [[ ${PV} == *9999* ]] ; then
16+
inherit git-r3
17+
EGIT_REPO_URI="https://github.com/SELinuxProject/setools.git"
18+
S="${WORKDIR}/${P}"
19+
else
20+
SRC_URI="https://github.com/SELinuxProject/setools/releases/download/${PV}/${P}.tar.bz2"
21+
KEYWORDS="amd64 arm arm64 ~riscv x86"
22+
S="${WORKDIR}/${PN}"
23+
fi
24+
25+
LICENSE="GPL-2 LGPL-2.1"
26+
SLOT="0"
27+
IUSE="gui test"
28+
RESTRICT="!test? ( test )"
29+
30+
RDEPEND="${PYTHON_DEPS}
31+
>=dev-python/networkx-2.6[${PYTHON_USEDEP}]
32+
dev-python/setuptools[${PYTHON_USEDEP}]
33+
>=sys-libs/libsepol-3.2:=
34+
>=sys-libs/libselinux-3.2:=
35+
gui? (
36+
dev-python/pyqt6[gui,widgets,${PYTHON_USEDEP}]
37+
dev-python/pygraphviz[${PYTHON_USEDEP}]
38+
)"
39+
DEPEND="${RDEPEND}"
40+
BDEPEND=">=dev-python/cython-0.29.14[${PYTHON_USEDEP}]
41+
test? (
42+
dev-python/pyqt6[gui,testlib,widgets,${PYTHON_USEDEP}]
43+
dev-python/pytest-qt[${PYTHON_USEDEP}]
44+
sys-apps/checkpolicy
45+
)"
46+
47+
distutils_enable_tests pytest
48+
49+
python_prepare_all() {
50+
sed -i "s@^lib_dirs = .*@lib_dirs = ['${ROOT:-/}usr/$(get_libdir)']@" "${S}"/setup.py || \
51+
die "failed to set lib_dirs"
52+
53+
use gui || PATCHES+=( "${FILESDIR}"/${P}-remove-gui.patch )
54+
distutils-r1_python_prepare_all
55+
}
56+
57+
python_test() {
58+
rm -rf setools || die
59+
epytest
60+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Copyright 1999-2025 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=8
5+
6+
DISTUTILS_EXT=1
7+
DISTUTILS_USE_PEP517=setuptools
8+
PYTHON_COMPAT=( python3_{10..13} )
9+
10+
inherit distutils-r1
11+
12+
DESCRIPTION="Policy Analysis Tools for SELinux"
13+
HOMEPAGE="https://github.com/SELinuxProject/setools/wiki"
14+
15+
if [[ ${PV} == *9999* ]] ; then
16+
inherit git-r3
17+
EGIT_REPO_URI="https://github.com/SELinuxProject/setools.git"
18+
S="${WORKDIR}/${P}"
19+
else
20+
SRC_URI="https://github.com/SELinuxProject/setools/releases/download/${PV}/${P}.tar.bz2"
21+
KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
22+
S="${WORKDIR}/${PN}"
23+
fi
24+
25+
LICENSE="GPL-2 LGPL-2.1"
26+
SLOT="0"
27+
IUSE="gui test"
28+
RESTRICT="!test? ( test )"
29+
30+
RDEPEND="${PYTHON_DEPS}
31+
>=dev-python/networkx-2.6[${PYTHON_USEDEP}]
32+
dev-python/setuptools[${PYTHON_USEDEP}]
33+
>=sys-libs/libsepol-3.2:=
34+
>=sys-libs/libselinux-3.2:=
35+
gui? (
36+
dev-python/pyqt6[gui,widgets,${PYTHON_USEDEP}]
37+
dev-python/pygraphviz[${PYTHON_USEDEP}]
38+
)"
39+
DEPEND="${RDEPEND}"
40+
BDEPEND=">=dev-python/cython-0.29.14[${PYTHON_USEDEP}]
41+
test? (
42+
dev-python/pyqt6[gui,testlib,widgets,${PYTHON_USEDEP}]
43+
dev-python/pytest-qt[${PYTHON_USEDEP}]
44+
sys-apps/checkpolicy
45+
)"
46+
47+
distutils_enable_tests pytest
48+
49+
python_prepare_all() {
50+
sed -i "s@^lib_dirs = .*@lib_dirs = ['${ROOT:-/}usr/$(get_libdir)']@" "${S}"/setup.py || \
51+
die "failed to set lib_dirs"
52+
53+
use gui || PATCHES+=( "${FILESDIR}"/${PN}-4.5.1-remove-gui.patch )
54+
distutils-r1_python_prepare_all
55+
}
56+
57+
python_test() {
58+
rm -rf setools || die
59+
epytest
60+
}

0 commit comments

Comments
 (0)