Install bash-completion in default location

The desired location for bash-complete files is no longer in /etc.  Use
the recently added macros from redhat-rpm-config¹ to get the path.

Shorten the install command by using the completion file from the source
directory instead of the %buildroot copy.

¹ https://src.fedoraproject.org/rpms/redhat-rpm-config/c/483a3b8 (Add
  macros.shell-completions, 2022-06-25)
This commit is contained in:
Todd Zullinger 2022-11-12 00:21:35 -05:00
parent 53377b1fa4
commit 8c493c15eb

View File

@ -8,7 +8,7 @@
Name: python-argcomplete
Summary: Bash tab completion for argparse
Version: 2.0.0
Release: 4%{?dist}
Release: 5%{?dist}
License: ASL 2.0
URL: https://github.com/kislyuk/argcomplete
Source0: %pypi_source argcomplete
@ -64,8 +64,7 @@ sed -i -e "s|python |python3 |" test/test.py
%install
%py3_install
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/
install -p -m0644 %{buildroot}%{python3_sitelib}/argcomplete/bash_completion.d/python-argcomplete %{buildroot}%{_sysconfdir}/bash_completion.d/
install -Dp -m0644 argcomplete/bash_completion.d/%{name} %{buildroot}%{bash_completions_dir}/%{name}
%if %{with check}
%check
@ -86,9 +85,12 @@ export INPUTRC=$PWD/.inputrc
%{_bindir}/python-argcomplete-check-easy-install-script
%{_bindir}/python-argcomplete-tcsh
%{_bindir}/register-python-argcomplete
%{_sysconfdir}/bash_completion.d/python-argcomplete
%{bash_completions_dir}/%{name}
%changelog
* Sat Nov 12 2022 Todd Zullinger <tmz@pobox.com> - 2.0.0-5
- Install bash-completion in default location
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild