1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-22 08:58:47 +00:00

dns/dog: Simplify shell completion installation

This commit is contained in:
Lewis Cook 2022-12-13 20:55:16 +00:00
parent da864ad356
commit 69709b474b
2 changed files with 9 additions and 15 deletions

View File

@ -94,27 +94,25 @@ CARGO_CRATES= addr2line-0.14.0 \
winreg-0.6.2 \
mutagen,mutagen-core,mutagen-transform@git+https://github.com/llogiq/mutagen\#c7abc956a10e8a3e2cc71f21279ea0a42f7b7c10
PLIST_FILES= bin/${PORTNAME}
PORTDOCS= README.md
OPTIONS_DEFINE= COMPLETIONS DOCS
OPTIONS_DEFAULT= COMPLETIONS
OPTIONS_SUB= yes
COMPLETIONS_DESC= Install shell completions for bash, fish and zsh
COMPLETIONS_DESC= Install bash, fish and zsh shell completions
COMPLETIONS_PLIST_FILES= share/bash-completion/completions/${PORTNAME} \
share/fish/vendor_completions.d/${PORTNAME}.fish \
share/zsh/site-functions/_${PORTNAME}
post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
post-install-COMPLETIONS-on:
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d
${INSTALL_DATA} ${WRKSRC}/completions/${PORTNAME}.bash \
${STAGEDIR}${PREFIX}/etc/bash_completion.d/${PORTNAME}
@${MKDIR} ${STAGEDIR}${PREFIX}/share/fish/completions
${INSTALL_DATA} ${WRKSRC}/completions/${PORTNAME}.fish \
${STAGEDIR}${PREFIX}/share/fish/completions/${PORTNAME}.fish
@${MKDIR} ${STAGEDIR}${PREFIX}/share/zsh/site-functions
${INSTALL_DATA} ${WRKSRC}/completions/${PORTNAME}.zsh \
${STAGEDIR}${PREFIX}/share/zsh/site-functions/_${PORTNAME}
.for _shell in bash fish zsh
${INSTALL_DATA} ${WRKSRC}/completions/${PORTNAME}.${_shell} \
${STAGEDIR}${PREFIX}/${COMPLETIONS_PLIST_FILES:M*${_shell}*}
.endfor
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}

View File

@ -1,4 +0,0 @@
bin/dog
%%COMPLETIONS%%etc/bash_completion.d/dog
%%COMPLETIONS%%share/fish/completions/dog.fish
%%COMPLETIONS%%share/zsh/site-functions/_dog