]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
install bash completion where pkg-config tells us to 1295/head
authorEvgeni Golov <evgeni@debian.org>
Sat, 12 Nov 2016 13:44:40 +0000 (14:44 +0100)
committerEvgeni Golov <evgeni@debian.org>
Sat, 12 Nov 2016 13:57:34 +0000 (14:57 +0100)
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 dcb33ee6414188c48e538767168eb482284b4697..cd424c450590d927b970e9663edcf6a2353241f3 100644 (file)
@@ -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]])],