From 23f4c8a01a8d6b7fd3cb3e4aed88ed9a4ed03e03 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Sat, 12 Nov 2016 14:44:40 +0100 Subject: [PATCH] install bash completion where pkg-config tells us to Signed-off-by: Evgeni Golov --- config/bash/Makefile.am | 11 +---------- configure.ac | 8 ++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/config/bash/Makefile.am b/config/bash/Makefile.am index b1768c9e1..b97e2a499 100644 --- a/config/bash/Makefile.am +++ b/config/bash/Makefile.am @@ -1,14 +1,5 @@ EXTRA_DIST = lxc if ENABLE_BASH -install-bash: - $(MKDIR_P) $(DESTDIR)$(sysconfdir)/bash_completion.d/ - $(INSTALL_DATA) lxc $(DESTDIR)$(sysconfdir)/bash_completion.d/ - -uninstall-bash: - rm -f $(DESTDIR)$(sysconfdir)/bash_completion.d/lxc - rmdir $(DESTDIR)$(sysconfdir)/bash_completion.d/ || : - -install-data-local: install-bash -uninstall-local: uninstall-bash +dist_bashcomp_DATA = lxc endif diff --git a/configure.ac b/configure.ac index dcb33ee64..cd424c450 100644 --- a/configure.ac +++ b/configure.ac @@ -479,6 +479,14 @@ AC_ARG_ENABLE([bash], [], [enable_bash=yes]) AM_CONDITIONAL([ENABLE_BASH], [test "x$enable_bash" = "xyes"]) +AM_COND_IF([ENABLE_BASH], + [AC_MSG_CHECKING([bash completion directory]) + PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], , + bashcompdir="${sysconfdir}/bash_completion.d") + AC_MSG_RESULT([$bashcompdir]) + AC_SUBST(bashcompdir) + ]) + # Optional test binaries AC_ARG_ENABLE([tests], [AC_HELP_STRING([--enable-tests], [build test/example binaries [default=no]])],