Simplify bash-completion just for EL7
This commit is contained in:
parent
50953dcc78
commit
e399cdb219
1 changed files with 20 additions and 28 deletions
|
|
@ -10,14 +10,9 @@
|
|||
%endif
|
||||
%endif
|
||||
|
||||
%global bashcompdir %(b=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null); echo ${b:-%{_sysconfdir}/bash_completion.d})
|
||||
%if "%{bashcompdir}" != "%{_sysconfdir}/bash_completion.d"
|
||||
%global bashcomp2 1
|
||||
%endif
|
||||
|
||||
Name: python-%{srcname}
|
||||
Version: 8.1.2
|
||||
Release: 6%{?dist}
|
||||
Release: 7%{?dist}
|
||||
Summary: A tool for installing and managing Python packages
|
||||
|
||||
Group: Development/Libraries
|
||||
|
|
@ -87,7 +82,6 @@ Group: Development/Libraries
|
|||
|
||||
BuildRequires: python%{python3_pkgversion}-devel
|
||||
BuildRequires: python%{python3_pkgversion}-setuptools
|
||||
BuildRequires: bash-completion
|
||||
%if 0%{?with_tests}
|
||||
BuildRequires: python%{python3_pkgversion}-mock
|
||||
BuildRequires: python%{python3_pkgversion}-pytest
|
||||
|
|
@ -158,14 +152,14 @@ rm %{buildroot}%{_bindir}/pip
|
|||
%py2_install
|
||||
%endif
|
||||
|
||||
mkdir -p %{buildroot}%{bashcompdir}
|
||||
mkdir -p %{buildroot}%{bash_completion_dir}
|
||||
PYTHONPATH=%{buildroot}%{python_sitelib} \
|
||||
%{buildroot}%{_bindir}/pip completion --bash \
|
||||
> %{buildroot}%{bashcompdir}/pip
|
||||
> %{buildroot}%{bash_completion_dir}/pip
|
||||
%if 0%{?with_python3}
|
||||
PYTHONPATH=%{buildroot}%{python3_sitelib} \
|
||||
%{buildroot}%{_bindir}/pip3 completion --bash \
|
||||
> %{buildroot}%{bashcompdir}/pip3
|
||||
> %{buildroot}%{bash_completion_dir}/pip3
|
||||
%endif
|
||||
pips2=pip
|
||||
pips3=pip3
|
||||
|
|
@ -174,16 +168,12 @@ for pip in %{buildroot}%{_bindir}/pip*; do
|
|||
case $pip in
|
||||
pip2*)
|
||||
pips2="$pips2 $pip"
|
||||
%if 0%{?bashcomp2}
|
||||
ln -s pip %{buildroot}%{bashcompdir}/$pip
|
||||
%endif
|
||||
ln -s pip %{buildroot}%{bash_completion_dir}/$pip
|
||||
;;
|
||||
%if 0%{?with_python3}
|
||||
pip3?*)
|
||||
pips3="$pips3 $pip"
|
||||
%if 0%{?bashcomp2}
|
||||
ln -s pip3 %{buildroot}%{bashcompdir}/$pip
|
||||
%endif
|
||||
ln -s pip3 %{buildroot}%{bash_completion_dir}/$pip
|
||||
;;
|
||||
%endif
|
||||
esac
|
||||
|
|
@ -191,10 +181,10 @@ done
|
|||
%if 0%{?with_python3}
|
||||
sed -i -e "s/^\\(complete.*\\) pip\$/\\1 $pips3/" \
|
||||
-e s/_pip_completion/_pip3_completion/ \
|
||||
%{buildroot}%{bashcompdir}/pip3
|
||||
%{buildroot}%{bash_completion_dir}/pip3
|
||||
%endif
|
||||
sed -i -e "s/^\\(complete.*\\) pip\$/\\1 $pips2/" \
|
||||
%{buildroot}%{bashcompdir}/pip
|
||||
%{buildroot}%{bash_completion_dir}/pip
|
||||
|
||||
%if 0%{?with_tests}
|
||||
%check
|
||||
|
|
@ -209,12 +199,12 @@ py.test-%{python3_version} -m 'not network'
|
|||
%attr(755,root,root) %{_bindir}/pip
|
||||
%attr(755,root,root) %{_bindir}/pip2*
|
||||
%{python_sitelib}/pip*
|
||||
%{bashcompdir}
|
||||
%dir %{_datadir}/bash-completion
|
||||
%dir %{bash_completion_dir}
|
||||
%{bash_completion_dir}
|
||||
%if 0%{?with_python3}
|
||||
%exclude %{bashcompdir}/pip3*
|
||||
%endif
|
||||
%if 0%{?bashcomp2}
|
||||
%dir %(dirname %{bashcompdir})
|
||||
%exclude %{bash_completion_dir}/pip3
|
||||
%exclude %{bash_completion_dir}/pip%{python3_version}
|
||||
%endif
|
||||
|
||||
%if 0%{?with_python3}
|
||||
|
|
@ -223,14 +213,16 @@ py.test-%{python3_version} -m 'not network'
|
|||
%doc README.rst docs
|
||||
%attr(755,root,root) %{_bindir}/pip3*
|
||||
%{python3_sitelib}/pip*
|
||||
%dir %{bashcompdir}
|
||||
%{bashcompdir}/pip3*
|
||||
%if 0%{?bashcomp2}
|
||||
%dir %(dirname %{bashcompdir})
|
||||
%endif
|
||||
%dir %{_datadir}/bash-completion
|
||||
%dir %{bash_completion_dir}
|
||||
%{bash_completion_dir}/pip3
|
||||
%{bash_completion_dir}/pip%{python3_version}
|
||||
%endif # with_python3
|
||||
|
||||
%changelog
|
||||
* Thu Jan 10 2019 Carl George <carl@george.computer> - 8.1.2-7
|
||||
- Simplify bash-completion just for EL7
|
||||
|
||||
* Wed Apr 04 2018 Tomas Orsava <torsava@redhat.com> - 8.1.2-6
|
||||
- Added Patch 1: Fix `pip install` failure in FIPS mode
|
||||
Resolves: rhbz#1430774
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue