blob: 7ed6046b7c528fd591f93c3dd3e676e5c07ea2a9 [file] [log] [blame]
Patrick Williamsbb939ea2021-12-03 15:41:02 -06001systemd_system_unit_dir = systemd_dep.get_variable(
2 pkgconfig: 'systemdsystemunitdir'
3)
4busconfig_dir = get_option('datadir') / 'dbus-1' / 'system.d'
5cert_manager_dir = get_option('datadir') / 'phosphor-certificate-manager'
6
7certs = []
8busconfig = []
9service_files = [ 'phosphor-certificate-manager@.service' ]
10systemd_alias = []
11
12if not get_option('ca-cert-extension').disabled()
13 busconfig += 'busconfig/bmc-vmi-ca.conf'
14 service_files += 'bmc-vmi-ca-manager.service'
15endif
16
17if 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 ]]
24endif
25
26if 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 ]]
33endif
34
35install_data(
36 service_files,
37 install_dir: systemd_system_unit_dir,
38)
39
40install_data(
41 busconfig,
42 install_dir: busconfig_dir,
43)
44
45install_data(
46 certs,
47 install_dir: cert_manager_dir,
48)
49
50foreach 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 )
67endforeach