Patrick Williams | bb939ea | 2021-12-03 15:41:02 -0600 | [diff] [blame] | 1 | systemd_system_unit_dir = systemd_dep.get_variable( |
| 2 | pkgconfig: 'systemdsystemunitdir' |
| 3 | ) |
| 4 | busconfig_dir = get_option('datadir') / 'dbus-1' / 'system.d' |
| 5 | cert_manager_dir = get_option('datadir') / 'phosphor-certificate-manager' |
| 6 | |
| 7 | certs = [] |
| 8 | busconfig = [] |
| 9 | service_files = [ 'phosphor-certificate-manager@.service' ] |
| 10 | systemd_alias = [] |
| 11 | |
| 12 | if not get_option('ca-cert-extension').disabled() |
| 13 | busconfig += 'busconfig/bmc-vmi-ca.conf' |
| 14 | service_files += 'bmc-vmi-ca-manager.service' |
| 15 | endif |
| 16 | |
| 17 | if not get_option('config-bmcweb').disabled() |
| 18 | busconfig += 'busconfig/phosphor-bmcweb-cert-config.conf' |
| 19 | certs += 'env/bmcweb' |
| 20 | systemd_alias += [[ |
| 21 | '../phosphor-certificate-manager@.service', |
| 22 | 'multi-user.target.wants/phosphor-certificate-manager@bmcweb.service' |
| 23 | ]] |
| 24 | endif |
| 25 | |
| 26 | if not get_option('config-nslcd').disabled() |
| 27 | busconfig += 'busconfig/phosphor-nslcd-authority-cert-config.conf' |
| 28 | certs += 'env/authority' |
| 29 | systemd_alias += [[ |
| 30 | '../phosphor-certificate-manager@.service', |
| 31 | 'multi-user.target.wants/phosphor-certificate-manager@authority.service' |
| 32 | ]] |
| 33 | endif |
| 34 | |
| 35 | install_data( |
| 36 | service_files, |
| 37 | install_dir: systemd_system_unit_dir, |
| 38 | ) |
| 39 | |
| 40 | install_data( |
| 41 | busconfig, |
| 42 | install_dir: busconfig_dir, |
| 43 | ) |
| 44 | |
| 45 | install_data( |
| 46 | certs, |
| 47 | install_dir: cert_manager_dir, |
| 48 | ) |
| 49 | |
| 50 | foreach service: systemd_alias |
| 51 | # Meson 0.61 will support this: |
| 52 | #install_symlink( |
| 53 | # service, |
| 54 | # install_dir: systemd_system_unit_dir, |
| 55 | # pointing_to: link, |
| 56 | # ) |
| 57 | meson.add_install_script( |
| 58 | 'sh', '-c', |
| 59 | 'mkdir -p $(dirname $DESTDIR/@0@/@1@)'.format(systemd_system_unit_dir, |
| 60 | service[1]), |
| 61 | ) |
| 62 | meson.add_install_script( |
| 63 | 'sh', '-c', |
| 64 | 'ln -s @0@ $DESTDIR/@1@/@2@'.format(service[0], systemd_system_unit_dir, |
| 65 | service[1]), |
| 66 | ) |
| 67 | endforeach |