meson: src/security: install apparmor profile files

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-07-27 09:09:07 +02:00
parent 5adcf83a36
commit de389dddad
5 changed files with 43 additions and 61 deletions

View File

@ -23,8 +23,6 @@
BUILT_SOURCES =
DRIVER_SOURCE_FILES =
STATEFUL_DRIVER_SOURCE_FILES =
INSTALL_DATA_LOCAL =
UNINSTALL_LOCAL =
SYM_FILES =
USED_SYM_FILES =
augeas_DATA =
@ -34,7 +32,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
@ -198,7 +195,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)

View File

@ -1,54 +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@|' \
$< > $@
BUILT_SOURCES += $(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES)
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

View File

@ -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',
)

View File

@ -0,0 +1 @@
# Site-specific additions and overrides for 'usr.lib.libvirt.virt-aa-helper'

View File

@ -51,3 +51,7 @@ if conf.has('WITH_LIBVIRTD') and conf.has('WITH_APPARMOR')
],
}
endif
if conf.has('WITH_APPARMOR_PROFILES')
subdir('apparmor')
endif