Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions setools-no-mcp/.SRCINFO
Original file line number Diff line number Diff line change
@@ -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
64 changes: 64 additions & 0 deletions setools-no-mcp/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Maintainer: Nicolas Iooss (nicolas <dot> iooss <at> m4x <dot> org)
# Contributor: Timothée Ravier <tim@siosm.fr>
# Contributor: Nicky726 <Nicky726 [at] gmail [dot] com>
# Contributor: Xiao-Long Chen <chenxiaolong@cxl.epac.to>
#
# 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
}