From b851d9dad2998f64378285ba994b5714fcf0f3d0 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Wed, 6 Mar 2019 12:31:36 -0500 Subject: [PATCH] build: Hook up bash completions Follow-up to #1499. This is mostly based on https://github.com/ostreedev/ostree/pull/1077. Closes: #1772 Approved by: rfairley --- Makefile-bash.am | 19 +++++++++++++++++++ Makefile.am | 1 + configure.ac | 12 ++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 Makefile-bash.am diff --git a/Makefile-bash.am b/Makefile-bash.am new file mode 100644 index 00000000..2dcdca53 --- /dev/null +++ b/Makefile-bash.am @@ -0,0 +1,19 @@ +# Copyright (C) 2019 Red Hat Inc. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +completionsdir = @BASH_COMPLETIONSDIR@ +dist_completions_DATA = completion/rpm-ostree diff --git a/Makefile.am b/Makefile.am index c15bd617..531e5d4a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -104,5 +104,6 @@ include Makefile-daemon.am include Makefile-rpm-ostree.am include Makefile-tests.am include Makefile-man.am +include Makefile-bash.am -include $(top_srcdir)/git.mk diff --git a/configure.ac b/configure.ac index 20d9351a..ef43fb7f 100644 --- a/configure.ac +++ b/configure.ac @@ -214,6 +214,18 @@ AS_IF([test x$enable_compose_tooling = xyes], [ ]) if test x$enable_compose_tooling != xno; then RPM_OSTREE_FEATURES="$RPM_OSTREE_FEATURES compose"; fi +dnl PKG_CHECK_VAR added to pkg-config 0.28 (though it's already in the new pkgconf; this +dnl backport is more for el7) +m4_define_default( + [PKG_CHECK_VAR], + [AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config]) + AS_IF([test -z "$$1"], [$1=`$PKG_CONFIG --variable="$3" "$2"`]) + AS_IF([test -n "$$1"], [$4], [$5])]) + +PKG_CHECK_VAR(BASH_COMPLETIONSDIR, [bash-completion], [completionsdir],, + BASH_COMPLETIONSDIR="${sysconfdir}/bash_completion.d") +AC_SUBST(BASH_COMPLETIONSDIR) + AC_PATH_PROG([cargo], [cargo]) AS_IF([test -z "$cargo"], [AC_MSG_ERROR([cargo is required for --enable-rust])]) AC_PATH_PROG([rustc], [rustc])