1 pkgname=apparmor-essentials
6 pkgdesc="AppArmor Linux application security framework - mandatory access control for programs"
8 url="https://launchpad.net/apparmor"
9 license=('GPL2' 'LGPL2.1')
10 depends=('python2' 'gcc-libs' 'pam' 'perl-locale-gettext' 'perl-term-readkey' 'perl-file-tail' 'perl-rpc-xml')
11 # Cover the following AUR packages, we are only (?) missing the Ruby bindings:
12 provides=('apparmor' 'apparmor-parser' 'apparmor-libapparmor' 'apparmor-utils' 'apparmor-pam')
13 conflicts=('apparmor' 'apparmor-parser' 'apparmor-libapparmor' 'apparmor-utils' 'apparmor-pam')
14 makedepends=('swig' 'chrpath')
15 options=('!libtool' '!emptydirs')
16 source=("https://launchpad.net/$_pkgname/${pkgver%.*}/$pkgver/+download/$_pkgname-$pkgver.tar.gz"{,.asc}
18 backup=('etc/apparmor/subdomain.conf'
19 'etc/apparmor/severity.db'
20 'etc/apparmor/parser.conf'
21 'etc/apparmor/logprof.conf'
22 'etc/apparmor/notify.conf')
23 sha256sums=('ff8a2f49f902faa78e502590c65d3850fb9a2a3453bef0dc1f99e947c52fc60f'
24 '3808a43701da8b8fd16ef7e8bc48ecafffb37083b4d317ac5b66c1e893488bcd'
25 'd1758f84a69173a852e598fa55e69df0d73b8b62c6993b0ba04aa21d539213e6')
27 # 1024D/AC931271 2006-02-13 AppArmor Development Team (AppArmor signing key) <apparmor@lists.ubuntu.com>
28 # Primary key fingerprint: 31C1 A553 DAC7 2D85 DDEE 5BF7 8137 98B9 AC93 1271
32 # export LDFLAGS="${LDFLAGS} -Wl,--fatal-warnings,--no-undefined"
34 core_perl_dir='/usr/bin/core_perl'
35 export PYTHON='/usr/bin/python2'
36 export MAKEFLAGS+=" POD2MAN=${core_perl_dir}/pod2man"
37 export MAKEFLAGS+=" POD2HTML=${core_perl_dir}/pod2html"
38 export MAKEFLAGS+=" PROVE=${core_perl_dir}/prove"
40 cd "$srcdir/$_pkgname-$_pkgver/libraries/libapparmor"
42 # We need perl and python anyway, may as well build the bindings...
45 ./configure --prefix=/usr --sysconfdir=/etc \
46 --disable-static --enable-shared --with-perl --with-python --with-pic
48 sed -i "s|pdflatex|true|g" ../../parser/Makefile # texlive-bin is a huge makedepend for little gain. (techdoc.pdf)
52 make -C ../../parser \
53 AARE_LDFLAGS="$LDFLAGS -Wl,--as-needed -lstdc++" AAREOBJECTS=libapparmor_re/libapparmor_re.a # Fix static linking.
54 make -C ../../changehat/pam_apparmor LIBS="$LDFLAGS -lpam -lapparmor"
59 # For the moment this deals only with the parser:
60 make -k -C "$srcdir/$_pkgname-$_pkgver/parser" -j1 check || true # Check for non-trivial errors.
65 export MAKEFLAGS+=" DESTDIR=${pkgdir}"
67 cd "$srcdir/$_pkgname-$_pkgver/libraries/libapparmor"
70 make -C ../../utils install
71 make -C ../../parser \
72 AARE_LDFLAGS="$LDFLAGS -Wl,--as-needed -lstdc++" AAREOBJECTS=libapparmor_re/libapparmor_re.a install
73 make -C ../../changehat/pam_apparmor install
75 cp 'swig/perl/LibAppArmor.pm' "$pkgdir/usr/lib/perl5/vendor_perl"
76 sed -i '1s/python$/python2/' "$pkgdir/usr/sbin/aa-status"
77 chrpath -d "$pkgdir/usr/lib/perl5/vendor_perl/auto/LibAppArmor/LibAppArmor.so"
78 rm -rv "$pkgdir/lib/apparmor" # Nothing useful in there.
80 gcc -O2 "$srcdir/dlopen.c" -o dlopen -ldl
82 for module in "$pkgdir"/lib/security/*.so ; do
83 if ! env LD_PRELOAD='' LD_LIBRARY_PATH="$pkgdir/usr/lib" ./dlopen ${module} ; then
84 error "Sanity check failed: ${module} cannot be loaded, exiting."
91 # vim:set ts=2 sw=2 et: