diff --git a/utils/apparmor/Makefile b/utils/apparmor/Makefile index 9dc83c956e0dc..7f5025bca1b1e 100644 --- a/utils/apparmor/Makefile +++ b/utils/apparmor/Makefile @@ -3,17 +3,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=apparmor -PKG_VERSION:=3.0.3 -PKG_RELEASE:=6 +PKG_VERSION:=3.0.13 +PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=https://gitlab.com/apparmor/apparmor/-/archive/v$(PKG_VERSION) -PKG_HASH:=66db49cc578e6a85ba2fc350507ad1741d2534cdfc7ed71a81261f84d6e2262d -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION) +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=v$(PKG_VERSION) +PKG_SOURCE_URL:=https://gitlab.com/apparmor/apparmor +PKG_MIRROR_HASH:=0f47852e1559607c2e62919a781d2f8226acbdb0df00b025be7ebc79e5c9bc8b +PKG_MAINTAINER:=Oskari Rauta PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=LICENSE -PKG_MAINTAINER:=Oskari Rauta PKG_BUILD_DEPENDS:=swig/host python-setuptools-scm/host diff --git a/utils/apparmor/patches/020-remove-which-dep.patch b/utils/apparmor/patches/020-remove-which-dep.patch index 07b481d34c4e6..66d88f7faa984 100644 --- a/utils/apparmor/patches/020-remove-which-dep.patch +++ b/utils/apparmor/patches/020-remove-which-dep.patch @@ -15,7 +15,7 @@ Signed-off-by: Michal Vasilek --- a/utils/aa-unconfined +++ b/utils/aa-unconfined -@@ -116,7 +116,7 @@ def read_proc_current(filename): +@@ -125,7 +125,7 @@ def escape_special_chars(data): pids = set() if paranoid: pids = get_all_pids() diff --git a/utils/apparmor/patches/030-systemd.patch b/utils/apparmor/patches/030-systemd.patch index 1023c36c3a1f7..32cff74c0a28c 100644 --- a/utils/apparmor/patches/030-systemd.patch +++ b/utils/apparmor/patches/030-systemd.patch @@ -1,6 +1,6 @@ --- a/parser/Makefile +++ b/parser/Makefile -@@ -351,7 +351,7 @@ install-redhat: +@@ -361,7 +361,7 @@ install-redhat: install -m 755 rc.apparmor.$(subst install-,,$@) $(DESTDIR)/etc/init.d/apparmor .PHONY: install-suse @@ -9,7 +9,7 @@ install -m 755 -d $(SBINDIR) ln -sf service $(SBINDIR)/rcapparmor -@@ -414,14 +414,6 @@ install-indep: indep +@@ -425,14 +425,6 @@ install-indep: indep $(MAKE) -C po install NAME=${NAME} DESTDIR=${DESTDIR} $(MAKE) install_manpages DESTDIR=${DESTDIR} diff --git a/utils/apparmor/patches/050-disable-man-pages.patch b/utils/apparmor/patches/050-disable-man-pages.patch index a0463f1521320..0c5b618dfc6f9 100644 --- a/utils/apparmor/patches/050-disable-man-pages.patch +++ b/utils/apparmor/patches/050-disable-man-pages.patch @@ -20,7 +20,7 @@ install-arch: arch --- a/parser/Makefile +++ b/parser/Makefile -@@ -195,7 +195,7 @@ extra_docs: pdf +@@ -197,7 +197,7 @@ extra_docs: pdf indep: docs $(Q)$(MAKE) -C po all @@ -29,7 +29,7 @@ .PHONY: coverage coverage: -@@ -396,7 +396,6 @@ endif +@@ -406,7 +406,6 @@ endif .PHONY: install install: diff --git a/utils/apparmor/patches/070-basename.patch b/utils/apparmor/patches/070-basename.patch new file mode 100644 index 0000000000000..779728046ff4d --- /dev/null +++ b/utils/apparmor/patches/070-basename.patch @@ -0,0 +1,36 @@ +From 7fb040bde69ebdfce48cf1a01c1a62fd4f8eef0a Mon Sep 17 00:00:00 2001 +From: Jules Maselbas +Date: Thu, 16 May 2024 12:01:00 +0200 +Subject: [PATCH] libapparamor: Define a portable version of gnu basename + +Since musl 1.2.5, basename(3) prototype is only provided in libgen.h +(as mandated by POSIX) and not in strings.h. Also there is a major +difference between the gnu basename and the one defined in libgen.h, +the latter modify the argument string making them incompatible. + +Fix this by defining a portable version of basename using strchr. +--- + libraries/libapparmor/testsuite/test_multi.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/libraries/libapparmor/testsuite/test_multi.c ++++ b/libraries/libapparmor/testsuite/test_multi.c +@@ -1,5 +1,3 @@ +-#define _GNU_SOURCE /* for glibc's basename version */ +- + #include + #include + #include +@@ -7,6 +5,12 @@ + + #include + ++static const char *basename(const char *path) ++{ ++ const char *p = strrchr(path, '/'); ++ return p ? p + 1 : path; ++} ++ + int print_results(aa_log_record *record); + + int main(int argc, char **argv) diff --git a/utils/apparmor/patches/070-python-3.10.patch b/utils/apparmor/patches/070-python-3.10.patch deleted file mode 100644 index 8e80dea0c379e..0000000000000 --- a/utils/apparmor/patches/070-python-3.10.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 6cfc6eeec22d3c9ffae413819654359b76680150 Mon Sep 17 00:00:00 2001 -From: John Johansen -Date: Fri, 13 Aug 2021 20:13:59 +0000 -Subject: [PATCH] Merge Update abstractions/python and profiles for python 3.10 - -Add support for python 3.10 in abstractions and profiles. - -Fixes: https://gitlab.com/apparmor/apparmor/-/issues/187 -MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/783 -Acked-by: John Johansen -(cherry picked from commit 31fda3eee7b1e5f936b31d3578ed596789d5fcce) -Signed-off-by: John Johansen ---- - profiles/apparmor.d/abstractions/python | 18 +++++++++--------- - profiles/apparmor.d/lsb_release | 2 +- - .../profiles/extras/usr.bin.chromium-browser | 4 ++-- - 3 files changed, 12 insertions(+), 12 deletions(-) - ---- a/profiles/apparmor.d/abstractions/python -+++ b/profiles/apparmor.d/abstractions/python -@@ -12,18 +12,18 @@ - - abi , - -- /usr/lib{,32,64}/python{2.[4-7],3.[0-9]}/**.{pyc,so} mr, -- /usr/lib{,32,64}/python{2.[4-7],3.[0-9]}/**.{egg,py,pth} r, -- /usr/lib{,32,64}/python{2.[4-7],3.[0-9]}/{site,dist}-packages/ r, -+ /usr/lib{,32,64}/python{2.[4-7],3.[0-9],3.1[0-9]}/**.{pyc,so} mr, -+ /usr/lib{,32,64}/python{2.[4-7],3.[0-9],3.1[0-9]}/**.{egg,py,pth} r, -+ /usr/lib{,32,64}/python{2.[4-7],3.[0-9],3.1[0-9]}/{site,dist}-packages/ r, - /usr/lib{,32,64}/python3.[0-9]/lib-dynload/*.so mr, - -- /usr/local/lib{,32,64}/python{2.[4-7],3,3.[0-9]}/**.{pyc,so} mr, -- /usr/local/lib{,32,64}/python{2.[4-7],3,3.[0-9]}/**.{egg,py,pth} r, -- /usr/local/lib{,32,64}/python{2.[4-7],3,3.[0-9]}/{site,dist}-packages/ r, -- /usr/local/lib{,32,64}/python3.[0-9]/lib-dynload/*.so mr, -+ /usr/local/lib{,32,64}/python{2.[4-7],3,3.[0-9],3.1[0-9]}/**.{pyc,so} mr, -+ /usr/local/lib{,32,64}/python{2.[4-7],3,3.[0-9],3.1[0-9]}/**.{egg,py,pth} r, -+ /usr/local/lib{,32,64}/python{2.[4-7],3,3.[0-9],3.1[0-9]}/{site,dist}-packages/ r, -+ /usr/local/lib{,32,64}/python3.{1,}[0-9]/lib-dynload/*.so mr, - - # Site-wide configuration -- /etc/python{2.[4-7],3.[0-9]}/** r, -+ /etc/python{2.[4-7],3.[0-9],3.1[0-9]}/** r, - - # shared python paths - /usr/share/{pyshared,pycentral,python-support}/** r, -@@ -36,7 +36,7 @@ - /usr/lib/wx/python/*.pth r, - - # python build configuration and headers -- /usr/include/python{2.[4-7],3.[0-9]}*/pyconfig.h r, -+ /usr/include/python{2.[4-7],3.[0-9],3.1[0-9]}*/pyconfig.h r, - - # Include additions to the abstraction - include if exists ---- a/profiles/apparmor.d/lsb_release -+++ b/profiles/apparmor.d/lsb_release -@@ -18,7 +18,7 @@ profile lsb_release { - /dev/tty rw, - - /usr/bin/lsb_release r, -- /usr/bin/python3.[0-9] mr, -+ /usr/bin/python3.{1,}[0-9] mr, - - /etc/debian_version r, - /etc/default/apport r, ---- a/profiles/apparmor/profiles/extras/usr.bin.chromium-browser -+++ b/profiles/apparmor/profiles/extras/usr.bin.chromium-browser -@@ -267,9 +267,9 @@ profile chromium_browser /usr/lib/@{chro - /usr/share/distro-info/** r, - /var/lib/dpkg/** r, - -- /usr/local/lib/python3.[0-9]/dist-packages/ r, -+ /usr/local/lib/python3.{1,}[0-9]/dist-packages/ r, - /usr/bin/ r, -- /usr/bin/python3.[0-9] mr, -+ /usr/bin/python3.{1,}[0-9] mr, - } - - profile sandbox { diff --git a/utils/apparmor/patches/080-add-new-python-versions-to-logprof-conf.patch b/utils/apparmor/patches/080-add-new-python-versions-to-logprof-conf.patch deleted file mode 100644 index cdee6cc5597eb..0000000000000 --- a/utils/apparmor/patches/080-add-new-python-versions-to-logprof-conf.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 06dc32a9f3ede351c46167afa5002a0fe062c0f7 Mon Sep 17 00:00:00 2001 -From: Steve Beattie -Date: Thu, 26 Aug 2021 17:43:43 +0000 -Subject: [PATCH] utils: Add new python versions to logprof.conf - -Adding everything up to 3.19 should make the file future-proof for a -while ;-) - -Fixes: https://gitlab.com/apparmor/apparmor/-/issues/193 -MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/795 -Acked-by: Steve Beattie -(cherry picked from commit 4559a2997cf162b0f54f602180fd352e8d2486c1) -Signed-off-by: Steve Beattie ---- - utils/logprof.conf | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- a/utils/logprof.conf -+++ b/utils/logprof.conf -@@ -112,6 +112,18 @@ - /usr/bin/python3.5 = icn - /usr/bin/python3.6 = icn - /usr/bin/python3.7 = icn -+ /usr/bin/python3.8 = icn -+ /usr/bin/python3.9 = icn -+ /usr/bin/python3.10 = icn -+ /usr/bin/python3.11 = icn -+ /usr/bin/python3.12 = icn -+ /usr/bin/python3.13 = icn -+ /usr/bin/python3.14 = icn -+ /usr/bin/python3.15 = icn -+ /usr/bin/python3.16 = icn -+ /usr/bin/python3.17 = icn -+ /usr/bin/python3.18 = icn -+ /usr/bin/python3.19 = icn - /usr/bin/tr = icn - - [required_hats] diff --git a/utils/apparmor/patches/090-setuptools.patch b/utils/apparmor/patches/090-setuptools.patch deleted file mode 100644 index b5f9db3863d33..0000000000000 --- a/utils/apparmor/patches/090-setuptools.patch +++ /dev/null @@ -1,254 +0,0 @@ -From ab4cfb5e84a95decd06487dc4e59827ddb8ce79d Mon Sep 17 00:00:00 2001 -From: Georgia Garcia -Date: Wed, 10 Nov 2021 19:50:35 +0000 -Subject: [PATCH] replace deprecated distutils with setuptools - -Adds python3 setuptools as a build dependency for libapparmor - -Fixes: https://gitlab.com/apparmor/apparmor/-/issues/202 -MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/813 -Signed-off-by: Georgia Garcia -Acked-by: Christian Boltz -(cherry picked from commit 21e5a721ab2abe26bb12b9da7accc39d4fff9804) -Signed-off-by: John Johansen ---- - .gitignore | 3 ++ - .gitlab-ci.yml | 2 +- - libraries/libapparmor/m4/ac_python_devel.m4 | 36 +++++++++---------- - libraries/libapparmor/swig/python/Makefile.am | 2 +- - libraries/libapparmor/swig/python/setup.py.in | 2 +- - .../libapparmor/swig/python/test/Makefile.am | 2 +- - profiles/Makefile | 2 +- - utils/Makefile | 1 + - utils/python-tools-setup.py | 6 ++-- - utils/test/Makefile | 2 +- - utils/test/README.md | 18 ++++++++++ - 11 files changed, 49 insertions(+), 27 deletions(-) - create mode 100644 utils/test/README.md - ---- a/.gitignore -+++ b/.gitignore -@@ -159,6 +159,7 @@ libraries/libapparmor/swig/perl/libappar - libraries/libapparmor/swig/perl/libapparmor_wrap.o - libraries/libapparmor/swig/perl/pm_to_blib - libraries/libapparmor/swig/python/LibAppArmor.py -+libraries/libapparmor/swig/python/LibAppArmor.egg-info/ - libraries/libapparmor/swig/python/build/ - libraries/libapparmor/swig/python/libapparmor_wrap.c - libraries/libapparmor/swig/python/Makefile -@@ -203,6 +204,8 @@ utils/*.tmp - utils/po/*.mo - utils/apparmor/*.pyc - utils/apparmor/rule/*.pyc -+utils/apparmor.egg-info/ -+utils/build/ - utils/htmlcov/ - utils/test/common_test.pyc - utils/test/.coverage ---- a/.gitlab-ci.yml -+++ b/.gitlab-ci.yml -@@ -1,7 +1,7 @@ - --- - image: ubuntu:latest - before_script: -- - export DEBIAN_FRONTEND=noninteractive && apt-get update -qq && apt-get install --no-install-recommends -y build-essential apache2-dev autoconf automake bison dejagnu flex libpam-dev libtool perl liblocale-gettext-perl pkg-config python-all-dev python3-all-dev pyflakes3 ruby-dev swig lsb-release python3-notify2 python3-psutil zlib1g-dev -+ - export DEBIAN_FRONTEND=noninteractive && apt-get update -qq && apt-get install --no-install-recommends -y build-essential apache2-dev autoconf automake bison dejagnu flex libpam-dev libtool perl liblocale-gettext-perl pkg-config python-all-dev python3-all-dev pyflakes3 ruby-dev swig lsb-release python3-notify2 python3-psutil python3-setuptools zlib1g-dev - - lsb_release -a - - uname -a - ---- a/libraries/libapparmor/m4/ac_python_devel.m4 -+++ b/libraries/libapparmor/m4/ac_python_devel.m4 -@@ -66,17 +66,17 @@ variable to configure. See ``configure - - fi - - # -- # Check if you have distutils, else fail -+ # Check if you have setuptools, else fail - # -- AC_MSG_CHECKING([for the distutils Python package]) -- ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` -- if test -z "$ac_distutils_result"; then -+ AC_MSG_CHECKING([for the setuptools Python package]) -+ ac_setuptools_result=`$PYTHON -c "import setuptools" 2>&1` -+ if test -z "$ac_setuptools_result"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -- AC_MSG_ERROR([cannot import Python module "distutils". -+ AC_MSG_ERROR([cannot import Python module "setuptools". - Please check your Python installation. The error was: --$ac_distutils_result]) -+$ac_setuptools_result]) - PYTHON_VERSION="" - fi - -@@ -88,8 +88,8 @@ $ac_distutils_result]) - PYTHON_CPPFLAGS=`$PYTHON_CONFIG --includes` - fi - if test -z "$PYTHON_CPPFLAGS"; then -- python_path=`$PYTHON -c "import sys; import distutils.sysconfig;\ --sys.stdout.write('%s\n' % distutils.sysconfig.get_python_inc());"` -+ python_path=`$PYTHON -c "import sys; import sysconfig;\ -+sys.stdout.write('%s\n' % sysconfig.get_path('include'));"` - if test -n "${python_path}"; then - python_path="-I$python_path" - fi -@@ -108,8 +108,8 @@ sys.stdout.write('%s\n' % distutils.sysc - if test -z "$PYTHON_LDFLAGS"; then - # (makes two attempts to ensure we've got a version number - # from the interpreter) -- py_version=`$PYTHON -c "import sys; from distutils.sysconfig import *; \ --sys.stdout.write('%s\n' % ''.join(get_config_vars('VERSION')))"` -+ py_version=`$PYTHON -c "import sys; import sysconfig; \ -+sys.stdout.write('%s\n' % ''.join(sysconfig.get_config_vars('VERSION')))"` - if test "$py_version" == "[None]"; then - if test -n "$PYTHON_VERSION"; then - py_version=$PYTHON_VERSION -@@ -119,8 +119,8 @@ sys.stdout.write("%s\n" % sys.version[[: - fi - fi - -- PYTHON_LDFLAGS=`$PYTHON -c "import sys; from distutils.sysconfig import *; \ --sys.stdout.write('-L' + get_python_lib(0,1) + ' -lpython\n')"`$py_version`$PYTHON -c \ -+ PYTHON_LDFLAGS=`$PYTHON -c "import sys; import sysconfig; \ -+sys.stdout.write('-L' + sysconfig.get_path('stdlib') + ' -lpython\n')"`$py_version`$PYTHON -c \ - "import sys; sys.stdout.write('%s' % getattr(sys,'abiflags',''))"` - fi - AC_MSG_RESULT([$PYTHON_LDFLAGS]) -@@ -131,8 +131,8 @@ sys.stdout.write('-L' + get_python_lib(0 - # - AC_MSG_CHECKING([for Python site-packages path]) - if test -z "$PYTHON_SITE_PKG"; then -- PYTHON_SITE_PKG=`$PYTHON -c "import sys; import distutils.sysconfig; \ --sys.stdout.write('%s\n' % distutils.sysconfig.get_python_lib(0,0));"` -+ PYTHON_SITE_PKG=`$PYTHON -c "import sys; import sysconfig; \ -+sys.stdout.write('%s\n' % sysconfig.get_path('purelib'));"` - fi - AC_MSG_RESULT([$PYTHON_SITE_PKG]) - AC_SUBST([PYTHON_SITE_PKG]) -@@ -146,8 +146,8 @@ sys.stdout.write('%s\n' % distutils.sysc - PYTHON_EXTRA_LIBS='' - fi - if test -z "$PYTHON_EXTRA_LIBS"; then -- PYTHON_EXTRA_LIBS=`$PYTHON -c "import sys; import distutils.sysconfig; \ --conf = distutils.sysconfig.get_config_var; \ -+ PYTHON_EXTRA_LIBS=`$PYTHON -c "import sys; import sysconfig; \ -+conf = sysconfig.get_config_var; \ - sys.stdout.write('%s %s %s\n' % (conf('BLDLIBRARY'), conf('LOCALMODLIBS'), conf('LIBS')))"` - fi - AC_MSG_RESULT([$PYTHON_EXTRA_LIBS]) -@@ -162,8 +162,8 @@ sys.stdout.write('%s %s %s\n' % (conf('B - PYTHON_EXTRA_LDFLAGS='' - fi - if test -z "$PYTHON_EXTRA_LDFLAGS"; then -- PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import sys; import distutils.sysconfig; \ --conf = distutils.sysconfig.get_config_var; \ -+ PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import sys; import sysconfig; \ -+conf = sysconfig.get_config_var; \ - sys.stdout.write('%s\n' % conf('LINKFORSHARED'))"` - fi - AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS]) ---- a/libraries/libapparmor/swig/python/Makefile.am -+++ b/libraries/libapparmor/swig/python/Makefile.am -@@ -21,7 +21,7 @@ install-exec-local: - - clean-local: - if test -x "$(PYTHON)"; then $(PYTHON) setup.py clean; fi -- rm -rf build -+ rm -rf build LibAppArmor.egg-info - if test $(top_srcdir) != $(top_builddir) ; then rm -f libapparmor_wrap.c ; fi - - endif ---- a/libraries/libapparmor/swig/python/setup.py.in -+++ b/libraries/libapparmor/swig/python/setup.py.in -@@ -1,4 +1,4 @@ --from distutils.core import setup, Extension -+from setuptools import setup, Extension - import string - - setup(name = 'LibAppArmor', ---- a/libraries/libapparmor/swig/python/test/Makefile.am -+++ b/libraries/libapparmor/swig/python/test/Makefile.am -@@ -11,7 +11,7 @@ test_python.py: test_python.py.in $(top_ - CLEANFILES = test_python.py - - # bah, how brittle is this? --PYTHON_DIST_BUILD_PATH = '$(builddir)/../build/$$($(PYTHON) -c "import distutils.util; import platform; print(\"lib.%s-%s\" %(distutils.util.get_platform(), platform.python_version()[:3]))")' -+PYTHON_DIST_BUILD_PATH = '$(builddir)/../build/$$($(PYTHON) -c "import sysconfig; print(\"lib.%s-%s\" %(sysconfig.get_platform(), sysconfig.get_python_version()))")' - - TESTS = test_python.py - TESTS_ENVIRONMENT = \ ---- a/profiles/Makefile -+++ b/profiles/Makefile -@@ -41,7 +41,7 @@ ifdef USE_SYSTEM - LOGPROF?=aa-logprof - else - # PYTHON_DIST_BUILD_PATH based on libapparmor/swig/python/test/Makefile.am -- PYTHON_DIST_BUILD_PATH = ../libraries/libapparmor/swig/python/build/$$($(PYTHON) -c "import distutils.util; import platform; print(\"lib.%s-%s\" %(distutils.util.get_platform(), platform.python_version()[:3]))") -+ PYTHON_DIST_BUILD_PATH = ../libraries/libapparmor/swig/python/build/$$($(PYTHON) -c "import sysconfig; print(\"lib.%s-%s\" %(sysconfig.get_platform(), sysconfig.get_python_version()))") - LIBAPPARMOR_PATH=../libraries/libapparmor/src/.libs/ - LD_LIBRARY_PATH=$(LIBAPPARMOR_PATH):$(PYTHON_DIST_BUILD_PATH) - PYTHONPATH=../utils/:$(PYTHON_DIST_BUILD_PATH) ---- a/utils/Makefile -+++ b/utils/Makefile -@@ -67,6 +67,7 @@ clean: pod_clean - rm -rf staging/ build/ - rm -f apparmor/*.pyc apparmor/rule/*.pyc - rm -rf apparmor/__pycache__/ apparmor/rule/__pycache__/ -+ rm -rf apparmor.egg-info/ - - # ${CAPABILITIES} is defined in common/Make.rules - .PHONY: check_severity_db ---- a/utils/python-tools-setup.py -+++ b/utils/python-tools-setup.py -@@ -20,14 +20,14 @@ - # Note: --version=... must be the last argument to this script - # - --from distutils.command.install import install as _install --from distutils.core import setup -+from setuptools.command.install import install as _install -+from setuptools import setup - import os - import shutil - import sys - - class Install(_install, object): -- '''Override distutils to install the files where we want them.''' -+ '''Override setuptools to install the files where we want them.''' - def run(self): - # Now byte-compile everything - super(Install, self).run() ---- a/utils/test/Makefile -+++ b/utils/test/Makefile -@@ -28,7 +28,7 @@ ifdef USE_SYSTEM - PARSER= - else - # PYTHON_DIST_BUILD_PATH based on libapparmor/swig/python/test/Makefile.am -- PYTHON_DIST_BUILD_PATH = ../../libraries/libapparmor/swig/python/build/$$($(PYTHON) -c "import distutils.util; import platform; print(\"lib.%s-%s\" %(distutils.util.get_platform(), platform.python_version()[:3]))") -+ PYTHON_DIST_BUILD_PATH = ../../libraries/libapparmor/swig/python/build/$$($(PYTHON) -c "import sysconfig; print(\"lib.%s-%s\" %(sysconfig.get_platform(), sysconfig.get_python_version()))") - LIBAPPARMOR_PATH=../../libraries/libapparmor/src/.libs/ - LD_LIBRARY_PATH=$(LIBAPPARMOR_PATH):$(PYTHON_DIST_BUILD_PATH) - PYTHONPATH=..:$(PYTHON_DIST_BUILD_PATH) ---- /dev/null -+++ b/utils/test/README.md -@@ -0,0 +1,18 @@ -+# Running individual tests -+ -+Python's unittest allows individual tests to be executed by specifying the class name and the test on the command line. -+When running tests individually, the unittest framework executes the "setUp" and "tearDown" methods automatically. -+For more information, refer to the [unittest documentation](https://docs.python.org/3/library/unittest.html). -+ -+Make sure to set the environment variables pointing to the in-tree apparmor modules, and the in-tree libapparmor and its python wrapper: -+ -+```bash -+$ export PYTHONPATH=..:../../libraries/libapparmor/swig/python/build/$(/usr/bin/python3 -c "import sysconfig; print(\"lib.%s-%s\" %(sysconfig.get_platform(), sysconfig.get_python_version()))") -+$ export __AA_CONFDIR=. -+``` -+ -+To execute the test individually, run: -+ -+```bash -+$ python3 ./test-tile.py ClassFoo.test_bar -+``` -\ No newline at end of file diff --git a/utils/apparmor/patches/100-add-missing-cstdint-include.patch b/utils/apparmor/patches/100-add-missing-cstdint-include.patch deleted file mode 100644 index ff60ee271335a..0000000000000 --- a/utils/apparmor/patches/100-add-missing-cstdint-include.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 64a64be7ffb5a84f27daa9f37ae8ad92800943d3 Mon Sep 17 00:00:00 2001 -From: Sergei Trofimovich -Date: Mon, 23 May 2022 23:12:31 +0100 -Subject: [PATCH] parser/capability.h: add missing include - -Without the change apparmor build fails on this week's gcc-13 snapshot as: - - capability.h:66:6: error: variable or field '__debug_capabilities' declared void - 66 | void __debug_capabilities(uint64_t capset, const char *name); - | ^~~~~~~~~~~~~~~~~~~~ - capability.h:66:27: error: 'uint64_t' was not declared in this scope - 66 | void __debug_capabilities(uint64_t capset, const char *name); - | ^~~~~~~~ - capability.h:23:1: note: 'uint64_t' is defined in header ''; did you forget to '#include '? - 22 | #include - +++ |+#include - 23 | ---- - parser/capability.h | 1 + - 1 file changed, 1 insertion(+) - ---- a/parser/capability.h -+++ b/parser/capability.h -@@ -19,6 +19,8 @@ - #ifndef __AA_CAPABILITY_H - #define __AA_CAPABILITY_H - -+#include -+ - #define NO_BACKMAP_CAP 0xff - - #ifndef CAP_PERFMON