]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: tools: install bash-completion files
authorPavel Hrdina <phrdina@redhat.com>
Wed, 17 Jun 2020 23:53:04 +0000 (01:53 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:05 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
tools/Makefile.am
tools/bash-completion/meson.build [new file with mode: 0644]
tools/meson.build

index ba3b0bbc12012ed4a49bfb32330ccabc05689f03..9c91cac9ccf21e7b5ea1655c8d75ff219d356539 100644 (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
 
diff --git a/tools/bash-completion/meson.build b/tools/bash-completion/meson.build
new file mode 100644 (file)
index 0000000..8924c93
--- /dev/null
@@ -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',
+)
index 12594a8a76f4cf57028d7f9732889f9ae39d8317..765532f3b1c4bcb1d22561c5e0ec8f7ea74506a5 100644 (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