build: improve PKGBUILD install.

This commit is contained in:
Alexandre Pujol 2022-05-21 18:07:03 +01:00
parent ddf27516bd
commit fc7d0afb1f
Failed to generate hash of commit

View file

@ -37,22 +37,22 @@ package() {
local _build='.build' local _build='.build'
cd "$srcdir/$pkgname" cd "$srcdir/$pkgname"
# Install all files from $_build/root # Install all system files
mapfile -t root < <(find "$_build/root" -type f -printf "%P\n") mapfile -t root < <(find "$_build/root" -type f -printf "%P\n")
for file in "${root[@]}"; do for file in "${root[@]}"; do
install -Dm0644 "$_build/root/$file" "$pkgdir/$file" install -Dm0644 "$_build/root/$file" "$pkgdir/$file"
done done
# Install all files from $_build/apparmor.d # Install all apparmor profiles
mapfile -t apparmor < <(find "$_build/apparmor.d" -type f -printf "%P\n") mapfile -t profiles < <(find "$_build/apparmor.d" -type f -printf "%P\n")
for file in "${apparmor[@]}"; do for file in "${profiles[@]}"; do
install -Dm0644 "$_build/apparmor.d/$file" "$pkgdir/etc/apparmor.d/$file" install -Dm0644 "$_build/apparmor.d/$file" "$pkgdir/etc/apparmor.d/$file"
done done
# Ensure some systemd services do not start before apparmor rules are loaded # Ensure some systemd services do not start before apparmor rules are loaded
for path in systemd/*; do for file in systemd/*; do
service=$(basename "$path") service=$(basename "$file")
install -Dm0644 "$path" \ install -Dm0644 "$file" \
"$pkgdir/usr/lib/systemd/system/$service.d/apparmor.conf" "$pkgdir/usr/lib/systemd/system/$service.d/apparmor.conf"
done done