chiark / gitweb /
10340eeb5bed18703da02eb29424e0eb7d8a890f
[elogind.git] / shell-completion / bash / meson.build
1 # SPDX-License-Identifier: LGPL-2.1+
2 #
3 # Copyright © 2017 Zbigniew Jędrzejewski-Szmek
4
5 bashcompletiondir = get_option('bashcompletiondir')
6 if bashcompletiondir == ''
7         bash_completion = dependency('bash-completion', required : false)
8         if bash_completion.found()
9                 bashcompletiondir = bash_completion.get_pkgconfig_variable('completionsdir')
10         else
11                 bashcompletiondir = join_paths(datadir, 'bash-completion/completions')
12         endif
13
14         message('bash completions: @0@'.format(bashcompletiondir))
15 endif
16
17 if bashcompletiondir != 'no'
18 #if 0 /// elogind has a *very* short list for this...
19 #         bash_systemctl = configure_file(
20 #                 input : 'systemctl.in',
21 #                 output : 'systemctl',
22 #                 configuration : substs)
23
24 #         items = [['busctl',              ''],
25 #                  ['journalctl',          ''],
26 #                  ['systemd-analyze',     ''],
27 #                  ['systemd-cat',         ''],
28 #                  ['systemd-cgls',        ''],
29 #                  ['systemd-cgtop',       ''],
30 #                  ['systemd-delta',       ''],
31 #                  ['systemd-detect-virt', ''],
32 #                  ['systemd-nspawn',      ''],
33 #                  ['systemd-path',        ''],
34 #                  ['systemd-run',         ''],
35 #                  ['udevadm',             ''],
36 #                  ['kernel-install',      ''],
37 #                  [bash_systemctl,        ''],
38 #                  ['bootctl',             'ENABLE_EFI'],
39 #                  ['coredumpctl',         'ENABLE_COREDUMP'],
40 #                  ['hostnamectl',         'ENABLE_HOSTNAMED'],
41 #                  ['localectl',           'ENABLE_LOCALED'],
42 #                  ['loginctl',            'ENABLE_LOGIND'],
43 #                  ['machinectl',          'ENABLE_MACHINED'],
44 #                  ['networkctl',          'ENABLE_NETWORKD'],
45 #                  ['portablectl',         'ENABLE_PORTABLED'],
46 #                  ['resolvectl',          'ENABLE_RESOLVE'],
47 #                  ['systemd-resolve',     'ENABLE_RESOLVE'],
48 #                  ['timedatectl',         'ENABLE_TIMEDATED'],
49 #else
50         items = [['loginctl',            ''],
51 #endif // 0
52                 ]
53
54         foreach item : items
55                 if item[1] == '' or conf.get(item[1]) == 1
56                         install_data(item[0],
57                                      install_dir : bashcompletiondir)
58                 endif
59         endforeach
60 endif