completion: graduate out of contrib
These have been stable and widely used for quite a long time, they even
have tests outside of the contrib area, and most distributions ship
them, so they can be considered part of the core already.
We should be consistent and either we move the tests to contrib, or we
move the completions out of contrib.
Let's move them out of contrib and install them by default.
By default bash-completion installs the completions to
$(pkgdatadir)/completions, which is
$(prefix)/share/bash-completion/completions. And since most distributions do
not change this, it is obviously the right default. However,
bash-completion recommends to use pkg-config to find the right location,
so we could use that, but it's much easier to let distributions do it:
bashcomdir=$pkg-config --variable=completionsdir bash-completion)
By default zsh looks for completions in
$(prefix)/share/zsh/site-functions.
The distributions use these locations to install Git completions:
ArchLinux: /usr/share/bash-completion/completions/
Debian: /usr/share/bash-completion/completions/
Fedora: /etc/bash_completion.d/
Ubuntu: /usr/share/bash-completion/completions/
Mint: /usr/share/bash-completion/completions/
OpenSuse: /etc/bash_completion.d/
However, in both Fedora and OpenSUSE their bash-completion intallations
use /usr/share/bash-completion/completions/ (they don't change the
default). So it seems to a be a bug from the packager, since they
recommend the bash-completion location[1]
If some weird distribution has a problem with the location, they can
override 'bashcompdir' anyway.
[1] http://article.gmane.org/gmane.linux.redhat.fedora.devel/177405
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>