Add a subpackage with wheels

Use a common python_wheelname for both Pytohn versions
This commit is contained in:
Petr Viktorin 2018-08-15 15:16:16 +02:00
parent 4d41ef086a
commit d7f5288145

View File

@ -10,12 +10,11 @@
%if %{without bootstrap} %if %{without bootstrap}
%global python_wheelname %{srcname}-%{version}-py2.py3-none-any.whl %global python_wheelname %{srcname}-%{version}-py2.py3-none-any.whl
%if %{with python2} %if %{with python2}
%global python2_wheelname %python_wheelname
%global python2_record %{python2_sitelib}/%{srcname}-%{version}.dist-info/RECORD %global python2_record %{python2_sitelib}/%{srcname}-%{version}.dist-info/RECORD
%endif %endif
%global python3_wheelname %python_wheelname
%global python3_record %{python3_sitelib}/%{srcname}-%{version}.dist-info/RECORD %global python3_record %{python3_sitelib}/%{srcname}-%{version}.dist-info/RECORD
%endif %endif
%global python_wheeldir %{_datadir}/python-wheels
Name: python-setuptools Name: python-setuptools
Version: 39.2.0 Version: 39.2.0
@ -110,6 +109,14 @@ have dependencies on other packages.
This package also contains the runtime components of setuptools, necessary to This package also contains the runtime components of setuptools, necessary to
execute the software that requires pkg_resources.py. execute the software that requires pkg_resources.py.
%if %{without bootstrap}
%package wheel
Summary: The setuptools wheel
%description wheel
A Python wheel of setuptools to use with venv.
%endif
%prep %prep
%autosetup -p1 -n %{srcname}-%{version} %autosetup -p1 -n %{srcname}-%{version}
@ -136,17 +143,13 @@ rm setuptools/tests/test_integration.py
chmod -x README.rst chmod -x README.rst
%build %build
%if %{with python2}
%if %{without bootstrap}
%py2_build_wheel
%else
%py2_build
%endif
%endif # with python2
%if %{without bootstrap} %if %{without bootstrap}
%py3_build_wheel %py3_build_wheel
%else %else
%if %{with python2}
%py2_build
%endif # with python2
%py3_build %py3_build
%endif %endif
@ -156,7 +159,7 @@ chmod -x README.rst
# overwritten with every setup.py install (and we want /usr/bin/pip to be # overwritten with every setup.py install (and we want /usr/bin/pip to be
# the python2 version). # the python2 version).
%if %{without bootstrap} %if %{without bootstrap}
%py3_install_wheel %{python3_wheelname} %py3_install_wheel %{python_wheelname}
# Remove /usr/bin/easy_install from the record as later on we delete the file # Remove /usr/bin/easy_install from the record as later on we delete the file
sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_record} sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_record}
@ -178,7 +181,7 @@ find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f
%if %{with python2} %if %{with python2}
%if %{without bootstrap} %if %{without bootstrap}
%py2_install_wheel %{python2_wheelname} %py2_install_wheel %{python_wheelname}
%else %else
%py2_install %py2_install
%endif %endif
@ -194,6 +197,11 @@ find %{buildroot}%{python2_sitelib} -name '*.exe' | xargs rm -f
# Don't ship these # Don't ship these
rm -r docs/{Makefile,conf.py,_*} rm -r docs/{Makefile,conf.py,_*}
%if %{without bootstrap}
mkdir -p %{buildroot}%{python_wheeldir}
install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir}
%endif
%if %{with tests} %if %{with tests}
%check %check
@ -227,9 +235,18 @@ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(pwd) py.test-%{python3_version} --ignore=
%{python3_sitelib}/__pycache__/* %{python3_sitelib}/__pycache__/*
%{_bindir}/easy_install-3.* %{_bindir}/easy_install-3.*
%if %{without bootstrap}
%files wheel
%license LICENSE
# we own the dir for simplicity
%dir %{python_wheeldir}/
%{python_wheeldir}/%{python_wheelname}
%endif
%changelog %changelog
* Wed Aug 15 2018 Petr Viktorin <pviktori@redhat.com> - 39.2.0-7 * Wed Aug 15 2018 Petr Viktorin <pviktori@redhat.com> - 39.2.0-7
- Add a subpackage with wheels
- Remove the python3 bcond - Remove the python3 bcond
- Remove macros for RHEL 6 - Remove macros for RHEL 6