
On Thu, Jul 16, 2020 at 11:57:38 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 5 -- src/meson.build | 103 +++++++++++++++++++++++++++++++++++++++++ src/remote/meson.build | 26 +++++++++++ 3 files changed, 129 insertions(+), 5 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 99bb71e6a03..471ebae2b79 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -69,13 +69,8 @@ include storage/Makefile.inc.am include remote/Makefile.inc.am
-confdir = $(sysconfdir)/libvirt conf_DATA += libvirt.conf
-augeasdir = $(datadir)/augeas/lenses - -augeastestdir = $(datadir)/augeas/lenses/tests - # .libs/libvirt.so is built by libtool as a side-effect of the Makefile # rule for libvirt.la. However, checking symbols relies on Linux ELF layout if WITH_LINUX diff --git a/src/meson.build b/src/meson.build index bb970f10c61..3a44cd9d663 100644 --- a/src/meson.build +++ b/src/meson.build @@ -149,6 +149,32 @@ virt_daemons = [] # * install_dir - installation directory (optional, libexecdir) virt_helpers = []
+# virt_conf_files: +# libvirt conf files +virt_conf_files = [] + +# virt_aug_files: +# libvirt aug files +virt_aug_files = [] + +# virt_test_aug_files: +# generate libvirt augeas test files +# * name - augeas test file name (required) +# * aug - augeas test file source (required) +# * conf - conf file (required) +virt_test_aug_files = [] + +# virt_daemon_confs: +# generation libvirt daemon conf files +# each entry is a dictionary with following items: +# * name - daemon name (required) +# * name_uc - daemon name with first letter uppercase (required)
I've seen that you called some magic inline python to calculate stuff somewhere else. Can't we do it here too?
+# * with_ip - only for libvirtd and virtproxyd (optional, default false) +virt_daemon_confs = [] + +virt_aug_dir = datadir / 'augeas' / 'lenses' +virt_test_aug_dir = datadir / 'augeas' / 'lenses' / 'tests' +
# list subdirectories
@@ -547,3 +573,80 @@ foreach helper : virt_helpers install_rpath: libdir, ) endforeach + + +# Generate daemon config, augeas and augeas test files + +install_data(virt_conf_files, install_dir: confdir) +install_data(virt_aug_files, install_dir: virt_aug_dir) + +foreach data : virt_test_aug_files + custom_target( + data['name'], + input: [ data['conf'], data['aug'] ], + output: data['name'], + command: [ meson_python_prog, augeas_gentest_prog, '@INPUT@' ], + capture: true, + install: true,
Why do we install test files?
+ install_dir: virt_test_aug_dir, + ) +endforeach +
[...]
diff --git a/src/remote/meson.build b/src/remote/meson.build index ee38364868e..6635bcd4cff 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -63,6 +63,32 @@ foreach name : [ 'remote', 'qemu', 'lxc' ] ) endforeach
+libvirt_conf_files = [ + [ 'libvirtd.conf.in', 'libvirtd.conf.tmp', 'virtd.conf.tmp' ], + [ 'libvirtd.aug.in', 'libvirtd.aug.tmp', 'virtd.aug.tmp' ], + [ 'test_libvirtd.aug.in', 'test_libvirtd.aug.tmp', 'test_virtd.aug.tmp' ], +] + +foreach name : libvirt_conf_files + tmp = configure_file( + input: name[0], + output: name[1],
Please at least document the fields in the above list, but preferably use a dict.
+ command: [ 'sed', '-e', '/[@]CUT_ENABLE_IP[@]/d', '-e', '/[@]END[@]/d', '@INPUT@' ], + capture: true, + ) + set_variable(name[1].underscorify(), tmp) +endforeach