diff --git a/.gitignore b/.gitignore index 9c5f5782..b7f13992 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -_build \ No newline at end of file +.build \ No newline at end of file diff --git a/PKGBUILD b/PKGBUILD index 741f8004..006d063f 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -12,7 +12,7 @@ depends=('apparmor') makedepends=('bc') pkgver() { - echo "$pkgver + .1" | bc + echo "$pkgver + 0.01" | bc } prepare() { @@ -23,16 +23,20 @@ prepare() { } package() { - local _root='_build' + local _build='.build/apparmor.d' cd "$srcdir/$pkgname" # Install all files from root/ - cp --recursive --preserve=mode,ownership,timestamps "$_root/root/"* "$pkgdir/" + mapfile -t root < <(find root -type f -printf "%P\n") + for file in "${root[@]}"; do + install -Dm0644 "root/$file" "$pkgdir/$file" + done - # 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/ + # Install all files from $_build + mapfile -t build < <(find "$_build/" -type f -printf "%P\n") + for file in "${build[@]}"; do + install -Dm0644 "$_build/$file" "$pkgdir/etc/apparmor.d/$file" + done # Ensure some systemd services do not start before apparmor rules are loaded for path in systemd/*; do @@ -40,4 +44,7 @@ package() { install -Dm0644 "$path" \ "$pkgdir/usr/lib/systemd/system/$service.d/apparmor.conf" done + + # Set special access rights + chmod 0755 "$pkgdir"/usr/bin/* } diff --git a/configure b/configure index 1bf9b284..cc628375 100755 --- a/configure +++ b/configure @@ -3,7 +3,7 @@ # Copyright (C) 2021 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -readonly ROOT=_build +readonly ROOT=.build declare -a REMOVE_LIST _die() { printf '%s\n' "$*" >&2 && exit 1; } diff --git a/debian/apparmor.d.install b/debian/apparmor.d.install index b7b46f4f..43b5f89e 100644 --- a/debian/apparmor.d.install +++ b/debian/apparmor.d.install @@ -1,6 +1,6 @@ # Copyright (C) 2021 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -_build/apparmor.d/* etc/apparmor.d -_build/root/etc/* etc/ -_build/root/usr/* usr/ +.build/apparmor.d/* etc/apparmor.d +.build/root/etc/* etc/ +.build/root/usr/* usr/