mirror_lxc/config/init/systemd/meson.build
Aleksa Sarai 1d5c7e771c
build: drop build-time systemd dependency
On openSUSE, our packages are build in the Open Build Service which does
not have a proper systemd installation that you can query to get the
systemdunitdir.

The simplest solution is to re-add the ability to explicitly set the
systemdunitdir (as was previously possible with the autotools build
system in pre-5.0 LXC).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2022-10-28 14:34:28 +11:00

45 lines
1.2 KiB
Meson

# SPDX-License-Identifier: LGPL-2.1-or-later
lxc_apparmor_load = configure_file(
configuration: dummy_config_data,
input: 'lxc-apparmor-load',
output: 'lxc-apparmor-load',
install: true,
install_dir: lxclibexec)
if 'systemd' in init_script
systemd_system_unit_dir = get_option('systemd-unitdir')
if systemd_system_unit_dir == ''
systemd = dependency('systemd')
systemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir')
endif
configure_file(
configuration: conf,
input: 'lxc-monitord.service.in',
output: 'lxc-monitord.service',
install: true,
install_dir: systemd_system_unit_dir)
configure_file(
configuration: conf,
input: 'lxc-net.service.in',
output: 'lxc-net.service',
install: true,
install_dir: systemd_system_unit_dir)
configure_file(
configuration: conf,
input: 'lxc.service.in',
output: 'lxc.service',
install: true,
install_dir: systemd_system_unit_dir)
configure_file(
configuration: conf,
input: 'lxc@.service.in',
output: 'lxc@.service',
install: true,
install_dir: systemd_system_unit_dir)
endif