blob: 7081dd9ae84b0cc07d7f45ebf4d42359d5f4ad3b [file] [log] [blame]
Dhruvaraj Subhashchandran888472d2024-05-17 12:56:30 -05001# SPDX-License-Identifier: Apache-2.0
2
3systemd_dep = dependency('systemd', required: true)
4
5systemd_system_unit_dir = systemd_dep.get_variable(
Patrick Williamsb37d8262025-02-01 08:36:31 -05006 pkgconfig: 'systemdsystemunitdir',
Dhruvaraj Subhashchandran888472d2024-05-17 12:56:30 -05007)
8dist_conf_data = configuration_data()
9dist_conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
10
11# Service installation
12configure_file(
Patrick Williamsb37d8262025-02-01 08:36:31 -050013 input: 'openpower-dump-monitor.service',
14 output: 'openpower-dump-monitor.service',
15 configuration: dist_conf_data,
16 install: true,
17 install_dir: systemd_system_unit_dir,
Dhruvaraj Subhashchandran888472d2024-05-17 12:56:30 -050018)
19
20# Symlinks for services
21systemd_alias = [
Patrick Williamsb37d8262025-02-01 08:36:31 -050022 [
23 '../openpower-dump-monitor.service',
24 'obmc-host-startmin@0.target.wants/openpower-dump-monitor.service',
25 ],
Dhruvaraj Subhashchandran888472d2024-05-17 12:56:30 -050026]
27
Patrick Williamsb37d8262025-02-01 08:36:31 -050028foreach service : systemd_alias
Dhruvaraj Subhashchandran888472d2024-05-17 12:56:30 -050029 meson.add_install_script(
Patrick Williamsb37d8262025-02-01 08:36:31 -050030 'sh',
31 '-c',
Dhruvaraj Subhashchandran888472d2024-05-17 12:56:30 -050032 'mkdir -p $(dirname $DESTDIR/@0@/@1@)'.format(
Patrick Williamsb37d8262025-02-01 08:36:31 -050033 systemd_system_unit_dir,
34 service[1],
Dhruvaraj Subhashchandran888472d2024-05-17 12:56:30 -050035 ),
36 )
37 meson.add_install_script(
Patrick Williamsb37d8262025-02-01 08:36:31 -050038 'sh',
39 '-c',
Dhruvaraj Subhashchandran888472d2024-05-17 12:56:30 -050040 'ln -s @0@ $DESTDIR/@1@/@2@'.format(
Patrick Williamsb37d8262025-02-01 08:36:31 -050041 service[0],
42 systemd_system_unit_dir,
43 service[1],
Dhruvaraj Subhashchandran888472d2024-05-17 12:56:30 -050044 ),
45 )
46endforeach