2021-04-02 19:12:15 +02:00
|
|
|
# Maintainer: Alexandre Pujol <alexandre@pujol.io>
|
|
|
|
# shellcheck disable=SC2034,SC2154,SC2164
|
|
|
|
|
|
|
|
pkgname=apparmor.d
|
2021-04-10 18:17:23 +02:00
|
|
|
pkgver=21
|
2021-04-02 19:12:15 +02:00
|
|
|
pkgrel=1
|
|
|
|
pkgdesc="Full set of apparmor profiles"
|
|
|
|
arch=("any")
|
|
|
|
url="https://gitlab.com/archlex/hardening/$pkgname"
|
|
|
|
license=('GPL2')
|
|
|
|
depends=('apparmor')
|
2021-04-10 18:17:23 +02:00
|
|
|
makedepends=('bc')
|
2021-04-02 19:12:15 +02:00
|
|
|
|
|
|
|
pkgver() {
|
2021-04-10 18:17:23 +02:00
|
|
|
echo "$pkgver + .1" | bc
|
2021-04-02 19:12:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
prepare() {
|
2021-04-04 00:51:57 +02:00
|
|
|
git clone "$startdir" "$srcdir/$pkgname"
|
2021-04-02 19:12:15 +02:00
|
|
|
cd "$srcdir/$pkgname"
|
|
|
|
|
2021-04-04 22:38:07 +02:00
|
|
|
./configure --distribution=archlinux
|
2021-04-02 19:12:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
local _root='_build'
|
|
|
|
cd "$srcdir/$pkgname"
|
|
|
|
|
|
|
|
# Install all files from root/
|
|
|
|
cp --recursive --preserve=mode,ownership,timestamps "$_root/root/"* "$pkgdir/"
|
|
|
|
|
|
|
|
# Install all files from apparmor.d/
|
|
|
|
install -d "$pkgdir"/etc/apparmor.d/
|
|
|
|
cp --recursive --preserve=mode,ownership,timestamps \
|
|
|
|
$_root/apparmor.d/* "$pkgdir"/etc/apparmor.d/
|
|
|
|
|
|
|
|
# Ensure some systemd services do not start before apparmor rules are loaded
|
|
|
|
for path in systemd/*; do
|
|
|
|
service=$(basename "$path")
|
|
|
|
install -Dm0644 "$path" \
|
|
|
|
"$pkgdir/usr/lib/systemd/system/$service.d/apparmor.conf"
|
|
|
|
done
|
|
|
|
}
|