Skip to content
Snippets Groups Projects
Commit a7eb7de5 authored by Daniel P. Berrangé's avatar Daniel P. Berrangé :speech_balloon:
Browse files

meson: allow systemd unitdir to be changed


We currently hardcode the systemd unitdir, but it is desirable to be
able to choose a different location in some cases. For examples, Fedora
flatpak builds change the RPM %_unitdir macro, but we can't currently
honour that.

Reviewed-by: default avatarMichal Privoznik <mprivozn@redhat.com>
Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
parent 6569ded5
Branches
Tags
No related merge requests found
......@@ -1327,6 +1327,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
%meson \
-Drunstatedir=%{_rundir} \
-Dinitconfdir=%{_sysconfdir}/sysconfig \
-Dunitdir=%{_unitdir} \
%{?arg_qemu} \
%{?arg_openvz} \
%{?arg_lxc} \
......
......@@ -95,6 +95,11 @@ if initconfdir == ''
endif
endif
unitdir = get_option('unitdir')
if unitdir == ''
unitdir = prefix / 'lib' / 'systemd' / 'system'
endif
bindir = prefix / get_option('bindir')
datadir = prefix / get_option('datadir')
includedir = prefix / get_option('includedir')
......
......@@ -4,6 +4,7 @@ option('packager_version', type: 'string', value: '', description: 'Extra packag
option('system', type: 'boolean', value: false, description: 'Set install paths to system ones')
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')
# 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')
......
......@@ -812,11 +812,9 @@ endforeach
if conf.has('WITH_LIBVIRTD')
# Generate systemd service and socket unit files
if init_script == 'systemd'
systemd_unit_dir = prefix / 'lib' / 'systemd' / 'system'
install_data(
guest_unit_files,
install_dir: systemd_unit_dir,
install_dir: unitdir,
)
if conf.has('WITH_POLKIT')
......@@ -855,7 +853,7 @@ if conf.has('WITH_LIBVIRTD')
output: service_out,
configuration: unit_conf,
install: true,
install_dir: systemd_unit_dir,
install_dir: unitdir,
)
foreach socket : unit.get('sockets', [ 'main', 'ro', 'admin' ])
......@@ -881,7 +879,7 @@ if conf.has('WITH_LIBVIRTD')
output: socket_out,
configuration: unit_conf,
install: true,
install_dir: systemd_unit_dir,
install_dir: unitdir,
)
endforeach
endforeach
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment