]> xenbits.xensource.com Git - libvirt.git/commitdiff
meson: allow systemd sysusersdir to be changed
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 6 Jun 2024 11:57:08 +0000 (12:57 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 13 Jun 2024 09:23:11 +0000 (10:23 +0100)
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.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reported-by: Yaakov Selkowitz <yselkowi@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
libvirt.spec.in
meson.build
meson_options.txt
src/qemu/meson.build

index 9bff6ef6dbd217e2cfca73d7a216244b260bcf7b..29101e74fee32fd1c02f1fecae8767c3ddb8ed67 100644 (file)
@@ -1326,6 +1326,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} \
index 295613fd938d551a36ae7d7885124e4eba45bd7e..2fc9ab3e96163c88779f35ddbebde0ec0e6a98dc 100644 (file)
@@ -100,6 +100,11 @@ if unitdir == ''
   unitdir = prefix / 'lib' / 'systemd' / 'system'
 endif
 
+sysusersdir = getoption('sysusersdir')
+if sysusersdir == ''
+  sysusersdir = prefix / 'lib' / 'sysusers.d'
+endif
+
 bindir = prefix / get_option('bindir')
 datadir = prefix / get_option('datadir')
 includedir = prefix / get_option('includedir')
index a4f1dd769f675079b50f17869721c5a63e3f913f..50d71427cba95f8d123b49deb52dbf27b2ad81dc 100644 (file)
@@ -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')
index 907893d431408885b699419ecf3a3fa5a357d064..57356451e42de6ca9a347f389985af48b800a848 100644 (file)
@@ -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' ],
   )