diff options
author | Martyn Russell <martyn@lanedo.com> | 2015-07-31 17:49:37 +0100 |
---|---|---|
committer | Martyn Russell <martyn@lanedo.com> | 2015-07-31 17:51:12 +0100 |
commit | 4f1ded48e8c9eb66db16c47ad02c1ffa56acc742 (patch) | |
tree | eab008f491483202d963ea403ef8124da6510b7d | |
parent | 8a85eab6f2222991b7e41ea9730d6badd364efe7 (diff) | |
download | tracker-4f1ded48e8c9eb66db16c47ad02c1ffa56acc742.tar.gz |
build: Fix bash completion dir problem with make install, distcheck
- Support JHBuild too
- Allow disabling altogether
- Fix DISTCHECK flags
-rw-r--r-- | Makefile.am | 1 | ||||
-rwxr-xr-x | autogen.sh | 2 | ||||
-rw-r--r-- | configure.ac | 30 | ||||
-rw-r--r-- | src/tracker/Makefile.am | 4 |
4 files changed, 26 insertions, 11 deletions
diff --git a/Makefile.am b/Makefile.am index d2976726f..5d2f08995 100644 --- a/Makefile.am +++ b/Makefile.am @@ -98,6 +98,7 @@ DISTCLEANFILES += \ DISTCHECK_CONFIGURE_FLAGS = \ --with-session-bus-services-dir="\$(datadir)"/dbus-1/services \ + --with-bash-completion-dir=$$dc_install_base/share/bash-completion/completions \ --disable-nautilus-extension \ --enable-unit-tests \ --enable-functional-tests \ diff --git a/autogen.sh b/autogen.sh index d1aaf3665..380e4a020 100755 --- a/autogen.sh +++ b/autogen.sh @@ -29,7 +29,7 @@ if [ $# -eq 0 ] ; then if test -n "$JHBUILD_PREFIX" ; then echo "Using JHBuild prefix ('$JHBUILD_PREFIX')" - NEW_PREFIX="--prefix $JHBUILD_PREFIX" + NEW_PREFIX="--prefix $JHBUILD_PREFIX --with-bash-completion-dir=$JHBUILD_PREFIX/share/bash-completion/completions" fi NEW_ARGS="\ diff --git a/configure.ac b/configure.ac index b2e3ae8ab..7007cbe00 100644 --- a/configure.ac +++ b/configure.ac @@ -850,15 +850,25 @@ AM_CONDITIONAL(HAVE_TRACKER_FTS, test "$have_tracker_fts" = "yes") #################################################################### # bash-completion #################################################################### -AC_ARG_WITH([bashcompletiondir], - AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]), - [], - [AS_IF([$($PKG_CONFIG --exists bash-completion)], [ - with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion) - ] , [ - with_bashcompletiondir=${datadir}/bash-completion/completions - ])]) -AC_SUBST([bashcompletiondir], [$with_bashcompletiondir]) + +AC_ARG_WITH([bash-completion-dir], + AS_HELP_STRING([--with-bash-completion-dir[=PATH]], + [Install the bash auto-completion script in this directory. @<:@default=yes@:>@]), + [], + [with_bash_completion_dir=yes]) + +if test "x$with_bash_completion_dir" = "xyes"; then + PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], + [BASH_COMPLETION_DIR=$($PKG_CONFIG --variable=completionsdir bash-completion)], + [BASH_COMPLETION_DIR="${datadir}/bash-completion/completions"]) +elif test "x$with_bash_completion_dir" != "xno"; then + # Set with_bash_completions_dir to avoid printing path twice below + BASH_COMPLETION_DIR="$with_bash_completion_dir" + with_bash_completion_dir="yes" +fi + +AC_SUBST([BASH_COMPLETION_DIR]) +AM_CONDITIONAL([WITH_BASH_COMPLETION],[test "x$with_bash_completion_dir" != "xno"]) #################################################################### # Check for D-Bus requirements @@ -2783,6 +2793,8 @@ Feature Support: Cache media art $have_libmediaart (libmediaart) Install artwork $have_artwork + Bash completion support: $with_bash_completion_dir ($BASH_COMPLETION_DIR) + Data Miners / Writebacks: FS (File System): $have_tracker_miner_fs (MeeGo support: $have_meegotouch) diff --git a/src/tracker/Makefile.am b/src/tracker/Makefile.am index 27e6e9654..3b06fa1fd 100644 --- a/src/tracker/Makefile.am +++ b/src/tracker/Makefile.am @@ -76,8 +76,10 @@ uninstall-hook: $(RM) "$(DESTDIR)$(bindir)/tracker-tag" # Bash completion -bashcompletiondir = @bashcompletiondir@ +if WITH_BASH_COMPLETION +bashcompletiondir = $(BASH_COMPLETION_DIR) bashcompletion_DATA = bash-completion/tracker +endif tracker-compat: tracker-compat.in $(AM_V_at)sed -e "s|@bindir[@]|${bindir}|" $< > $@ |