| |
@@ -12,6 +12,11 @@
|
| |
%bcond_without doc
|
| |
%endif
|
| |
|
| |
+ # Similar to what we have in pythonX.Y.spec files.
|
| |
+ # If enabled, provides unversioned executables and other stuff.
|
| |
+ # Disable it if you build this package in an alternative stack.
|
| |
+ %bcond_without main_python
|
| |
+
|
| |
%global srcname pip
|
| |
%global base_version 21.0.1
|
| |
%global upstream_version %{base_version}%{?prerel}
|
| |
@@ -206,12 +211,13 @@
|
| |
Recommends: python%{python3_pkgversion}-setuptools
|
| |
|
| |
# Virtual provides for the packages bundled by pip:
|
| |
- %{bundled 3}
|
| |
+ %{bundled %{python3_pkgversion}}
|
| |
|
| |
+ %if %{with main_python}
|
| |
Provides: pip = %{version}-%{release}
|
| |
- Conflicts: python-pip < %{version}-%{release}
|
| |
+ %endif
|
| |
|
| |
- %{crypt_compat_recommends 3}
|
| |
+ %{crypt_compat_recommends %{python3_pkgversion}}
|
| |
|
| |
%description -n python%{python3_pkgversion}-%{srcname}
|
| |
pip is a package management system used to install and manage software packages
|
| |
@@ -237,10 +243,10 @@
|
| |
|
| |
# Virtual provides for the packages bundled by pip:
|
| |
%{bundled 2}
|
| |
- %{bundled 3}
|
| |
+ %{bundled %{python3_pkgversion}}
|
| |
|
| |
%{crypt_compat_recommends 2}
|
| |
- %{crypt_compat_recommends 3}
|
| |
+ %{crypt_compat_recommends %{python3_pkgversion}}
|
| |
|
| |
%description wheel
|
| |
A Python wheel of pip to use with venv.
|
| |
@@ -295,10 +301,13 @@
|
| |
pushd docs/build/man
|
| |
install -d %{buildroot}%{_mandir}/man1
|
| |
for MAN in *1; do
|
| |
- install -pm0644 $MAN %{buildroot}%{_mandir}/man1/$MAN
|
| |
- for pip in "pip3" "pip-3" "pip%{python3_version}" "pip-%{python3_version}"; do
|
| |
- echo ".so $MAN" > %{buildroot}%{_mandir}/man1/${MAN/pip/$pip}
|
| |
+ install -pm0644 $MAN %{buildroot}%{_mandir}/man1/${MAN/pip/pip-%{python3_version}}
|
| |
+ echo ".so ${MAN/pip/pip-%{python3_version}}" > %{buildroot}%{_mandir}/man1/${MAN/pip/pip%{python3_version}}
|
| |
+ %if %{with main_python}
|
| |
+ for pip in "pip" "pip3" "pip-3"; do
|
| |
+ echo ".so ${MAN/pip/pip-%{python3_version}}" > %{buildroot}%{_mandir}/man1/${MAN/pip/$pip}
|
| |
done
|
| |
+ %endif
|
| |
done
|
| |
popd
|
| |
%endif
|
| |
@@ -311,18 +320,28 @@
|
| |
mkdir -p %{buildroot}%{bashcompdir}
|
| |
PYTHONPATH=%{buildroot}%{python3_sitelib} \
|
| |
%{buildroot}%{_bindir}/pip completion --bash \
|
| |
- > %{buildroot}%{bashcompdir}/pip3
|
| |
+ > %{buildroot}%{bashcompdir}/pip-%{python3_pkgversion}
|
| |
|
| |
- # Make bash completion apply to all the 5 symlinks we install
|
| |
+ # Make bash completion apply to all symlinks we install
|
| |
+ %if %{with main_python}
|
| |
sed -i -e "s/^\\(complete.*\\) pip\$/\\1 pip pip{,-}{3,%{python3_version}}/" \
|
| |
- -e s/_pip_completion/_pip3_completion/ \
|
| |
- %{buildroot}%{bashcompdir}/pip3
|
| |
-
|
| |
+ -e s/_pip_completion/_pip%{python3_pkgversion}_completion/ \
|
| |
+ %{buildroot}%{bashcompdir}/pip-%{python3_pkgversion}
|
| |
+ %else
|
| |
+ sed -i -e "s/^\\(complete.*\\) pip\$/\\1 pip{,-}%{python3_version}/" \
|
| |
+ -e s/_pip_completion/_pip%{python3_pkgversion}_completion/ \
|
| |
+ %{buildroot}%{bashcompdir}/pip-%{python3_pkgversion}
|
| |
+ %endif
|
| |
|
| |
- # Provide symlinks to executables to comply with Fedora guidelines for Python
|
| |
ln -s ./pip%{python3_version} %{buildroot}%{_bindir}/pip-%{python3_version}
|
| |
- ln -s ./pip-%{python3_version} %{buildroot}%{_bindir}/pip-3
|
| |
|
| |
+ # Add symlinks or remove unversioned executables based on main_python bcond
|
| |
+ %if %{with main_python}
|
| |
+ ln -s ./pip-%{python3_version} %{buildroot}%{_bindir}/pip-3
|
| |
+ %else
|
| |
+ rm %{buildroot}%{_bindir}/pip
|
| |
+ rm %{buildroot}%{_bindir}/pip3
|
| |
+ %endif
|
| |
|
| |
# Make sure the INSTALLER is not pip and remove RECORD
|
| |
# %%pyproject macros do this for all packages
|
| |
@@ -370,19 +389,23 @@
|
| |
%license LICENSE.txt
|
| |
%doc README.rst
|
| |
%if %{with doc}
|
| |
+ %if %{with main_python}
|
| |
%{_mandir}/man1/pip.*
|
| |
+ %{_mandir}/man1/pip3-*.*
|
| |
+ %endif
|
| |
%{_mandir}/man1/pip-*.*
|
| |
%{_mandir}/man1/pip3.*
|
| |
- %{_mandir}/man1/pip3-*.*
|
| |
%endif
|
| |
+ %if %{with main_python}
|
| |
%{_bindir}/pip
|
| |
%{_bindir}/pip3
|
| |
%{_bindir}/pip-3
|
| |
+ %endif
|
| |
%{_bindir}/pip%{python3_version}
|
| |
%{_bindir}/pip-%{python3_version}
|
| |
%{python3_sitelib}/pip*
|
| |
%dir %{bashcompdir}
|
| |
- %{bashcompdir}/pip3
|
| |
+ %{bashcompdir}/pip-%{python3_pkgversion}
|
| |
|
| |
%if %{with doc}
|
| |
%files doc
|
| |
This one is more complex because of a lot of executables and man pages but it seems to work well. The main idea is to always ship pipX.Y and pip-X.Y and only add pipX and pip-X for the main package. This applies to executables, man pages, and also bash completion definitions. All three mentioned groups tested manually.