1# SPDX-License-Identifier: LGPL-2.1-or-later
2
3zshcompletiondir = get_option('zshcompletiondir')
4if zshcompletiondir == ''
5        zshcompletiondir = datadir / 'zsh/site-functions'
6endif
7
8custom_target(
9        '_systemctl',
10        input : '_systemctl.in',
11        output : '_systemctl',
12        command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
13        install : zshcompletiondir != 'no',
14        install_dir : zshcompletiondir)
15
16items = [['_busctl',                   ''],
17         ['_journalctl',               ''],
18         ['_systemd-analyze',          ''],
19         ['_systemd-delta',            ''],
20         ['_systemd-nspawn',           ''],
21         ['_systemd',                  ''],
22         ['_systemd-path',             ''],
23         ['_systemd-run',              ''],
24         ['_udevadm',                  ''],
25         ['_kernel-install',           'ENABLE_KERNEL_INSTALL'],
26         ['_sd_hosts_or_user_at_host', ''],
27         ['_sd_outputmodes',           ''],
28         ['_sd_unit_files',            ''],
29         ['_sd_machines',              ''],
30         ['_bootctl',                  'HAVE_GNU_EFI'],
31         ['_coredumpctl',              'ENABLE_COREDUMP'],
32         ['_hostnamectl',              'ENABLE_HOSTNAMED'],
33         ['_localectl',                'ENABLE_LOCALED'],
34         ['_loginctl',                 'ENABLE_LOGIND'],
35         ['_machinectl',               'ENABLE_MACHINED'],
36         ['_networkctl',               'ENABLE_NETWORKD'],
37         ['_oomctl',                   'ENABLE_OOMD'],
38         ['_systemd-inhibit',          'ENABLE_LOGIND'],
39         ['_resolvectl',               'ENABLE_RESOLVE'],
40         ['_systemd-tmpfiles',         'ENABLE_TMPFILES'],
41         ['_timedatectl',              'ENABLE_TIMEDATED']]
42
43foreach item : items
44        if zshcompletiondir != 'no' and (item[1] == '' or conf.get(item[1]) == 1)
45                install_data(item[0],
46                             install_dir : zshcompletiondir)
47        endif
48endforeach
49