2022-10-05 00:17:52 +02:00
|
|
|
#!/usr/bin/make -f
|
2022-10-16 00:11:31 +02:00
|
|
|
# apparmor.d - Full set of apparmor profiles
|
|
|
|
# Copyright (C) 2022 Alexandre Pujol <alexandre@pujol.io>
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2022-10-05 00:17:52 +02:00
|
|
|
|
2022-10-16 00:11:31 +02:00
|
|
|
DESTDIR ?= /
|
|
|
|
BUILD := .build
|
2022-10-05 00:17:52 +02:00
|
|
|
PKGNAME := apparmor.d
|
|
|
|
|
2022-10-16 00:11:31 +02:00
|
|
|
.PHONY: all install lint archlinux debian ubuntu whonix clean
|
2022-10-05 00:17:52 +02:00
|
|
|
|
|
|
|
all:
|
2022-10-16 00:11:31 +02:00
|
|
|
@go build -o ${BUILD}/ ./cmd/aa-log
|
2022-10-05 00:17:52 +02:00
|
|
|
|
2022-10-16 00:11:31 +02:00
|
|
|
ROOT = $(shell find "${BUILD}/root" -type f -printf "%P\n")
|
|
|
|
PROFILES = $(shell find "${BUILD}/apparmor.d" -type f -printf "%P\n")
|
2022-10-05 00:17:52 +02:00
|
|
|
install:
|
2022-10-16 00:11:31 +02:00
|
|
|
@install -Dm755 ${BUILD}/aa-log ${DESTDIR}/usr/bin/aa-log
|
|
|
|
@for file in ${ROOT}; do \
|
|
|
|
install -Dm0644 "${BUILD}/root/$${file}" "${DESTDIR}/$${file}"; \
|
|
|
|
done;
|
|
|
|
@for file in ${PROFILES}; do \
|
|
|
|
install -Dm0644 "${BUILD}/apparmor.d/$${file}" "${DESTDIR}/etc/apparmor.d/$${file}"; \
|
|
|
|
done;
|
|
|
|
@for file in systemd/system/*; do \
|
|
|
|
service="$$(basename "$$file")"; \
|
|
|
|
install -Dm0644 "$${file}" "${DESTDIR}/usr/lib/systemd/system/$${service}.d/apparmor.conf"; \
|
|
|
|
done;
|
|
|
|
@for file in systemd/user/*; do \
|
|
|
|
service="$$(basename "$$file")"; \
|
|
|
|
install -Dm0644 "$${file}" "${DESTDIR}/usr/lib/systemd/user/$${service}.d/apparmor.conf"; \
|
|
|
|
done
|
2022-10-05 00:17:52 +02:00
|
|
|
|
|
|
|
lint:
|
|
|
|
@shellcheck --shell=bash \
|
|
|
|
PKGBUILD configure pick dists/build/build.sh \
|
|
|
|
debian/${PKGNAME}.postinst debian/${PKGNAME}.postrm
|
|
|
|
|
|
|
|
archlinux:
|
|
|
|
@bash dists/build/build.sh archlinux
|
|
|
|
|
|
|
|
debian:
|
|
|
|
@bash dists/build/build.sh debian
|
|
|
|
|
|
|
|
ubuntu:
|
|
|
|
@bash dists/build/build.sh ubuntu
|
|
|
|
|
|
|
|
whonix:
|
|
|
|
@bash dists/build/build.sh whonix
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -rf \
|
|
|
|
debian/.debhelper debian/debhelper* debian/*.debhelper \
|
|
|
|
${PKGNAME}-*.pkg.tar.zst.sig ${PKGNAME}-*.pkg.tar.zst \
|
2022-10-16 00:11:31 +02:00
|
|
|
${PKGNAME}_*.* ${BUILD}
|