We currently hardcode the systemd sysusersdir, but it is desirable to be
able to choose a different location in some cases. For example, Fedora
flatpak builds change the RPM %_sysusersdir macro, but we can't currently
honour that.
Reported-by: Yaakov Selkowitz <yselkowi(a)redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
libvirt.spec.in | 1 +
meson.build | 5 +++++
meson_options.txt | 1 +
src/qemu/meson.build | 2 +-
4 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 244e5e824c..347a609add 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1328,6 +1328,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y'
%{_specdir}/libvirt.spec)
-Drunstatedir=%{_rundir} \
-Dinitconfdir=%{_sysconfdir}/sysconfig \
-Dunitdir=%{_unitdir} \
+ -Dsysusersdir=%{_sysusersdir} \
%{?arg_qemu} \
%{?arg_openvz} \
%{?arg_lxc} \
diff --git a/meson.build b/meson.build
index 295613fd93..5c7cd7ec2e 100644
--- a/meson.build
+++ b/meson.build
@@ -100,6 +100,11 @@ if unitdir == ''
unitdir = prefix / 'lib' / 'systemd' / 'system'
endif
+sysusersdir = get_option('sysusersdir')
+if sysusersdir == ''
+ sysusersdir = prefix / 'lib' / 'sysusers.d'
+endif
+
bindir = prefix / get_option('bindir')
datadir = prefix / get_option('datadir')
includedir = prefix / get_option('includedir')
diff --git a/meson_options.txt b/meson_options.txt
index a4f1dd769f..50d71427cb 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,6 +5,7 @@ option('system', type: 'boolean', value: false,
description: 'Set install paths
option('runstatedir', type: 'string', value: '', description:
'State directory for temporary sockets, pid files, etc')
option('initconfdir', type: 'string', value: '', description:
'directory for init script configuration files')
option('unitdir', type: 'string', value: '', description:
'directory for systemd unit files')
+option('sysusersdir', type: 'string', value: '', description:
'directory for sysusers files')
# dep:tests
option('expensive_tests', type: 'feature', value: 'auto',
description: 'set the default for enabling expensive tests (long timeouts)')
option('test_coverage', type: 'boolean', value: false, description:
'turn on code coverage instrumentation')
diff --git a/src/qemu/meson.build b/src/qemu/meson.build
index 907893d431..57356451e4 100644
--- a/src/qemu/meson.build
+++ b/src/qemu/meson.build
@@ -163,7 +163,7 @@ if conf.has('WITH_QEMU')
# Install the sysuser config for the qemu driver
install_data(
'libvirt-qemu.sysusers.conf',
- install_dir: prefix / 'lib' / 'sysusers.d',
+ install_dir: sysusersdir,
rename: [ 'libvirt-qemu.conf' ],
)
--
2.43.0