From 6186a480fa97e4e45c7a867db91886b94358b443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 8 Aug 2018 14:09:36 +0200 Subject: [PATCH] Create python-pip-wheel package with the wheel --- python-pip.spec | 121 ++++++++++++++++++++++++++++-------------------- 1 file changed, 71 insertions(+), 50 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 97db6bc..e4f6c1e 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -11,6 +11,7 @@ %global srcname pip %global python_wheelname %{srcname}-%{version}-py2.py3-none-any.whl +%global python_wheeldir %{_datadir}/python-wheels %if %{without bootstrap} %if %{with python2} %global python2_wheelname %python_wheelname @@ -33,7 +34,7 @@ Name: python-%{srcname} # When updating, update the bundled libraries versions bellow! Version: 18.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A tool for installing and managing Python packages Group: Development/Libraries @@ -124,6 +125,35 @@ written in Python. Many packages can be found in the Python Package Index Packages" or "Pip Installs Python". + +# Virtual provides for the packages bundled by pip. +# You can find the versions in pip/_vendor/vendor.txt file. +%global bundled() %{expand: +Provides: bundled(python%{1}dist(appdirs)) = 1.4.3 +Provides: bundled(python%{1}dist(distlib)) = 0.2.7 +Provides: bundled(python%{1}dist(distro)) = 1.3.0 +Provides: bundled(python%{1}dist(html5lib)) = 1.0.1 +Provides: bundled(python%{1}dist(six)) = 1.11.0 +Provides: bundled(python%{1}dist(colorama)) = 0.3.9 +Provides: bundled(python%{1}dist(CacheControl)) = 0.12.5 +Provides: bundled(python%{1}dist(msgpack-python)) = 0.5.6 +Provides: bundled(python%{1}dist(lockfile)) = 0.12.2 +Provides: bundled(python%{1}dist(progress)) = 1.4 +Provides: bundled(python%{1}dist(ipaddress)) = 1.0.22 +Provides: bundled(python%{1}dist(packaging)) = 17.1 +Provides: bundled(python%{1}dist(pyparsing)) = 2.2.0 +Provides: bundled(python%{1}dist(pytoml)) = 0.1.16 +Provides: bundled(python%{1}dist(retrying)) = 1.3.3 +Provides: bundled(python%{1}dist(requests)) = 2.19.1 +Provides: bundled(python%{1}dist(idna)) = 2.7 +Provides: bundled(python%{1}dist(certifi)) = 2018.4.16 +Provides: bundled(python%{1}dist(setuptools)) = 39.2.0 +Provides: bundled(python%{1}dist(webencodings)) = 0.5.1 +Provides: bundled(python%{1}dist(chardet)) = 3.0.4 +Provides: bundled(python%{1}dist(urllib3)) = 1.23 +} + + %if %{with python2} %package -n python2-%{srcname} Summary: A tool for installing and managing Python 2 packages @@ -145,31 +175,8 @@ BuildRequires: python2-wheel %endif Requires: python2-setuptools -# Virtual provides for the packages bundled by pip. -# You can find the versions in pip/_vendor/vendor.txt file. -# Don't forget to update this bellow for python3 as well. -Provides: bundled(python2dist(appdirs)) = 1.4.3 -Provides: bundled(python2dist(distlib)) = 0.2.7 -Provides: bundled(python2dist(distro)) = 1.3.0 -Provides: bundled(python2dist(html5lib)) = 1.0.1 -Provides: bundled(python2dist(six)) = 1.11.0 -Provides: bundled(python2dist(colorama)) = 0.3.9 -Provides: bundled(python2dist(CacheControl)) = 0.12.5 -Provides: bundled(python2dist(msgpack-python)) = 0.5.6 -Provides: bundled(python2dist(lockfile)) = 0.12.2 -Provides: bundled(python2dist(progress)) = 1.4 -Provides: bundled(python2dist(ipaddress)) = 1.0.22 -Provides: bundled(python2dist(packaging)) = 17.1 -Provides: bundled(python2dist(pyparsing)) = 2.2.0 -Provides: bundled(python2dist(pytoml)) = 0.1.16 -Provides: bundled(python2dist(retrying)) = 1.3.3 -Provides: bundled(python2dist(requests)) = 2.19.1 -Provides: bundled(python2dist(idna)) = 2.7 -Provides: bundled(python2dist(certifi)) = 2018.4.16 -Provides: bundled(python2dist(setuptools)) = 39.2.0 -Provides: bundled(python2dist(webencodings)) = 0.5.1 -Provides: bundled(python2dist(chardet)) = 3.0.4 -Provides: bundled(python2dist(urllib3)) = 1.23 +# Virtual provides for the packages bundled by pip: +%{bundled 2} %{?python_provide:%python_provide python2-%{srcname}} @@ -205,30 +212,8 @@ BuildRequires: python%{python3_pkgversion}-wheel %endif Requires: python%{python3_pkgversion}-setuptools -# Virtual provides for the packages bundled by pip. -# See the python2 list above for instructions. -Provides: bundled(python3dist(appdirs)) = 1.4.3 -Provides: bundled(python3dist(distlib)) = 0.2.7 -Provides: bundled(python3dist(distro)) = 1.3.0 -Provides: bundled(python3dist(html5lib)) = 1.0.1 -Provides: bundled(python3dist(six)) = 1.11.0 -Provides: bundled(python3dist(colorama)) = 0.3.9 -Provides: bundled(python3dist(CacheControl)) = 0.12.5 -Provides: bundled(python3dist(msgpack-python)) = 0.5.6 -Provides: bundled(python3dist(lockfile)) = 0.12.2 -Provides: bundled(python3dist(progress)) = 1.4 -Provides: bundled(python3dist(ipaddress)) = 1.0.22 -Provides: bundled(python3dist(packaging)) = 17.1 -Provides: bundled(python3dist(pyparsing)) = 2.2.0 -Provides: bundled(python3dist(pytoml)) = 0.1.16 -Provides: bundled(python3dist(retrying)) = 1.3.3 -Provides: bundled(python3dist(requests)) = 2.19.1 -Provides: bundled(python3dist(idna)) = 2.7 -Provides: bundled(python3dist(certifi)) = 2018.4.16 -Provides: bundled(python3dist(setuptools)) = 39.2.0 -Provides: bundled(python3dist(webencodings)) = 0.5.1 -Provides: bundled(python3dist(urllib3)) = 1.23 -Provides: bundled(python3dist(chardet)) = 3.0.4 +# Virtual provides for the packages bundled by pip: +%{bundled 3} %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} @@ -251,6 +236,17 @@ A documentation for a tool for installing and managing Python packages %endif # with python3 +%if %{without bootstrap} +%package wheel +Summary: The pip wheel + +# Virtual provides for the packages bundled by pip: +%{bundled 2} +%{bundled 3} + +%description wheel +A Python wheel of pip to use with venv. +%endif %prep %if %{with doc} && %{without python3} @@ -414,6 +410,16 @@ echo rpm > %{buildroot}%{python3_sitelib}/pip-%{version}.dist-info/INSTALLER %endif %endif +%if %{without bootstrap} +mkdir -p %{buildroot}%{python_wheeldir} +%if %{with python3} +install -p dist/%{python3_wheelname} -t %{buildroot}%{python_wheeldir} +%else +install -p dist/%{python2_wheelname} -t %{buildroot}%{python_wheeldir} +%endif +%endif + + %if %{with tests} %check export PYTHONPATH=src @@ -477,7 +483,22 @@ py.test-%{python3_version} -m 'not network' %endif # with doc %endif # with python3 +%if %{without bootstrap} +%files wheel +%license LICENSE.txt +# we own the dir for simplicity +%dir %{python_wheeldir}/ +%if %{with python3} +%{python_wheeldir}/%{python3_wheelname} +%else +%{python_wheeldir}/%{python2_wheelname} +%endif +%endif + %changelog +* Wed Aug 08 2018 Miro Hrončok - 18.0-3 +- Create python-pip-wheel package with the wheel + * Tue Jul 31 2018 Miro Hrončok - 18.0-2 - Remove redundant "Unicode"" from License