From 2deb5b23b1f97e5e554838e0c31d634542e94b40 Mon Sep 17 00:00:00 2001 From: Carl George Date: Tue, 29 Sep 2020 13:13:04 -0500 Subject: [PATCH 2/2] Install shell completion files to correct locations Bash completion files should be installed to /usr/share/bash-completion/completions, with a file name matching the command name. Zsh completion files should be installed to /usr/share/zsh/site-functions, with a file name matching the command name prefixed with an underscore. Resolves #271 https://github.com/scop/bash-completion/blob/master/README.md#faq http://zsh.sourceforge.net/Doc/Release/Completion-System.html --- Makefile.am | 6 +++--- ag.bashcomp.sh => completions/bash/ag | 0 _the_silver_searcher => completions/zsh/_ag | 0 the_silver_searcher.spec.in | 11 +++-------- 4 files changed, 6 insertions(+), 11 deletions(-) rename ag.bashcomp.sh => completions/bash/ag (100%) rename _the_silver_searcher => completions/zsh/_ag (100%) diff --git a/Makefile.am b/Makefile.am index 3931c3a..280b169 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,10 +6,10 @@ ag_LDADD = ${PCRE_LIBS} ${LZMA_LIBS} ${ZLIB_LIBS} $(PTHREAD_LIBS) dist_man_MANS = doc/ag.1 -bashcompdir = $(pkgdatadir)/completions -dist_bashcomp_DATA = ag.bashcomp.sh +bashcompdir = $(datadir)/bash-completion/completions +dist_bashcomp_DATA = completions/bash/ag zshcompdir = $(datadir)/zsh/site-functions -dist_zshcomp_DATA = _the_silver_searcher +dist_zshcomp_DATA = completions/zsh/_ag EXTRA_DIST = Makefile.w32 LICENSE NOTICE the_silver_searcher.spec README.md diff --git a/ag.bashcomp.sh b/completions/bash/ag similarity index 100% rename from ag.bashcomp.sh rename to completions/bash/ag diff --git a/_the_silver_searcher b/completions/zsh/_ag similarity index 100% rename from _the_silver_searcher rename to completions/zsh/_ag diff --git a/the_silver_searcher.spec.in b/the_silver_searcher.spec.in index 445bdec..9239179 100644 --- a/the_silver_searcher.spec.in +++ b/the_silver_searcher.spec.in @@ -1,6 +1,3 @@ -%define _bashcompdir %_sysconfdir/bash_completion.d -%define _zshcompdir %{_datadir}/zsh/site-functions - Name: the_silver_searcher Version: @VERSION@ Release: 1%{?dist} @@ -49,8 +46,6 @@ make %{?_smp_mflags} %install rm -rf ${RPM_BUILD_ROOT} make install DESTDIR=${RPM_BUILD_ROOT} -mkdir -p ${RPM_BUILD_ROOT}%{_bashcompdir} -install -m 644 ag.bashcomp.sh ${RPM_BUILD_ROOT}%{_bashcompdir} %clean rm -rf ${RPM_BUILD_ROOT} @@ -60,9 +55,9 @@ rm -rf ${RPM_BUILD_ROOT} %defattr(-,root,root,-) %{_bindir}/* %{_mandir}/* -%config %{_bashcompdir}/ag.bashcomp.sh -%config %{_datadir}/%{name}/completions/ag.bashcomp.sh -%config %{_datadir}/zsh/site-functions/_the_silver_searcher +%{_datadir}/bash-completion/completions/ag +%{_datadir}/zsh/site-functions/_ag + %changelog * Thu Dec 5 2013 Emily Strickland - 0.18.1-1 -- 2.31.1