summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authornl67202022-06-06 11:11:32 +0300
committernl67202022-06-06 11:11:32 +0300
commitf110a06ec3dc40d2a58bb7cebc20cff77820bcdb (patch)
tree2f933cc58fb167524de2d723c59d07f8ff7c49db
parentaa0ffd309e8043bf11c94881d755a54eb3a5c8db (diff)
downloadaur-f110a06ec3dc40d2a58bb7cebc20cff77820bcdb.tar.gz
apparmor-git 3.0.0.r519.g2a3140cb-1
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD75
2 files changed, 56 insertions, 26 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f88fe2062375..549fd0e4740e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = apparmor-git
pkgdesc = Mandatory Access Control (MAC) using Linux Security Module (LSM)
- pkgver = 3.0.0.r104.gd86b7acd
+ pkgver = 3.0.0.r519.g2a3140cb
pkgrel = 1
url = https://gitlab.com/apparmor/apparmor
arch = x86_64
@@ -14,6 +14,7 @@ pkgbase = apparmor-git
makedepends = git
makedepends = apache
makedepends = libxcrypt
+ makedepends = python-setuptools
makedepends = perl
makedepends = ruby
makedepends = swig
@@ -26,9 +27,10 @@ pkgbase = apparmor-git
optdepends = python-notify2: for aa-notify
optdepends = python-psutil: for aa-notify
optdepends = ruby: for ruby bindings
- provides = apparmor=3.0.0.r104.gd86b7acd
+ provides = apparmor=3.0.0.r519.g2a3140cb
provides = libapparmor.so
conflicts = apparmor
+ options = !lto
backup = etc/apparmor/easyprof.conf
backup = etc/apparmor/logprof.conf
backup = etc/apparmor/notify.conf
@@ -39,4 +41,3 @@ pkgbase = apparmor-git
sha512sums = SKIP
pkgname = apparmor-git
-
diff --git a/PKGBUILD b/PKGBUILD
index 373868fa8f65..dfa0965eb5ce 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,14 +2,14 @@
# Contributor: David Runge <dave@sleepmap.de>
pkgname=apparmor-git
-pkgver=3.0.0.r104.gd86b7acd
+pkgver=3.0.0.r519.g2a3140cb
pkgrel=1
pkgdesc='Mandatory Access Control (MAC) using Linux Security Module (LSM)'
arch=('x86_64')
url='https://gitlab.com/apparmor/apparmor'
license=('GPL2' 'LGPL2.1')
depends=('audit' 'bash' 'glibc' 'pam' 'python')
-makedepends=('git' 'apache' 'libxcrypt' 'perl' 'ruby' 'swig')
+makedepends=('git' 'apache' 'libxcrypt' 'python-setuptools' 'perl' 'ruby' 'swig')
checkdepends=('dejagnu' 'perl-locale-gettext' 'python-pyflakes' 'python-notify2' 'python-psutil')
optdepends=('perl: for perl bindings'
'python-notify2: for aa-notify'
@@ -22,6 +22,8 @@ backup=('etc/apparmor/easyprof.conf'
'etc/apparmor/notify.conf'
'etc/apparmor/parser.conf'
'etc/apparmor/severity.db')
+# LTO is currently still broken: https://gitlab.com/apparmor/apparmor/-/issues/214
+options=(!lto)
source=('git+https://gitlab.com/apparmor/apparmor.git')
sha512sums=('SKIP')
# AppArmor Development Team (AppArmor signing key) <apparmor@lists.ubuntu.com>
@@ -39,13 +41,16 @@ prepare() {
# 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
- cd "${srcdir}/${pkgname%-git}/libraries/libapparmor"
- ./autogen.sh
+ (
+ cd libraries/libapparmor/
+ autoreconf -fiv
+ )
}
build() {
@@ -54,16 +59,19 @@ build() {
export MAKEFLAGS+=" POD2HTML=${_core_perl}/pod2html"
export MAKEFLAGS+=" PODCHECKER=${_core_perl}/podchecker"
export MAKEFLAGS+=" PROVE=${_core_perl}/prove"
- cd "${srcdir}/${pkgname%-git}/libraries/libapparmor"
- ./configure \
- --prefix=/usr \
- --sbindir=/usr/bin \
- --sysconfdir=/etc \
- --with-pic \
- --with-perl \
- --with-python \
- --with-ruby
- make
+
+ (
+ cd "${srcdir}/${pkgname%-git}/libraries/libapparmor"
+ ./configure \
+ --prefix=/usr \
+ --sbindir=/usr/bin \
+ --sysconfdir=/etc \
+ --with-pic \
+ --with-perl \
+ --with-python \
+ --with-ruby
+ make
+ )
cd "${srcdir}/${pkgname%-git}"
make -C binutils
make -C parser
@@ -72,17 +80,34 @@ build() {
make -C changehat/pam_apparmor
make -C changehat/mod_apparmor
make -C utils/vim
+
+ # copy to test location as some tests render the resulting python bytecode
+ # unreproducible: https://gitlab.com/apparmor/apparmor/-/issues/184
+ cd ..
+ cp -av "${srcdir}/${pkgname%-git}" "${srcdir}/${pkgname%-git}-test"
}
check() {
- cd "${srcdir}/${pkgname%-git}"
+ cd "${srcdir}/${pkgname%-git}-test"
+ echo "INFO: Running check: libraries/libapparmor"
make -C libraries/libapparmor check
+ echo "INFO: Running check binutils"
make -C binutils check
- make -C parser check
- # only running check-parser, as check-logprof (included in check) fails:
- # https://gitlab.com/apparmor/apparmor/issues/36
+ # echo "INFO: Running check parser"
+ # make -C parser check
+ # NOTE: the profiles checks are notoriously broken, so run each separately
+ echo "INFO: Running check-abstractions.d profiles"
+ make -C profiles check-abstractions.d
+ # many hardcoded paths are not accounted for:
+ # https://gitlab.com/apparmor/apparmor/-/issues/137
+ # echo "INFO: Running check-logprof profiles"
+ # make -C profiles check-logprof
+ echo "INFO: Running check-parser profiles"
make -C profiles check-parser
- make PYFLAKES='pyflakes' -C utils check
+ echo "INFO: Running check utils"
+ # we do not care about linting when running tests
+ # https://gitlab.com/apparmor/apparmor/-/issues/121
+ make PYFLAKES='/usr/bin/true' -C utils check
}
package() {
@@ -91,10 +116,14 @@ package() {
make -C changehat/pam_apparmor DESTDIR="${pkgdir}" SECDIR="${pkgdir}/usr/lib/security" install
make -C changehat/mod_apparmor DESTDIR="${pkgdir}" install
make -C binutils DESTDIR="${pkgdir}" SBINDIR="${pkgdir}/usr/bin" USR_SBINDIR="${pkgdir}/usr/bin" install
- make -C parser DESTDIR="${pkgdir}" APPARMOR_BIN_PREFIX="${pkgdir}/usr/lib/apparmor" SBINDIR="${pkgdir}/usr/bin" USR_SBINDIR="${pkgdir}/usr/bin" install
- make -C parser DESTDIR="${pkgdir}" APPARMOR_BIN_PREFIX="${pkgdir}/usr/lib/apparmor" SBINDIR="${pkgdir}/usr/bin" USR_SBINDIR="${pkgdir}/usr/bin" install-systemd
+ make -C parser -j1 DESTDIR="${pkgdir}" APPARMOR_BIN_PREFIX="${pkgdir}/usr/lib/apparmor" SBINDIR="${pkgdir}/usr/bin" USR_SBINDIR="${pkgdir}/usr/bin" install install-systemd
make -C profiles DESTDIR="${pkgdir}" install
make -C utils DESTDIR="${pkgdir}" BINDIR="${pkgdir}/usr/bin" SBINDIR="${pkgdir}/usr/bin" USR_SBINDIR="${pkgdir}/usr/bin" VIM_INSTALL_PATH="${pkgdir}/usr/share/vim/vimfiles/syntax" install
+
+ # set file mode to allow the perl library to be stripped:
+ # https://gitlab.com/apparmor/apparmor/issues/34
+ find "${pkgdir}/usr/lib/perl5/" -type f -iname "*.so" -exec chmod 755 {} \;
+
# removing empty core_perl directory:
# https://gitlab.com/apparmor/apparmor/issues/40
rm -rv "${pkgdir}/usr/lib/perl5/"*/core_perl