]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
install bash completion where pkg-config tells us to
authorEvgeni Golov <evgeni@debian.org>
Sat, 12 Nov 2016 13:44:40 +0000 (14:44 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 18 Nov 2016 01:43:14 +0000 (20:43 -0500)
Signed-off-by: Evgeni Golov <evgeni@debian.org>
config/bash/Makefile.am
configure.ac

index b1768c9e157724dc10a6274c0bdb111e46ad0fe2..b97e2a4991b9aa38cba81f1ca5489e1975078559 100644 (file)
@@ -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
index 44a6286d283beb14adc429cb12d98ce06c360ebd..29105fb4a9db9e64d98f9f93efca452ec0dd91c2 100644 (file)
@@ -413,6 +413,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]])],