meson: src/access: generate org.libvirt.api.policy

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 11:08:41 +02:00
parent d8c05d2f3c
commit 85c11323b1
2 changed files with 14 additions and 17 deletions

View File

@ -6,23 +6,6 @@ ACCESS_DRIVER_API_FILES = \
libvirt_access_lxc.xml \
$(NULL)
ACCESS_DRIVER_POLKIT_POLICY = access/org.libvirt.api.policy
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
$(top_srcdir)/scripts/genpolkit.py Makefile.am
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) \
$(top_srcdir)/scripts/genpolkit.py $< > $@ || rm -f $@
if WITH_POLKIT
polkitactiondir = $(datadir)/polkit-1/actions
if WITH_LIBVIRTD
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
endif WITH_LIBVIRTD
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
endif WITH_POLKIT
BUILT_SOURCES += \
$(ACCESS_DRIVER_API_FILES) \
$(NULL)

View File

@ -9,6 +9,8 @@ access_polkit_sources = [
'viraccessdriverpolkit.c',
]
access_perm_h = files('viraccessperm.h')
remote_path = meson.source_root() / 'src' / 'remote'
access_gen_headers = []
@ -58,6 +60,18 @@ endforeach
if conf.has('WITH_POLKIT')
access_sources += access_polkit_sources
if conf.has('WITH_LIBVIRTD')
custom_target(
'org.libvirt.api.policy',
input: access_perm_h,
output: 'org.libvirt.api.policy',
command: [ meson_python_prog, python3_prog.path(), genpolkit_prog.path(), '@INPUT@' ],
capture: true,
install: true,
install_dir: datadir / 'polkit-1' / 'actions',
)
endif
endif
virt_access_lib = static_library(