From 3938c00030d1b6e4074e55a4dd880bd44851f2dc Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Mon, 19 Apr 2021 16:07:30 +0200 Subject: pcr: Add selinux-python from Aur This finally brings the 'audit2allow' command to Parabola. That command is commonly used to work with selinux policies. Signed-off-by: Denis 'GNUtoo' Carikli --- pcr/checkpolicy/PKGBUILD | 34 +++++++++++++++++++++++++++++ pcr/selinux-python/PKGBUILD | 30 +++++++++++++++++++++++++ pcr/setools/PKGBUILD | 53 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 pcr/checkpolicy/PKGBUILD create mode 100644 pcr/selinux-python/PKGBUILD create mode 100644 pcr/setools/PKGBUILD diff --git a/pcr/checkpolicy/PKGBUILD b/pcr/checkpolicy/PKGBUILD new file mode 100644 index 000000000..3137e55c2 --- /dev/null +++ b/pcr/checkpolicy/PKGBUILD @@ -0,0 +1,34 @@ +# Maintainer (AUR): Nicolas Iooss (nicolas iooss m4x org) +# Contributor (AUR): Timothée Ravier +# Contributor (AUR): Nicky726 (Nicky726 gmail com) +# Contributor (AUR): Sergej Pupykin (pupykin s+arch gmail com) + +# parabola changes and rationale: +# - Added armv7h + +pkgname=checkpolicy +pkgver=3.2 +pkgrel=1 +pkgdesc="SELinux policy compiler" +arch=('i686' 'x86_64') +arch+=('armv7h') +url='https://github.com/SELinuxProject/selinux' +license=('GPL2') +groups=('selinux') +makedepends=('libsepol>=3.2') +conflicts=("selinux-usr-${pkgname}") +provides=("selinux-usr-${pkgname}=${pkgver}-${pkgrel}") +source=("https://github.com/SELinuxProject/selinux/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz") +sha256sums=('9b1c81fa86fe3867842164448d90c8e7ea94b2987497809c65d4caa87a5c5bc8') + +build() { + cd "${pkgname}-${pkgver}" + make +} + +package() { + cd "${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install + install -m 0755 test/dismod "${pkgdir}"/usr/bin/sedismod + install -m 0755 test/dispol "${pkgdir}"/usr/bin/sedispol +} diff --git a/pcr/selinux-python/PKGBUILD b/pcr/selinux-python/PKGBUILD new file mode 100644 index 000000000..0489d5573 --- /dev/null +++ b/pcr/selinux-python/PKGBUILD @@ -0,0 +1,30 @@ +# Maintainer (AUR): Nicolas Iooss (nicolas iooss m4x org) + +# parabola changes and rationale: +# - Added armv7h + +pkgname=selinux-python +pkgver=3.2 +pkgrel=1 +pkgdesc="SELinux python tools and libraries" +groups=('selinux') +arch=('i686' 'x86_64') +arch+=('armv7h') +url='https://github.com/SELinuxProject/selinux/wiki' +license=('GPL2') +depends=('python' 'python-audit' 'python-ipy' 'libsemanage>=3.2' 'setools>=4.4.0') +conflicts=('sepolgen<2.7' 'policycoreutils<2.7') +provides=("sepolgen=${pkgver}-${pkgrel}") +source=("https://github.com/SELinuxProject/selinux/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz") +sha256sums=('770855ea8120ef23007fdb9db94b1ed6e8cd77917b584ed8877bbee9c16e74fb') + +build() { + cd "${pkgbase}-${pkgver}" + make PYTHON=/usr/bin/python3 +} + +package() { + cd "${pkgbase}-${pkgver}" + make PYTHON=/usr/bin/python3 DESTDIR="${pkgdir}" SBINDIR=/usr/bin install + /usr/bin/python3 -m compileall "${pkgdir}/$(/usr/bin/python3 -c 'import site; print(site.getsitepackages()[0])')" +} diff --git a/pcr/setools/PKGBUILD b/pcr/setools/PKGBUILD new file mode 100644 index 000000000..78531fa3e --- /dev/null +++ b/pcr/setools/PKGBUILD @@ -0,0 +1,53 @@ +# Maintainer (AUR): Nicolas Iooss (nicolas iooss m4x org) +# Contributor (AUR): Timothée Ravier +# Contributor (AUR): Nicky726 +# Contributor (AUR): Xiao-Long Chen + +# parabola changes and rationale: +# - Added armv7h + +# /!\ 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. + +pkgname=setools +pkgver=4.4.0 +pkgrel=1 +pkgdesc="Policy analysis tools for SELinux" +groups=('selinux') +arch=('i686' 'x86_64') +arch+=('armv7h') +url="https://github.com/SELinuxProject/setools/wiki" +license=('GPL' 'LGPL') +depends=('libsepol>=3.2' 'libselinux>=3.2' 'python' 'python-networkx>=2.0' 'python-setuptools') +optdepends=('python-pyqt5: needed for graphical tools' + 'qt5-tools: display apol help with Qt Assistant') +makedepends=('cython' 'python-tox') +checkdepends=('checkpolicy') +conflicts=("selinux-${pkgname}") +provides=("selinux-${pkgname}=${pkgver}-${pkgrel}") +source=("https://github.com/SELinuxProject/setools/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.bz2") +sha256sums=('f3786677e40b7f16a226f48f233dcf835e700739614a7dbed2ff61cc9607814e') + +build() { + cd "${pkgname}" + python setup.py build_ext + python setup.py build +} + +check() { + cd "${pkgname}" + python setup.py test +} + +package() { + cd "${pkgname}" + python setup.py install --root="$pkgdir" --optimize=1 --skip-build +} -- cgit v1.2.2