shithub: choc

Download patch

ref: ea37ca0e06d34968964e02144534a63bab72e52e
parent: 6ce8514c981501ee2e859ee29a990bbd657b5de0
parent: c3e58795029fcf414cab73d9fb8167bbc204f20c
author: Simon Howard <fraggle+github@gmail.com>
date: Tue Oct 27 08:43:40 EDT 2015

Merge pull request #632 from chungy/bash-completion-inst

bash-completion: Detect the appropriate directory for installation

--- a/configure.ac
+++ b/configure.ac
@@ -117,6 +117,13 @@
     AC_CHECK_LIB(amd64, amd64_iopl)
 ])
 
+AC_ARG_WITH([bashcompletiondir],
+    AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completion directory]),
+    [],
+    [AS_IF([$($PKG_CONFIG --exists bash-completion)],
+        [bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)],
+	[bashcompletiondir=${datadir}/bash-completion/completions])])
+
 case $host in
   *cygwin* | *mingw* )
     AC_CHECK_TOOL(WINDRES, windres, )
@@ -166,6 +173,8 @@
 AC_SUBST(PACKAGE_MAINTAINER)
 AC_SUBST(PACKAGE_URL)
 AC_SUBST(PACKAGE_ISSUES)
+
+AC_SUBST(bashcompletiondir)
 
 dnl Shut up the datarootdir warnings.
 AC_DEFUN([AC_DATAROOTDIR_CHECKED])
--- /dev/null
+++ b/man/bash-completion/.gitignore
@@ -1,0 +1,4 @@
+*doom
+*heretic
+*hexen
+*strife
--- a/man/bash-completion/Makefile.am
+++ b/man/bash-completion/Makefile.am
@@ -1,3 +1,5 @@
+bashcompletiondir=@bashcompletiondir@
+
 BASH_COMPLETION_TEMPLATES = \
     doom.template \
     heretic.template \
@@ -12,7 +14,7 @@
     @PROGRAM_PREFIX@hexen \
     @PROGRAM_PREFIX@strife
 
-noinst_DATA = $(BASH_COMPLETION_SCRIPTLETS)
+bashcompletion_DATA = $(BASH_COMPLETION_SCRIPTLETS)
 CLEANFILES = $(BASH_COMPLETION_SCRIPTLETS)
 
 MANDIR = $(top_srcdir)/man