Better install params.

This commit is contained in:
Alexandre Pujol 2021-05-01 14:27:14 +01:00
parent 0c494ed2ba
commit 355235b3cc
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
4 changed files with 19 additions and 12 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
_build .build

View File

@ -12,7 +12,7 @@ depends=('apparmor')
makedepends=('bc') makedepends=('bc')
pkgver() { pkgver() {
echo "$pkgver + .1" | bc echo "$pkgver + 0.01" | bc
} }
prepare() { prepare() {
@ -23,16 +23,20 @@ prepare() {
} }
package() { package() {
local _root='_build' local _build='.build/apparmor.d'
cd "$srcdir/$pkgname" cd "$srcdir/$pkgname"
# Install all files from root/ # 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 all files from $_build
install -d "$pkgdir"/etc/apparmor.d/ mapfile -t build < <(find "$_build/" -type f -printf "%P\n")
cp --recursive --preserve=mode,ownership,timestamps \ for file in "${build[@]}"; do
$_root/apparmor.d/* "$pkgdir"/etc/apparmor.d/ install -Dm0644 "$_build/$file" "$pkgdir/etc/apparmor.d/$file"
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 path in systemd/*; do
@ -40,4 +44,7 @@ package() {
install -Dm0644 "$path" \ install -Dm0644 "$path" \
"$pkgdir/usr/lib/systemd/system/$service.d/apparmor.conf" "$pkgdir/usr/lib/systemd/system/$service.d/apparmor.conf"
done done
# Set special access rights
chmod 0755 "$pkgdir"/usr/bin/*
} }

2
configure vendored
View File

@ -3,7 +3,7 @@
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io> # Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
readonly ROOT=_build readonly ROOT=.build
declare -a REMOVE_LIST declare -a REMOVE_LIST
_die() { printf '%s\n' "$*" >&2 && exit 1; } _die() { printf '%s\n' "$*" >&2 && exit 1; }

View File

@ -1,6 +1,6 @@
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io> # Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
_build/apparmor.d/* etc/apparmor.d .build/apparmor.d/* etc/apparmor.d
_build/root/etc/* etc/ .build/root/etc/* etc/
_build/root/usr/* usr/ .build/root/usr/* usr/