]> git.ipfire.org Git - thirdparty/systemd.git/blame - shell-completion/bash/meson.build
Merge pull request #8025 from sourcejedi/pid1_journal_or2
[thirdparty/systemd.git] / shell-completion / bash / meson.build
CommitLineData
3a726fcd
ZJS
1# SPDX-License-Identifier: LGPL-2.1+
2#
3# Copyright 2017 Zbigniew Jędrzejewski-Szmek
4#
5# systemd is free software; you can redistribute it and/or modify it
6# under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; either version 2.1 of the License, or
8# (at your option) any later version.
9#
10# systemd is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with systemd; If not, see <http://www.gnu.org/licenses/>.
17
5c23128d
ZJS
18bashcompletiondir = get_option('bashcompletiondir')
19if bashcompletiondir == ''
37efbbd8
ZJS
20 bash_completion = dependency('bash-completion', required : false)
21 if bash_completion.found()
22 bashcompletiondir = bash_completion.get_pkgconfig_variable('completionsdir')
23 else
24 bashcompletiondir = join_paths(datadir, 'bash-completion/completions')
25 endif
5c23128d 26
37efbbd8 27 message('bash completions: @0@'.format(bashcompletiondir))
5c23128d
ZJS
28endif
29
30if bashcompletiondir != 'no'
37efbbd8
ZJS
31 bash_systemctl = configure_file(
32 input : 'systemctl.in',
33 output : 'systemctl',
34 configuration : substs)
5c23128d 35
37efbbd8
ZJS
36 items = [['busctl', ''],
37 ['journalctl', ''],
38 ['systemd-analyze', ''],
39 ['systemd-cat', ''],
40 ['systemd-cgls', ''],
41 ['systemd-cgtop', ''],
42 ['systemd-delta', ''],
43 ['systemd-detect-virt', ''],
44 ['systemd-nspawn', ''],
45 ['systemd-path', ''],
46 ['systemd-run', ''],
47 ['udevadm', ''],
48 ['kernel-install', ''],
49 [bash_systemctl, ''],
50 ['bootctl', 'ENABLE_EFI'],
51 ['coredumpctl', 'ENABLE_COREDUMP'],
52 ['hostnamectl', 'ENABLE_HOSTNAMED'],
53 ['localectl', 'ENABLE_LOCALED'],
54 ['loginctl', 'ENABLE_LOGIND'],
55 ['machinectl', 'ENABLE_MACHINED'],
56 ['networkctl', 'ENABLE_NETWORKD'],
1ec57f33 57 ['systemd-resolve', 'ENABLE_RESOLVE'],
37efbbd8
ZJS
58 ['timedatectl', 'ENABLE_TIMEDATED'],
59 ]
5c23128d 60
37efbbd8 61 foreach item : items
349cc4a5 62 if item[1] == '' or conf.get(item[1]) == 1
37efbbd8
ZJS
63 install_data(item[0],
64 install_dir : bashcompletiondir)
65 endif
66 endforeach
5c23128d 67endif