]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: src/access: generate org.libvirt.api.policy
authorPavel Hrdina <phrdina@redhat.com>
Mon, 27 Jul 2020 09:08:41 +0000 (11:08 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:05 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
src/access/Makefile.inc.am
src/access/meson.build

index 4060035ec7023234a44caf4d515eacd374fa16eb..7b311f1e6e161abd5c50b51e7e22ae79cb676207 100644 (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)
index f3b605f000989840d22327f96ddad19a257f3f35..52493dccbd6ace499f947de381c425eb44ef289a 100644 (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(