[arch-commits] Commit in apparmor/trunk (PKGBUILD)

David Runge dvzrv at gemini.archlinux.org
Fri Dec 3 17:52:50 UTC 2021


    Date: Friday, December 3, 2021 @ 17:52:49
  Author: dvzrv
Revision: 430638

Add upstream fixes for python3.10.

Add upstream patch to replace the use of distutils with setuptools.
https://gitlab.com/apparmor/apparmor/-/issues/202
Add upstream patch to make the code python 3.10 compatible.
https://gitlab.com/apparmor/apparmor/-/issues/187
Remove unneeded test, that is broken due to patches.
Simplify python version discovery.
Simplify quoting in file.

Modified:
  apparmor/trunk/PKGBUILD

----------+
 PKGBUILD |   37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-12-03 14:36:24 UTC (rev 430637)
+++ PKGBUILD	2021-12-03 17:52:49 UTC (rev 430638)
@@ -4,17 +4,17 @@
 pkgver=3.0.3
 pkgrel=1
 pkgdesc="Mandatory Access Control (MAC) using Linux Security Module (LSM)"
-arch=('x86_64')
+arch=(x86_64)
 url="https://gitlab.com/apparmor/apparmor"
-license=('GPL2' 'LGPL2.1')
-depends=('audit' 'glibc' 'pam' 'python')
-makedepends=('apache' 'libxcrypt' 'ruby' 'swig')
-checkdepends=('dejagnu' 'perl-locale-gettext' 'python-notify2' 'python-psutil')
+license=(GPL2 LGPL2.1)
+depends=(audit glibc pam python)
+makedepends=(apache libxcrypt python-setuptools ruby swig)
+checkdepends=(dejagnu perl-locale-gettext python-notify2 python-psutil)
 optdepends=('perl: for perl bindings'
             'python-notify2: for aa-notify'
             'python-psutil: for aa-notify'
             'ruby: for ruby bindings')
-provides=('libapparmor.so')
+provides=(libapparmor.so)
 backup=('etc/apparmor/easyprof.conf'
         'etc/apparmor/logprof.conf'
         'etc/apparmor/notify.conf'
@@ -22,21 +22,38 @@
         'etc/apparmor/severity.db')
 source=(
   "https://launchpad.net/${pkgname}/${pkgver%.[0-9]}/${pkgver}/+download/${pkgname}-${pkgver}.tar.gz"{,.asc}
+  "$pkgname-3.0.3-remove_distutils.patch::https://gitlab.com/apparmor/apparmor/-/commit/ab4cfb5e84a95decd06487dc4e59827ddb8ce79d.patch"
+  "$pkgname-3.0.3-python3.10.patch::https://gitlab.com/apparmor/apparmor/-/commit/6cfc6eeec22d3c9ffae413819654359b76680150.patch"
 )
 sha512sums=('bbf26377e60da60dab56473ee5af15aa0f3fdf2f2a61dbfcdeba12a925afda3bc6a0f6cc31e07927400425b8c3b3649833f448d8674044c7274ef06923ab48b5'
-            'SKIP')
+            'SKIP'
+            'de4cae1b06fb4f56a8aade9ccb3f223a9930f7c37a865e04aef3446038c016a3880e91546d734ac7102d0df20e3edc5ec9a7909a850a936c94399c431fe5d853'
+            'ecfb29c60b0f1824817035c524f0265e1f5c977f2774f342c84fc783242acdca2835ff0ac099f852c07de5e6a42a323fd51b8c96c5d7695f46fd6cf135155fda')
 b2sums=('aada9c32c2cde4a110cbd1d626ec00b08e29e76182185752e5c23e2ec0c2668a732ffdf1eb1660bd8bc294188ccf0da42b4282939f5969a6aed39084be00769c'
-        'SKIP')
+        'SKIP'
+        '52c1d4a76f97e72765476e76277482771df18827d143d0ac04e1658e414224272a65a5dc11ac5308c30862b474c912f4642417176a44815723b49bb69ae9c356'
+        'cf545f9548c724f3b1c9c214755dda277bdd6b5b79065c32675c788ab6fc145dd798d0366a360e0f6a3a35f572c71906b0760c0a268c0ffde265e28414dc3326')
 validpgpkeys=('3ECDCBA5FB34D254961CC53F6689E64E3D3664BB') # AppArmor Development Team (AppArmor signing key) <apparmor at lists.ubuntu.com>
 _core_perl="/usr/bin/core_perl"
 
 prepare() {
   cd "${pkgname}-${pkgver}"
+
+  # replace use of distutils with setuptools
+  # https://gitlab.com/apparmor/apparmor/-/issues/202
+  patch -Np1 -i ../$pkgname-3.0.3-remove_distutils.patch
+  # ensure python3.10 compatibility:
+  #  https://gitlab.com/apparmor/apparmor/-/issues/187
+  patch -Np1 -i ../$pkgname-3.0.3-python3.10.patch
+  # remove test for help text that is broken by the above patches
+  sed '147,179d' -i utils/test/test-aa-notify.py
+
   # fix PYTHONPATH and add LD_LIBRARY_PATH for aa-logprof based check:
   # https://gitlab.com/apparmor/apparmor/issues/39
-  local _py3_ver=$(python --version | cut -d " " -f2)
-  local path="${PWD}/libraries/libapparmor/swig/python/build/lib.linux-${CARCH}-${_py3_ver%"."*}/LibAppArmor"
+  local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
+  local path="${PWD}/libraries/libapparmor/swig/python/build/lib.linux-${CARCH}-${python_version}/"
   local libs="${PWD}/libraries/libapparmor/src/.libs"
+
   sed -e "/PYTHONPATH/ s|utils\ |utils:$path\ LD_LIBRARY_PATH=$libs\ |" \
       -i profiles/Makefile
   (



More information about the arch-commits mailing list