Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/Makefile.am | 7 ---
src/security/Makefile.inc.am | 52 -------------------
src/security/apparmor/meson.build | 38 ++++++++++++++
.../usr.lib.libvirt.virt-aa-helper.local | 1 +
src/security/meson.build | 4 ++
5 files changed, 43 insertions(+), 59 deletions(-)
delete mode 100644 src/security/Makefile.inc.am
create mode 100644 src/security/apparmor/meson.build
create mode 100644 src/security/apparmor/usr.lib.libvirt.virt-aa-helper.local
diff --git a/src/Makefile.am b/src/Makefile.am
index acdbe30e0e0..18cc33185a0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,8 +22,6 @@
DRIVER_SOURCE_FILES =
STATEFUL_DRIVER_SOURCE_FILES =
-INSTALL_DATA_LOCAL =
-UNINSTALL_LOCAL =
SYM_FILES =
USED_SYM_FILES =
augeas_DATA =
@@ -33,7 +31,6 @@ tapset_DATA =
endif WITH_DTRACE_PROBES
RPC_PROBE_FILES =
-include security/Makefile.inc.am
include locking/Makefile.inc.am
include admin/Makefile.inc.am
include vbox/Makefile.inc.am
@@ -193,7 +190,3 @@ libvirt_functions.stp: $(RPC_PROBE_FILES)
$(top_srcdir)/scripts/gensystemtap.py
$(RPC_PROBE_FILES) > $@
endif WITH_DTRACE_PROBES
-
-install-data-local: $(INSTALL_DATA_LOCAL)
-
-uninstall-local: $(UNINSTALL_LOCAL)
diff --git a/src/security/Makefile.inc.am b/src/security/Makefile.inc.am
deleted file mode 100644
index 50e2706be9f..00000000000
--- a/src/security/Makefile.inc.am
+++ /dev/null
@@ -1,52 +0,0 @@
-# vim: filetype=automake
-
-SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES_IN = \
- security/apparmor/usr.lib.libvirt.virt-aa-helper.in \
- security/apparmor/usr.sbin.libvirtd.in \
- $(NULL)
-
-SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES = \
- $(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES_IN:%.in=%)
- $(NULL)
-
-security/apparmor/%: $(srcdir)/security/apparmor/%.in
- $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \
- $(SED) \
- -e 's|[@]sysconfdir[@]|@sysconfdir@|' \
- -e 's|[@]sbindir[@]|@sbindir@|' \
- -e 's|[@]runstatedir[@]|@runstatedir@|' \
- -e 's|[@]libexecdir[@]|@libexecdir@|' \
- $< > $@
-
-if WITH_APPARMOR_PROFILES
-apparmordir = $(sysconfdir)/apparmor.d/
-apparmor_DATA = \
- $(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES)
- $(NULL)
-
-abstractionsdir = $(apparmordir)/abstractions
-abstractions_DATA = \
- security/apparmor/libvirt-qemu \
- security/apparmor/libvirt-lxc \
- $(NULL)
-
-templatesdir = $(apparmordir)/libvirt
-templates_DATA = \
- security/apparmor/TEMPLATE.qemu \
- security/apparmor/TEMPLATE.lxc \
- $(NULL)
-
-APPARMOR_LOCAL_DIR = "$(DESTDIR)$(apparmordir)/local"
-install-apparmor-local: $(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES)
- $(MKDIR_P) "$(APPARMOR_LOCAL_DIR)"
- echo "# Site-specific additions and overrides for \
- 'usr.lib.libvirt.virt-aa-helper'" \
- >"$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper"
-
-uninstall-apparmor-local:
- rm -f "$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper"
- rmdir "$(APPARMOR_LOCAL_DIR)" || :
-
-INSTALL_DATA_LOCAL += install-apparmor-local
-UNINSTALL_LOCAL += uninstall-apparmor-local
-endif WITH_APPARMOR_PROFILES
diff --git a/src/security/apparmor/meson.build b/src/security/apparmor/meson.build
new file mode 100644
index 00000000000..af437802112
--- /dev/null
+++ b/src/security/apparmor/meson.build
@@ -0,0 +1,38 @@
+apparmor_gen_profiles = [
+ 'usr.lib.libvirt.virt-aa-helper',
+ 'usr.sbin.libvirtd',
+]
+
+apparmor_gen_profiles_conf = configuration_data()
+apparmor_gen_profiles_conf.set('sysconfdir', sysconfdir)
+apparmor_gen_profiles_conf.set('sbindir', sbindir)
+apparmor_gen_profiles_conf.set('runstatedir', runstatedir)
+apparmor_gen_profiles_conf.set('libexecdir', libexecdir)
+
+apparmor_dir = sysconfdir / 'apparmor.d'
+
+foreach name : apparmor_gen_profiles
+ configure_file(
+ input: '@0@.in'.format(name),
+ output: name,
+ configuration: apparmor_gen_profiles_conf,
+ install: true,
+ install_dir: apparmor_dir,
+ )
+endforeach
+
+install_data(
+ [ 'libvirt-qemu', 'libvirt-lxc' ],
+ install_dir: apparmor_dir / 'abstractions',
+)
+
+install_data(
+ [ 'TEMPLATE.qemu', 'TEMPLATE.lxc' ],
+ install_dir: apparmor_dir / 'libvirt',
+)
+
+install_data(
+ 'usr.lib.libvirt.virt-aa-helper.local',
+ install_dir: apparmor_dir / 'local',
+ rename: 'usr.lib.libvirt.virt-aa-helper',
+)
diff --git a/src/security/apparmor/usr.lib.libvirt.virt-aa-helper.local
b/src/security/apparmor/usr.lib.libvirt.virt-aa-helper.local
new file mode 100644
index 00000000000..c0990e51d0b
--- /dev/null
+++ b/src/security/apparmor/usr.lib.libvirt.virt-aa-helper.local
@@ -0,0 +1 @@
+# Site-specific additions and overrides for 'usr.lib.libvirt.virt-aa-helper'
diff --git a/src/security/meson.build b/src/security/meson.build
index 4014ddccc45..4f876c03c2d 100644
--- a/src/security/meson.build
+++ b/src/security/meson.build
@@ -51,3 +51,7 @@ if conf.has('WITH_LIBVIRTD') and
conf.has('WITH_APPARMOR')
],
}
endif
+
+if conf.has('WITH_APPARMOR_PROFILES')
+ subdir('apparmor')
+endif
--
2.26.2