[arch-commits] Commit in apparmor/repos (2 files)

David Runge dvzrv at archlinux.org
Mon Jun 3 22:14:58 UTC 2019


    Date: Monday, June 3, 2019 @ 22:14:58
  Author: dvzrv
Revision: 476825

archrelease: copy trunk to community-staging-x86_64

Added:
  apparmor/repos/community-staging-x86_64/
  apparmor/repos/community-staging-x86_64/PKGBUILD
    (from rev 476824, apparmor/trunk/PKGBUILD)

----------+
 PKGBUILD |  113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)

Copied: apparmor/repos/community-staging-x86_64/PKGBUILD (from rev 476824, apparmor/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2019-06-03 22:14:58 UTC (rev 476825)
@@ -0,0 +1,113 @@
+# Maintainer: David Runge <dave at sleepmap.de>
+pkgname=apparmor
+pkgver=2.13.2
+pkgrel=3
+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' 'pam' 'python')
+makedepends=('apache' 'ruby' 'swig')
+checkdepends=('dejagnu' 'python-pyflakes')
+optdepends=('perl: perl bindings'
+            'ruby: ruby bindings')
+provides=('libapparmor')
+replaces=('apparmor-libapparmor' 'apparmor-pam' 'apparmor-parser'
+'apparmor-profiles' 'apparmor-utils' 'apparmor-vim')
+backup=('etc/apparmor/easyprof.conf'
+        'etc/apparmor/logprof.conf'
+        'etc/apparmor/notify.conf'
+        'etc/apparmor/parser.conf'
+        'etc/apparmor/subdomain.conf'
+        'etc/apparmor/severity.db')
+source=("https://launchpad.net/${pkgname}/${pkgver%.[0-9]}/${pkgver}/+download/${pkgname}-${pkgver}.tar.gz"{,.asc})
+sha512sums=('2e5f84ced12c9de1a862e1a3258e8424f1f0d3c986947aec9d88a9258729a584953d00591c8902aa41e664acf9a639dab96d025c3a1ed3f91f0edce8d028b58f'
+            'SKIP')
+# AppArmor Development Team (AppArmor signing key) <apparmor at lists.ubuntu.com>
+validpgpkeys=('3ECDCBA5FB34D254961CC53F6689E64E3D3664BB')
+_core_perl="/usr/bin/core_perl"
+
+prepare() {
+  cd "${pkgname}-${pkgver}"
+  # fix PYTHONPATH for aa-logprof based check
+  local _py3_ver=$(python --version | cut -d " " -f2)
+  local path="${PWD}/libraries/libapparmor/swig/python/build/lib.linux-${CARCH}-${_py3_ver%"."*}/LibAppArmor"
+  local libs="${PWD}/libraries/libapparmor/src/.libs"
+  sed -e "/PYTHONPATH/ s|utils\ |utils:$path\ LD_LIBRARY_PATH=$libs\ |" \
+      -i profiles/Makefile
+  # remove test-aa.py (utils check), producing too many fails
+  rm -v utils/test/test-aa.py
+  # fix bin directory for parser install target
+  # fix lib dir location
+  sed -e 's|/usr/sbin|/usr/bin|g' \
+      -e 's|/sbin|/usr/bin|g' \
+      -e 's/\}\/lib\/apparmor/\}\/usr\/lib\/apparmor/' \
+      -i parser/Makefile
+  # fix default installation path for vim syntax file
+  sed -e 's/share\/apparmor/share\/vim\/vimfiles\/syntax/' \
+      -i utils/vim/Makefile
+  cd libraries/libapparmor/
+  autoreconf -vfi
+}
+
+build() {
+  # export required perl executable locations
+  export MAKEFLAGS+=" POD2MAN=${_core_perl}/pod2man"
+  export MAKEFLAGS+=" POD2HTML=${_core_perl}/pod2html"
+  export MAKEFLAGS+=" PODCHECKER=${_core_perl}/podchecker"
+  export MAKEFLAGS+=" PROVE=${_core_perl}/prove"
+  cd "${pkgname}-${pkgver}/libraries/libapparmor/"
+  ./configure --prefix=/usr \
+              --sbindir=/usr/bin \
+              --with-perl \
+              --with-python \
+              --with-ruby
+  make
+  cd ../..
+  make -C binutils
+  make -C parser
+  make -C profiles
+  make -C utils
+  make -C changehat/pam_apparmor
+  make -C changehat/mod_apparmor
+  make -C utils/vim
+}
+
+check() {
+  cd "$pkgname-$pkgver"
+# failing python checks:
+# https://gitlab.com/apparmor/apparmor/issues/33
+#  make -C libraries/libapparmor check
+  make -C binutils check
+# parser checks don't run on non-apparmor enabled kernel
+#  make -C parser check
+# profiles check need to be run on a system with aa installed?
+#  make -C profiles check
+  make -C utils check
+}
+
+package() {
+  cd "$pkgname-$pkgver"
+  make -C libraries/libapparmor DESTDIR="${pkgdir}" install
+  make -C changehat/pam_apparmor DESTDIR="${pkgdir}/usr" install
+  make -C changehat/mod_apparmor DESTDIR="${pkgdir}" install
+  make -C binutils DESTDIR="${pkgdir}" install
+  make -C parser DESTDIR="${pkgdir}" install
+  make -C parser DESTDIR="${pkgdir}" install-systemd
+  make -C profiles DESTDIR="${pkgdir}" install
+  make -C utils DESTDIR="${pkgdir}" BINDIR="${pkgdir}/usr/bin" install
+  # strip perl library
+  find "${pkgdir}/usr/lib/perl5/" \
+    -type f -iname "*.so" \
+    -exec strip --strip-unneeded {} \;
+  # removing empty core_perl directory
+  rm -rv "${pkgdir}"/usr/lib/perl5/*/core_perl
+  # move ruby bindings to vendor_ruby
+  mv -v "${pkgdir}/usr/lib/ruby/site_ruby/" \
+    "${pkgdir}/usr/lib/ruby/vendor_ruby/"
+  # adding files below /etc/apparmor.d to backup array
+  cd "${pkgdir}"
+  # tricking extract_function_variable() in makepkg into not detecting the
+  # backup array modification
+  [[ /usr/bin/true ]] && backup=( ${backup[@]} $(find "etc/${pkgname}.d/" -type f) )
+}


More information about the arch-commits mailing list