mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
meson: src: add support for installing libvirt conf and augeas 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:
parent
cb8b1a2076
commit
da4c7f8687
@ -70,15 +70,10 @@ include storage/Makefile.inc.am
|
|||||||
include remote/Makefile.inc.am
|
include remote/Makefile.inc.am
|
||||||
|
|
||||||
|
|
||||||
confdir = $(sysconfdir)/libvirt
|
|
||||||
conf_DATA += libvirt.conf
|
conf_DATA += libvirt.conf
|
||||||
|
|
||||||
BUILT_SOURCES += $(nodist_conf_DATA)
|
BUILT_SOURCES += $(nodist_conf_DATA)
|
||||||
|
|
||||||
augeasdir = $(datadir)/augeas/lenses
|
|
||||||
|
|
||||||
augeastestdir = $(datadir)/augeas/lenses/tests
|
|
||||||
|
|
||||||
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
|
# .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
|
# rule for libvirt.la. However, checking symbols relies on Linux ELF layout
|
||||||
if WITH_LINUX
|
if WITH_LINUX
|
||||||
|
110
src/meson.build
110
src/meson.build
@ -158,6 +158,31 @@ virt_daemons = []
|
|||||||
# * install_dir - installation directory (optional, libexecdir)
|
# * install_dir - installation directory (optional, libexecdir)
|
||||||
virt_helpers = []
|
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)
|
||||||
|
# * 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
|
# list subdirectories
|
||||||
|
|
||||||
@ -566,3 +591,88 @@ foreach helper : virt_helpers
|
|||||||
install_rpath: libdir,
|
install_rpath: libdir,
|
||||||
)
|
)
|
||||||
endforeach
|
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, python3_prog.path(), augeas_gentest_prog.path(),
|
||||||
|
'@INPUT@',
|
||||||
|
],
|
||||||
|
capture: true,
|
||||||
|
install: true,
|
||||||
|
install_dir: virt_test_aug_dir,
|
||||||
|
)
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
foreach data : virt_daemon_confs
|
||||||
|
capitalize_args = [ '-c', 'print("@0@".capitalize())'.format(data['name']) ]
|
||||||
|
name_uc = run_command(python3_prog, capitalize_args, check: true).stdout().strip()
|
||||||
|
daemon_conf = configuration_data()
|
||||||
|
daemon_conf.set('runstatedir', runstatedir)
|
||||||
|
daemon_conf.set('sbindir', sbindir)
|
||||||
|
daemon_conf.set('sysconfdir', sysconfdir)
|
||||||
|
daemon_conf.set('DAEMON_NAME', data['name'])
|
||||||
|
daemon_conf.set('DAEMON_NAME_UC', name_uc)
|
||||||
|
# to silence meson warning about missing 'CONFIG' in the configuration_data
|
||||||
|
daemon_conf.set('CONFIG', '@CONFIG@')
|
||||||
|
|
||||||
|
if data.get('with_ip', false)
|
||||||
|
conf_in = libvirtd_conf_tmp
|
||||||
|
else
|
||||||
|
conf_in = virtd_conf_tmp
|
||||||
|
endif
|
||||||
|
conf_out = configure_file(
|
||||||
|
input: conf_in,
|
||||||
|
output: '@0@.conf'.format(data['name']),
|
||||||
|
configuration: daemon_conf,
|
||||||
|
install: true,
|
||||||
|
install_dir: confdir,
|
||||||
|
)
|
||||||
|
|
||||||
|
if data.get('with_ip', false)
|
||||||
|
aug_in = libvirtd_aug_tmp
|
||||||
|
else
|
||||||
|
aug_in = virtd_aug_tmp
|
||||||
|
endif
|
||||||
|
configure_file(
|
||||||
|
input: aug_in,
|
||||||
|
output: '@0@.aug'.format(data['name']),
|
||||||
|
configuration: daemon_conf,
|
||||||
|
install: true,
|
||||||
|
install_dir: virt_aug_dir,
|
||||||
|
)
|
||||||
|
|
||||||
|
if data.get('with_ip', false)
|
||||||
|
test_aug_in = test_libvirtd_aug_tmp
|
||||||
|
else
|
||||||
|
test_aug_in = test_virtd_aug_tmp
|
||||||
|
endif
|
||||||
|
test_aug_tmp = configure_file(
|
||||||
|
input: test_aug_in,
|
||||||
|
output: 'test_@0@.aug.tmp'.format(data['name']),
|
||||||
|
configuration: daemon_conf,
|
||||||
|
)
|
||||||
|
|
||||||
|
test_aug_out = 'test_@0@.aug'.format(data['name'])
|
||||||
|
custom_target(
|
||||||
|
test_aug_out,
|
||||||
|
input: [ conf_out, test_aug_tmp ],
|
||||||
|
output: test_aug_out,
|
||||||
|
command: [
|
||||||
|
meson_python_prog, python3_prog.path(), augeas_gentest_prog.path(),
|
||||||
|
'@INPUT@',
|
||||||
|
],
|
||||||
|
capture: true,
|
||||||
|
install: true,
|
||||||
|
install_dir: virt_test_aug_dir,
|
||||||
|
)
|
||||||
|
endforeach
|
||||||
|
@ -63,6 +63,51 @@ foreach name : [ 'remote', 'qemu', 'lxc' ]
|
|||||||
)
|
)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
# libvirt_conf_files:
|
||||||
|
# Generate libvirtd and virtd template files that are used to generate
|
||||||
|
# daemon configuration files.
|
||||||
|
# Each entry is a dictionary with following items:
|
||||||
|
# * input: source config file (required)
|
||||||
|
# * libvirtd: libvirtd config output template file (required)
|
||||||
|
# * virtd: virtd config output template file (required)
|
||||||
|
libvirt_conf_files = [
|
||||||
|
{
|
||||||
|
'input':'libvirtd.conf.in',
|
||||||
|
'libvirtd':'libvirtd.conf.tmp',
|
||||||
|
'virtd':'virtd.conf.tmp',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'input':'libvirtd.aug.in',
|
||||||
|
'libvirtd':'libvirtd.aug.tmp',
|
||||||
|
'virtd':'virtd.aug.tmp',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'input':'test_libvirtd.aug.in',
|
||||||
|
'libvirtd':'test_libvirtd.aug.tmp',
|
||||||
|
'virtd':'test_virtd.aug.tmp',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
foreach name : libvirt_conf_files
|
||||||
|
tmp = configure_file(
|
||||||
|
input: name['input'],
|
||||||
|
output: name['libvirtd'],
|
||||||
|
command: [ 'sed', '-e', '/[@]CUT_ENABLE_IP[@]/d', '-e', '/[@]END[@]/d', '@INPUT@' ],
|
||||||
|
capture: true,
|
||||||
|
)
|
||||||
|
set_variable(name['libvirtd'].underscorify(), tmp)
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
foreach name : libvirt_conf_files
|
||||||
|
tmp = configure_file(
|
||||||
|
input: name['input'],
|
||||||
|
output: name['virtd'],
|
||||||
|
command: [ 'sed', '-e', '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d', '@INPUT@' ],
|
||||||
|
capture: true,
|
||||||
|
)
|
||||||
|
set_variable(name['virtd'].underscorify(), tmp)
|
||||||
|
endforeach
|
||||||
|
|
||||||
if conf.has('WITH_REMOTE')
|
if conf.has('WITH_REMOTE')
|
||||||
remote_driver_lib = static_library(
|
remote_driver_lib = static_library(
|
||||||
'virt_remote_driver',
|
'virt_remote_driver',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user