updated on Sun Jan 22 16:00:49 UTC 2012
[aur-mirror.git] / apparmor / PKGBUILD
blob2fd486f852842693a11ed3465a7f9e5fa0a42882
1 # Contributor:  Thomas Mudrunka <harvie@@email..cz>
2 # Maintainer:   Thomas Mudrunka <harvie@@email..cz>
3 # You can also contact me on http://blog.harvie.cz/
4 # Maintainer: Max Fierke <max@maxfierke.com>
6 pkgbase=apparmor
7 pkgname=apparmor
8 true && pkgname=(apparmor-parser apparmor-libapparmor apparmor-utils apparmor-profiles apparmor-pam)
9 pkgver=2.7.0
10 pkgrel=3
11 arch=('i686' 'x86_64')
12 license=('GPL')
13 url='http://wiki.apparmor.net/index.php/Main_Page'
14 groups=('apparmor')
15 makedepends=('swig' 'perl' 'python2' 'ruby' 'perl-locale-gettext' 'perl-rpc-xml' 'wxgtk' 'audit')
16 #optdepends=('linux-hardened: kernel with AppArmor, SELinux, Grsecurity/PAX, and TOMOYO support')
17 pacman -Qi apparmor-libapparmor &>/dev/null &&
18         true && pkgname=(${pkgname[*]} apparmor-profile-editor apparmor-dbus) &&
19         depends=(${depends[*]} apparmor-libapparmor) &&
20         msg "Building with libapparmor dependent packages..."
22 bigver="$(echo ${pkgver} | cut -d . -f -2)"
23 source=("http://launchpad.net/apparmor/${bigver}/${pkgver}/+download/apparmor-${pkgver}.tar.gz"
24         "apparmor")
26 md5sums=('9cc38779a43004dbc7f09932fa848366'
27          '3c56820370318f6f195ea88b723ef628')
28 sha1sums=('9428e466e242b9381ac152dafb58d488c8a01921'
29           '02951f448d7a3d222472304d3135c324f9909923')
30 sha256sums=('ff8a2f49f902faa78e502590c65d3850fb9a2a3453bef0dc1f99e947c52fc60f'
31             '6dc84e8c3cdc6009ae128930a04fd8d3bf36afc2fd8f4283c234f235753fa8ca')
32 sha384sums=('badb2852546ecf4a9bf2969a6689be3da839bea7f4b06dbc8f5946a0869bbc859b1d70427e0a12318adc98127ca157c1'
33             'fa032ddb7d66050f017c4f8297ceb8affbfeaf7b7d447eb6408a23d205f495579b1eec4f127d4611c4d382ef06ae0a49')
34 sha512sums=('7573d1e99f0214f26add021b2492c19b3fd340a8b5f964ce6759a026a947f4281564264b8daa14ec30cb0817d05473e8b48a9fc24bcd93e5b4c59d9a6b99ba7d'
35             '2b4f811f923dfcf424f45d3c91c662193fab45c4a1e3f2f9bb039bd76865e93139c87df838ad57eb9fc618b0f07bcaca917f34eff008bc330d0129b79017825f')
38 #Configuration
39 core_perl_dir='/usr/bin/core_perl'
40 export MAKEFLAGS+=" POD2MAN=${core_perl_dir}/pod2man"
41 export MAKEFLAGS+=" POD2HTML=${core_perl_dir}/pod2html"
42 export MAKEFLAGS+=" PROVE=${core_perl_dir}/prove"
43 export PYTHON='/usr/bin/python2'
45 build() {
46         export srcroot="${srcdir}/${pkgbase}-${pkgver}";
49 package_apparmor-parser() {
50         pkgdesc='AppArmor parser - loads AA profiles to kernel module'
51         cd "${srcroot}/parser"; msg2 "${PWD##*/}"
53   msg2 'Patching...'
54   #Patch (maybe we can avoid patching by ./configuring things better)
55   patch=Makefile; { rm "$patch"
56     sed -e 's/pdflatex/true/g' > "$patch" #just workaround until we'll get pdflatex package
57   } < "$patch"
58   echo '#!/bin/true' > tst/caching.sh #Can't pass this test with current kernel
60         make
61         make install DESTDIR=${pkgdir}
64 package_apparmor-libapparmor() {
65         pkgdesc='AppArmor library'
66         makedepends=(swig perl python2 ruby)
67         provides=('apparmor-lib' 'libapparmor' 'apparmor-perl' 'apparmor-python' 'apparmor-ruby')
68         ( cd "${srcroot}/libraries/libapparmor"; msg2 "${PWD##*/}"
69                 ./autogen.sh
70                 ./configure --prefix=/usr --with-perl --with-python --with-ruby
71                 make
72                 make install DESTDIR=${pkgdir}
73                 #FIXME: this file should install automatically:
74                 cp swig/perl/LibAppArmor.pm ${pkgdir}/usr/lib/perl5/vendor_perl/
75                 )
78 package_apparmor-utils() {
79         pkgdesc='AppArmor userspace utilities'
80         depends=('perl' 'perl-locale-gettext' 'perl-term-readkey' 'perl-file-tail' 'perl-rpc-xml')
81         optdepends=('perl: many apparmor utilities' 'perl-rpc-xml: more utilities')
82         provides=('apparmor-notify');
83         install='apparmor.install'
84         ( cd "${srcroot}/utils"; msg2 "${PWD##*/}"
85                 make
86                 make install DESTDIR=${pkgdir}
87           mkdir -p ${pkgdir}/etc/rc.d
88           cp ../../apparmor ${pkgdir}/etc/rc.d/
89                 )
92 package_apparmor-profiles() {
93         pkgdesc='AppArmor sample pre-made profiles'
94         ( cd "${srcroot}/profiles"; msg2 "${PWD##*/}"
95                 make
96                 make install DESTDIR=${pkgdir}
97                 )
100 package_apparmor-profile-editor() {
101         pkgdesc='AppArmor profile editor using WxWidgets (or WxGTK)'
102   depends=('apparmor-libapparmor' 'wxgtk' 'audit')
103         ( cd "${srcroot}/deprecated/management/profile-editor"; msg2 "${PWD##*/}"
104                 ./macros/autogen.sh
105                 ./configure --prefix=/usr
106                 make
107                 make install DESTDIR=${pkgdir}
108                 )
111 package_apparmor-dbus() {
112         pkgdesc='AppArmor DBUS API'
113   depends=('apparmor-libapparmor')
114         ( cd "${srcroot}/deprecated/management/apparmor-dbus"; msg2 "${PWD##*/}"
115                 ./autogen.sh
116                 ./configure --prefix=/usr
117                 make
118                 make install DESTDIR=${pkgdir}
119                 )
122 package_apparmor-applet() {
123         pkgdesc='AppArmor Applet for Gnome'
124   depends=('apparmor-libapparmor')
125         #FIXME: can't build this:
126         ( cd "${srcroot}/deprecated/management/applets/apparmorapplet-gnome"; msg2 "${PWD##*/}"
127                 ./autogen.sh
128                 ./configure --prefix=/usr
129                 make
130                 make install DESTDIR=${pkgdir}
131                 )
134 package_apparmor-pam() {
135         pkgdesc='AppArmor PAM library'
136   depends=('apparmor-libapparmor')
137         ( cd "${srcroot}/changehat/pam_apparmor"; msg2 "${PWD##*/}"
138                 make
139                 make install DESTDIR=${pkgdir}
140                 )
143 #AUR hack:
144 pkgdesc='Linux application security framework - mandatory access control for programs'