diff --git a/sdk_container/src/third_party/portage-stable/app-admin/setools/Manifest b/sdk_container/src/third_party/portage-stable/app-admin/setools/Manifest new file mode 100644 index 0000000000..cddf08f12d --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/app-admin/setools/Manifest @@ -0,0 +1 @@ +DIST setools-4.5.1.tar.bz2 264998 BLAKE2B 479cec6f541c1e7125d641928ba49aee949e538612a478840cec2d70106dcf9f7fa5b8049c9d18c560587670ee624a3a744714667d52b99cff24c51e72026db7 SHA512 1045c223423fcb056ffbc2f93c4dc0ccc6ae078ce7d2acbe3a3c65de19440fe801b5b9f71038cde62bf9851f52d868c845aafbe33691ee531cf9854217e061d8 diff --git a/sdk_container/src/third_party/portage-stable/app-admin/setools/files/setools-4.5.1-remove-gui.patch b/sdk_container/src/third_party/portage-stable/app-admin/setools/files/setools-4.5.1-remove-gui.patch new file mode 100644 index 0000000000..efb7ae76e4 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/app-admin/setools/files/setools-4.5.1-remove-gui.patch @@ -0,0 +1,21 @@ +diff --git a/setup.py b/setup.py +index 05aac33..c685791 100644 +--- a/setup.py ++++ b/setup.py +@@ -70,13 +70,10 @@ setup(name='setools', + author='Chris PeBenito', + author_email='pebenito@ieee.org', + url='https://github.com/SELinuxProject/setools', +- packages=['setools', 'setools.checker', 'setools.diff', 'setoolsgui', 'setoolsgui.widgets', +- 'setoolsgui.widgets.criteria', 'setoolsgui.widgets.details', +- 'setoolsgui.widgets.models', 'setoolsgui.widgets.views'], +- scripts=['apol', 'sediff', 'seinfo', 'seinfoflow', 'sesearch', 'sedta', 'sechecker'], ++ packages=['setools', 'setools.checker', 'setools.diff'], ++ scripts=['sediff', 'seinfo', 'seinfoflow', 'sesearch', 'sedta', 'sechecker'], + data_files=installed_data, +- package_data={'': ['*.css', '*.html'], +- 'setools': ['perm_map', 'policyrep.pyi', 'py.typed']}, ++ package_data={'setools': ['perm_map', 'policyrep.pyi', 'py.typed']}, + ext_modules=cythonize(ext_py_mods, include_path=['setools/policyrep'], + annotate=cython_annotate, + compiler_directives={"language_level": 3, diff --git a/sdk_container/src/third_party/portage-stable/app-admin/setools/metadata.xml b/sdk_container/src/third_party/portage-stable/app-admin/setools/metadata.xml new file mode 100644 index 0000000000..2367a4105f --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/app-admin/setools/metadata.xml @@ -0,0 +1,11 @@ + + + + + selinux@gentoo.org + SELinux Team + + + SELinuxProject/setools + + diff --git a/sdk_container/src/third_party/portage-stable/app-admin/setools/setools-4.5.1.ebuild b/sdk_container/src/third_party/portage-stable/app-admin/setools/setools-4.5.1.ebuild new file mode 100644 index 0000000000..9f8c467893 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/app-admin/setools/setools-4.5.1.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..13} ) + +inherit distutils-r1 + +DESCRIPTION="Policy Analysis Tools for SELinux" +HOMEPAGE="https://github.com/SELinuxProject/setools/wiki" + +if [[ ${PV} == *9999* ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/SELinuxProject/setools.git" + S="${WORKDIR}/${P}" +else + SRC_URI="https://github.com/SELinuxProject/setools/releases/download/${PV}/${P}.tar.bz2" + KEYWORDS="amd64 arm arm64 ~riscv x86" + S="${WORKDIR}/${PN}" +fi + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +IUSE="gui test" +RESTRICT="!test? ( test )" + +RDEPEND="${PYTHON_DEPS} + >=dev-python/networkx-2.6[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + >=sys-libs/libsepol-3.2:= + >=sys-libs/libselinux-3.2:= + gui? ( + dev-python/pyqt6[gui,widgets,${PYTHON_USEDEP}] + dev-python/pygraphviz[${PYTHON_USEDEP}] + )" +DEPEND="${RDEPEND}" +BDEPEND=">=dev-python/cython-0.29.14[${PYTHON_USEDEP}] + test? ( + dev-python/pyqt6[gui,testlib,widgets,${PYTHON_USEDEP}] + dev-python/pytest-qt[${PYTHON_USEDEP}] + sys-apps/checkpolicy + )" + +distutils_enable_tests pytest + +python_prepare_all() { + sed -i "s@^lib_dirs = .*@lib_dirs = ['${ROOT:-/}usr/$(get_libdir)']@" "${S}"/setup.py || \ + die "failed to set lib_dirs" + + use gui || PATCHES+=( "${FILESDIR}"/${P}-remove-gui.patch ) + distutils-r1_python_prepare_all +} + +python_test() { + rm -rf setools || die + epytest +} diff --git a/sdk_container/src/third_party/portage-stable/app-admin/setools/setools-9999.ebuild b/sdk_container/src/third_party/portage-stable/app-admin/setools/setools-9999.ebuild new file mode 100644 index 0000000000..fab88699bd --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/app-admin/setools/setools-9999.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..14} ) + +inherit distutils-r1 + +DESCRIPTION="Policy Analysis Tools for SELinux" +HOMEPAGE="https://github.com/SELinuxProject/setools/wiki" + +if [[ ${PV} == *9999* ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/SELinuxProject/setools.git" + S="${WORKDIR}/${P}" +else + SRC_URI="https://github.com/SELinuxProject/setools/releases/download/${PV}/${P}.tar.bz2" + KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86" + S="${WORKDIR}/${PN}" +fi + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +IUSE="gui test" +RESTRICT="!test? ( test )" + +RDEPEND="${PYTHON_DEPS} + >=dev-python/networkx-2.6[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + >=sys-libs/libsepol-3.2:= + >=sys-libs/libselinux-3.2:= + gui? ( + dev-python/pyqt6[gui,widgets,${PYTHON_USEDEP}] + dev-python/pygraphviz[${PYTHON_USEDEP}] + )" +DEPEND="${RDEPEND}" +BDEPEND=">=dev-python/cython-0.29.14[${PYTHON_USEDEP}] + test? ( + dev-python/pyqt6[gui,testlib,widgets,${PYTHON_USEDEP}] + dev-python/pytest-qt[${PYTHON_USEDEP}] + sys-apps/checkpolicy + )" + +distutils_enable_tests pytest + +python_prepare_all() { + sed -i "s@^lib_dirs = .*@lib_dirs = ['${ROOT:-/}usr/$(get_libdir)']@" "${S}"/setup.py || \ + die "failed to set lib_dirs" + + distutils-r1_python_prepare_all +} + +python_test() { + rm -rf setools || die + epytest +}