Improve Debian bash-completion support

* Autoconf queries pkgconf for bash-completion dir-- resolves
  lintian's `package-install-into-obsolete-dir` diagnostic
* Use improved completion snippet from
  <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=782169>
* Remove old /etc/bash_completion.d/mosh "conffile" with
  dh-maintscript + dpkg-maintscript-helper

Closes #628.

Signed-off-by: John Hood <cgull@glup.org>
This commit is contained in:
John Hood
2015-06-23 23:40:40 -04:00
parent 6a169dc7ea
commit dee1a2eecc
6 changed files with 22 additions and 3 deletions
+3 -1
View File
@@ -1,3 +1,5 @@
completionsdir = @completions@
dist_completions_DATA =
nobase_dist_sysconf_DATA = nobase_dist_sysconf_DATA =
if INSTALL_UFW if INSTALL_UFW
@@ -5,5 +7,5 @@ if INSTALL_UFW
endif endif
if INSTALL_COMPLETION if INSTALL_COMPLETION
nobase_dist_sysconf_DATA += bash_completion.d/mosh dist_completions_DATA += bash-completion/completions/mosh
endif endif
+9
View File
@@ -0,0 +1,9 @@
_mosh () {
local cur prev
_init_completion || return
_known_hosts_real -a "$cur"
}
complete -F _mosh mosh
-1
View File
@@ -1 +0,0 @@
complete -F _known_hosts mosh
+7
View File
@@ -369,6 +369,13 @@ AC_CHECK_DECL([IUTF8],
# Checks for protobuf # Checks for protobuf
PKG_CHECK_MODULES([protobuf], [protobuf]) PKG_CHECK_MODULES([protobuf], [protobuf])
# Bash completion needs to ask where it goes if >= 2.0 is installed.
AS_IF([test "$install_completion" != no],
[PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
[completions="`pkg-config --variable=completionsdir bash-completion`"],
[completions="${sysconfdir}/bash-completion.d"])
AC_SUBST([completions])])
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
src/Makefile src/Makefile
+2 -1
View File
@@ -2,7 +2,7 @@ Source: mosh
Section: net Section: net
Priority: optional Priority: optional
Maintainer: Keith Winstein <keithw@mit.edu> Maintainer: Keith Winstein <keithw@mit.edu>
Build-Depends: debhelper (>= 7.0.50), autotools-dev, protobuf-compiler, libprotobuf-dev, dh-autoreconf, pkg-config, libutempter-dev, zlib1g-dev, libncurses5-dev, libssl-dev Build-Depends: debhelper (>= 7.0.50), autotools-dev, protobuf-compiler, libprotobuf-dev, dh-autoreconf, pkg-config, libutempter-dev, zlib1g-dev, libncurses5-dev, libssl-dev, bash-completion
Standards-Version: 3.9.6.1 Standards-Version: 3.9.6.1
Homepage: http://mosh.mit.edu Homepage: http://mosh.mit.edu
Vcs-Git: git://github.com/keithw/mosh.git Vcs-Git: git://github.com/keithw/mosh.git
@@ -10,6 +10,7 @@ Vcs-Browser: https://github.com/keithw/mosh
Package: mosh Package: mosh
Architecture: any Architecture: any
Pre-Depends: dpkg (>= 1.15.7.2)
Depends: ${shlibs:Depends}, ${misc:Depends}, openssh-client Depends: ${shlibs:Depends}, ${misc:Depends}, openssh-client
Recommends: libio-socket-ip-perl Recommends: libio-socket-ip-perl
Description: Mobile shell that supports roaming and intelligent local echo Description: Mobile shell that supports roaming and intelligent local echo
+1
View File
@@ -0,0 +1 @@
rm_conffile /etc/bash_completion.d/mosh 1.2.5~ -- "$@"