From 378a533ffd171d932607166d08b0bc592c384fe6 Mon Sep 17 00:00:00 2001 From: Russell Wright Helder Date: Mon, 7 Sep 2026 13:08:45 -0700 Subject: [PATCH] Add `setools-no-mcp` package For users who want to skip the `python-fastmcp-slim` dependency, which is optional for `setools` but required for some of the tests. Just skip the tests that require `python-fastmcp-slim`. --- setools-no-mcp/.SRCINFO | 34 ++++++++++++++++++++++ setools-no-mcp/PKGBUILD | 64 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 setools-no-mcp/.SRCINFO create mode 100644 setools-no-mcp/PKGBUILD diff --git a/setools-no-mcp/.SRCINFO b/setools-no-mcp/.SRCINFO new file mode 100644 index 00000000..1b942d19 --- /dev/null +++ b/setools-no-mcp/.SRCINFO @@ -0,0 +1,34 @@ +pkgbase = setools-no-mcp + pkgdesc = Policy analysis tools for SELinux + pkgver = 4.7.1 + pkgrel = 1 + url = https://github.com/SELinuxProject/setools/wiki + arch = i686 + arch = x86_64 + arch = aarch64 + groups = selinux + license = GPL + license = LGPL + checkdepends = checkpolicy + checkdepends = python-pyqt6 + checkdepends = python-pytest + checkdepends = python-pytest-qt + checkdepends = python-typing_extensions + makedepends = cython + makedepends = python-tox + depends = libsepol>=3.9 + depends = libselinux>=3.9 + depends = python + depends = python-networkx>=2.6 + depends = python-setuptools + optdepends = python-graphviz: for seinfoflow, sedta, apol + optdepends = python-pyqt6: needed for graphical tools + optdepends = qt6-tools: display apol help with Qt Assistant + provides = selinux-setools=4.7.1-1 + provides = setools=4.7.1-1 + conflicts = selinux-setools + conflicts = setools + source = https://github.com/SELinuxProject/setools/releases/download/4.7.1/setools-4.7.1.tar.bz2 + sha256sums = 9b414eae7f17aa6ca53248d11d74fad01582a21985c78a483fa1240e70bd3b6a + +pkgname = setools-no-mcp diff --git a/setools-no-mcp/PKGBUILD b/setools-no-mcp/PKGBUILD new file mode 100644 index 00000000..1623c7a2 --- /dev/null +++ b/setools-no-mcp/PKGBUILD @@ -0,0 +1,64 @@ +# Maintainer: Nicolas Iooss (nicolas iooss m4x org) +# Contributor: Timothée Ravier +# Contributor: Nicky726 +# Contributor: Xiao-Long Chen +# +# This PKGBUILD is maintained on https://github.com/archlinuxhardened/selinux. +# If you want to help keep it up to date, please open a Pull Request there. + +# /!\ Important note when upgrading from setools 3 /!\ +# When upgrading with policycoreutils 2.5-3, pacman fails with: +# failed to prepare transaction (could not satisfy dependencies) +# :: policycoreutils: installing setools (4.0.1-1) breaks dependency 'setools3-libs' +# In order to upgrade setools, you can either: +# - build setools 4.0.1-1 and setools3-libs 3.3.8-1 and install both packages +# at the same time (with a single "pacman -U" command) +# - temporarily uninstall policycoreutils while upgrading and install it +# again afterwards, or +# - replace setools 3.3.8 with setools3-libs and install setools then. + +_name=setools +pkgname="${_name}-no-mcp" +pkgver=4.7.1 +pkgrel=1 +pkgdesc="Policy analysis tools for SELinux" +groups=('selinux') +arch=('i686' 'x86_64' 'aarch64') +url="https://github.com/SELinuxProject/setools/wiki" +license=('GPL' 'LGPL') +depends=('libsepol>=3.9' 'libselinux>=3.9' 'python' 'python-networkx>=2.6' 'python-setuptools') +optdepends=('python-graphviz: for seinfoflow, sedta, apol' + 'python-pyqt6: needed for graphical tools' + 'qt6-tools: display apol help with Qt Assistant') +makedepends=('cython' 'python-tox') +checkdepends=('checkpolicy' 'python-pyqt6' 'python-pytest' 'python-pytest-qt' 'python-typing_extensions') +conflicts=("selinux-${_name}" "${_name}") +provides=("selinux-${_name}=${pkgver}-${pkgrel}" "${_name}=${pkgver}-${pkgrel}") +source=("https://github.com/SELinuxProject/setools/releases/download/${pkgver}/${_name}-${pkgver}.tar.bz2") +sha256sums=('9b414eae7f17aa6ca53248d11d74fad01582a21985c78a483fa1240e70bd3b6a') + +build() { + cd "${_name}-${pkgver}" + python setup.py build_ext + python setup.py build +} + +check() { + cd "${_name}-${pkgver}" + # Instructions from https://github.com/SELinuxProject/setools/blob/4.5.1/README.md#unit-tests + python setup.py build_ext -i + + # Work around failing test when PySide6 is installed by forcing to use PyQt6 + # instead (cf. documentation of pytest-qt: + # https://pytest-qt.readthedocs.io/en/latest/intro.html#requirements ) + # https://github.com/archlinuxhardened/selinux/issues/141 + # https://github.com/SELinuxProject/setools/issues/160 + # + # And skip tests that require FastMCP + PYTEST_QT_API='pyqt6' pytest tests -k 'not test_encoder and not test_server' +} + +package() { + cd "${_name}-${pkgver}" + python setup.py install --root="$pkgdir" --optimize=1 --skip-build +}