meson: tools: install bash-completion files

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-06-18 01:53:04 +02:00
parent 5c65e0d9ca
commit 37423c6892
3 changed files with 17 additions and 25 deletions

View File

@ -23,32 +23,9 @@ STANDALONE_CPPFLAGS = -I$(top_srcdir)
noinst_LTLIBRARIES =
install-data-local: install-nss \
install-bash-completion
uninstall-local: uninstall-nss \
uninstall-bash-completion
if WITH_BASH_COMPLETION
install-bash-completion:
$(MKDIR_P) "$(DESTDIR)$(BASH_COMPLETIONS_DIR)"
$(INSTALL_DATA) $(srcdir)/bash-completion/vsh \
"$(DESTDIR)$(BASH_COMPLETIONS_DIR)/vsh"
( cd $(DESTDIR)$(BASH_COMPLETIONS_DIR) && \
rm -f virsh virt-admin && \
$(LN_S) vsh virsh && \
$(LN_S) vsh virt-admin )
uninstall-bash-completion:
rm -f $(DESTDIR)$(BASH_COMPLETIONS_DIR)/vsh \
$(DESTDIR)$(BASH_COMPLETIONS_DIR)/virsh \
$(DESTDIR)$(BASH_COMPLETIONS_DIR)/virt-admin
rmdir $(DESTDIR)$(BASH_COMPLETIONS_DIR) ||:
else ! WITH_BASH_COMPLETION
install-bash-completion:
uninstall-bash-completion:
endif ! WITH_BASH_COMPLETION
install-data-local: install-nss
uninstall-local: uninstall-nss
if WITH_WIRESHARK_DISSECTOR

View File

@ -0,0 +1,11 @@
install_data('vsh', install_dir: bash_completion_dir)
meson.add_install_script(
meson_python_prog.path(), python3_prog.path(), meson_install_symlink_prog.path(),
bash_completion_dir, 'vsh', 'virsh',
)
meson.add_install_script(
meson_python_prog.path(), python3_prog.path(), meson_install_symlink_prog.path(),
bash_completion_dir, 'vsh', 'virt-admin',
)

View File

@ -286,3 +286,7 @@ if init_script == 'systemd'
install_dir: prefix / 'lib' / 'systemd' / 'system',
)
endif
if bash_completion_dep.found()
subdir('bash-completion')
endif