archey4/packaging/after_install
Samuel FORESTIER d4a6b16823
[PACKAGING] Provides a dedicated AppArmor profile (#119)
Co-authored-by: Alexandre Pujol <alexandre@pujol.io>
Co-authored-by: Michael Bromilow <developer@bromilow.uk>
2024-04-13 17:20:48 +00:00

25 lines
624 B
Bash

#!/bin/sh
set -e
# Handles AppArmor profile (see dh_apparmor).
APP_PROFILE="/etc/apparmor.d/usr.bin.archey4"
if [ -f "$APP_PROFILE" ]; then
# Add the local/ include
LOCAL_APP_PROFILE="/etc/apparmor.d/local/usr.bin.archey4"
test -e "$LOCAL_APP_PROFILE" || {
mkdir -p "$(dirname "$LOCAL_APP_PROFILE")"
install --mode 644 /dev/null "$LOCAL_APP_PROFILE"
}
# Reload the profile, including any abstraction updates
if aa-enabled --quiet 2>/dev/null; then
apparmor_parser -r -T -W "$APP_PROFILE" || true
fi
fi
# Creates a symbolic link providing `archey4` command alias.
ln -s -f /usr/bin/archey /usr/bin/archey4