shell-completion: Install the Zsh completions
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Tue, 12 Aug 2014 09:41:55 +0000 (12:41 +0300)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Sun, 17 Aug 2014 05:24:47 +0000 (08:24 +0300)
This makes the Zsh completions work out-of-the-box. I also moved
pulseaudio-zsh-completion.zsh to zsh/_pulseaudio to be in line with
the common naming convention of Zsh completion files.

Makefile.am
configure.ac
shell-completion/zsh/_pulseaudio [moved from shell-completion/pulseaudio-zsh-completion.zsh with 100% similarity]

index f4bd79f..ddbf64a 100644 (file)
@@ -29,7 +29,6 @@ EXTRA_DIST = \
        PROTOCOL \
        README \
        todo \
-       shell-completion/pulseaudio-zsh-completion.zsh \
        .gitignore \
        doxygen/.gitignore \
        m4/.gitignore \
@@ -64,6 +63,9 @@ cmake_DATA = PulseAudioConfig.cmake PulseAudioConfigVersion.cmake
 bashcompletiondir=$(sysconfdir)/bash_completion.d
 dist_bashcompletion_DATA = shell-completion/pulseaudio-bash-completion.sh
 
+zshcompletiondir=@zshcompletiondir@
+dist_zshcompletion_DATA = shell-completion/zsh/_pulseaudio
+
 homepage: all dist doxygen
        test -d $$HOME/homepage/private
        mkdir -p $$HOME/homepage/private/projects/pulseaudio $$HOME/homepage/private/projects/pulseaudio/doxygen
index 837e81e..dc2298d 100644 (file)
@@ -1353,6 +1353,13 @@ AC_ARG_WITH(
 
 AC_SUBST(udevrulesdir)
 
+AC_ARG_WITH(
+        [zsh-completion-dir],
+        AS_HELP_STRING([--with-zsh-completion-dir], [Zsh completions directory (defaults to ${datadir}/zsh/site-functions)]),
+        [zshcompletiondir=$withval], [zshcompletiondir="${datadir}/zsh/site-functions"])
+
+AC_SUBST(zshcompletiondir)
+
 AC_ARG_ENABLE([force-preopen],
     AS_HELP_STRING([--enable-force-preopen],[Preopen modules, even when dlopen() is supported.]))
 
@@ -1465,6 +1472,7 @@ echo "
     System Runtime Path:           ${PA_SYSTEM_RUNTIME_PATH}
     System State Path:             ${PA_SYSTEM_STATE_PATH}
     System Config Path:            ${PA_SYSTEM_CONFIG_PATH}
+    Zsh completions directory:     ${zshcompletiondir}
     Compiler:                      ${CC}
     CFLAGS:                        ${CFLAGS}
     CPPFLAGS:                      ${CPPFLAGS}