]>
Commit | Line | Data |
---|---|---|
3a726fcd ZJS |
1 | # SPDX-License-Identifier: LGPL-2.1+ |
2 | # | |
3 | # Copyright 2017 Zbigniew Jędrzejewski-Szmek | |
3a726fcd | 4 | |
5c23128d ZJS |
5 | bashcompletiondir = get_option('bashcompletiondir') |
6 | if bashcompletiondir == '' | |
37efbbd8 ZJS |
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 | |
5c23128d | 13 | |
37efbbd8 | 14 | message('bash completions: @0@'.format(bashcompletiondir)) |
5c23128d ZJS |
15 | endif |
16 | ||
17 | if bashcompletiondir != 'no' | |
37efbbd8 ZJS |
18 | bash_systemctl = configure_file( |
19 | input : 'systemctl.in', | |
20 | output : 'systemctl', | |
21 | configuration : substs) | |
5c23128d | 22 | |
37efbbd8 ZJS |
23 | items = [['busctl', ''], |
24 | ['journalctl', ''], | |
25 | ['systemd-analyze', ''], | |
26 | ['systemd-cat', ''], | |
27 | ['systemd-cgls', ''], | |
28 | ['systemd-cgtop', ''], | |
29 | ['systemd-delta', ''], | |
30 | ['systemd-detect-virt', ''], | |
31 | ['systemd-nspawn', ''], | |
32 | ['systemd-path', ''], | |
33 | ['systemd-run', ''], | |
34 | ['udevadm', ''], | |
35 | ['kernel-install', ''], | |
36 | [bash_systemctl, ''], | |
37 | ['bootctl', 'ENABLE_EFI'], | |
38 | ['coredumpctl', 'ENABLE_COREDUMP'], | |
39 | ['hostnamectl', 'ENABLE_HOSTNAMED'], | |
40 | ['localectl', 'ENABLE_LOCALED'], | |
41 | ['loginctl', 'ENABLE_LOGIND'], | |
42 | ['machinectl', 'ENABLE_MACHINED'], | |
43 | ['networkctl', 'ENABLE_NETWORKD'], | |
1ec57f33 | 44 | ['systemd-resolve', 'ENABLE_RESOLVE'], |
bd188ff0 | 45 | ['resolvectl', 'ENABLE_RESOLVE'], |
37efbbd8 ZJS |
46 | ['timedatectl', 'ENABLE_TIMEDATED'], |
47 | ] | |
5c23128d | 48 | |
37efbbd8 | 49 | foreach item : items |
349cc4a5 | 50 | if item[1] == '' or conf.get(item[1]) == 1 |
37efbbd8 ZJS |
51 | install_data(item[0], |
52 | install_dir : bashcompletiondir) | |
53 | endif | |
54 | endforeach | |
5c23128d | 55 | endif |