Dhruvaraj Subhashchandran | 888472d | 2024-05-17 12:56:30 -0500 | [diff] [blame] | 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | |
| 3 | systemd_dep = dependency('systemd', required: true) |
| 4 | |
| 5 | systemd_system_unit_dir = systemd_dep.get_variable( |
Patrick Williams | b37d826 | 2025-02-01 08:36:31 -0500 | [diff] [blame] | 6 | pkgconfig: 'systemdsystemunitdir', |
Dhruvaraj Subhashchandran | 888472d | 2024-05-17 12:56:30 -0500 | [diff] [blame] | 7 | ) |
| 8 | dist_conf_data = configuration_data() |
| 9 | dist_conf_data.set('bindir', get_option('prefix') / get_option('bindir')) |
| 10 | |
| 11 | # Service installation |
| 12 | configure_file( |
Patrick Williams | b37d826 | 2025-02-01 08:36:31 -0500 | [diff] [blame] | 13 | 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 Subhashchandran | 888472d | 2024-05-17 12:56:30 -0500 | [diff] [blame] | 18 | ) |
| 19 | |
| 20 | # Symlinks for services |
| 21 | systemd_alias = [ |
Patrick Williams | b37d826 | 2025-02-01 08:36:31 -0500 | [diff] [blame] | 22 | [ |
| 23 | '../openpower-dump-monitor.service', |
| 24 | 'obmc-host-startmin@0.target.wants/openpower-dump-monitor.service', |
| 25 | ], |
Dhruvaraj Subhashchandran | 888472d | 2024-05-17 12:56:30 -0500 | [diff] [blame] | 26 | ] |
| 27 | |
Patrick Williams | b37d826 | 2025-02-01 08:36:31 -0500 | [diff] [blame] | 28 | foreach service : systemd_alias |
Dhruvaraj Subhashchandran | 888472d | 2024-05-17 12:56:30 -0500 | [diff] [blame] | 29 | meson.add_install_script( |
Patrick Williams | b37d826 | 2025-02-01 08:36:31 -0500 | [diff] [blame] | 30 | 'sh', |
| 31 | '-c', |
Dhruvaraj Subhashchandran | 888472d | 2024-05-17 12:56:30 -0500 | [diff] [blame] | 32 | 'mkdir -p $(dirname $DESTDIR/@0@/@1@)'.format( |
Patrick Williams | b37d826 | 2025-02-01 08:36:31 -0500 | [diff] [blame] | 33 | systemd_system_unit_dir, |
| 34 | service[1], |
Dhruvaraj Subhashchandran | 888472d | 2024-05-17 12:56:30 -0500 | [diff] [blame] | 35 | ), |
| 36 | ) |
| 37 | meson.add_install_script( |
Patrick Williams | b37d826 | 2025-02-01 08:36:31 -0500 | [diff] [blame] | 38 | 'sh', |
| 39 | '-c', |
Dhruvaraj Subhashchandran | 888472d | 2024-05-17 12:56:30 -0500 | [diff] [blame] | 40 | 'ln -s @0@ $DESTDIR/@1@/@2@'.format( |
Patrick Williams | b37d826 | 2025-02-01 08:36:31 -0500 | [diff] [blame] | 41 | service[0], |
| 42 | systemd_system_unit_dir, |
| 43 | service[1], |
Dhruvaraj Subhashchandran | 888472d | 2024-05-17 12:56:30 -0500 | [diff] [blame] | 44 | ), |
| 45 | ) |
| 46 | endforeach |