437741
%global pypi_name packaging
437741
437741
%if 0%{?fedora} || 0%{?rhel} > 7
437741
%global build_wheel 1
437741
%global with_python3 1
437741
%endif
437741
437741
%if 0%{?rhel} > 7
437741
# Disable python2 build by default
437741
%bcond_with python2
437741
%else
437741
%bcond_without python2
437741
%endif
437741
437741
%global python2_wheelname %{pypi_name}-%{version}-py2.py3-none-any.whl
437741
%global python3_wheelname %python2_wheelname
437741
437741
Name:           python-%{pypi_name}
437741
Version:        16.8
437741
Release:        9%{?dist}
437741
Summary:        Core utilities for Python packages
437741
437741
License:        BSD or ASL 2.0
437741
URL:            https://github.com/pypa/packaging
437741
Source0:        https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
437741
BuildArch:      noarch
437741
437741
# Dependencies with different names in Fedora and Epel7
437741
%if %{with python2}
437741
%if 0%{?fedora} || 0%{?rhel} > 7
437741
BuildRequires:  python2-setuptools
437741
BuildRequires:  python2-devel
437741
BuildRequires:  python2-pytest
437741
BuildRequires:  python2-pyparsing
437741
%else
437741
BuildRequires:  python-setuptools
437741
BuildRequires:  python-devel
437741
BuildRequires:  pytest
437741
BuildRequires:  pyparsing
437741
BuildRequires:  python-sphinx
437741
%endif
437741
437741
BuildRequires:  python-pretend
437741
BuildRequires:  python-six
437741
%endif # with python2
437741
437741
# Build Python 3 subpackage only for Fedora
437741
%if 0%{?with_python3}
437741
BuildRequires:  python%{python3_pkgversion}-setuptools
437741
BuildRequires:  python%{python3_pkgversion}-devel
437741
BuildRequires:  python%{python3_pkgversion}-pytest
437741
BuildRequires:  python%{python3_pkgversion}-pretend
437741
BuildRequires:  python%{python3_pkgversion}-pyparsing
437741
BuildRequires:  python%{python3_pkgversion}-six
437741
BuildRequires:  python%{python3_pkgversion}-sphinx
437741
%endif
437741
437741
%if 0%{?build_wheel}
437741
%if %{with python2}
437741
BuildRequires:  python2-pip
437741
BuildRequires:  python2-wheel
437741
%endif # with python2
437741
%if 0%{?with_python3}
437741
BuildRequires:  python%{python3_pkgversion}-pip
437741
BuildRequires:  python%{python3_pkgversion}-wheel
437741
%endif
437741
%endif
437741
437741
%description
437741
python-packaging provides core utilities for Python packages like utilities for
437741
dealing with versions, specifiers, markers etc.
437741
437741
%if %{with python2}
437741
%package -n python2-%{pypi_name}
437741
Summary:        %{summary}
437741
%{?python_provide:%python_provide python2-%{pypi_name}}
437741
437741
%if 0%{?fedora} || 0%{?rhel} > 7
437741
Requires:       python2-pyparsing
437741
%else
437741
Requires:       pyparsing
437741
%endif
437741
437741
Requires:       python-six
437741
437741
%description -n python2-%{pypi_name}
437741
python2-packaging provides core utilities for Python packages like utilities for
437741
dealing with versions, specifiers, markers etc.
437741
%endif # with python2
437741
437741
%if 0%{?with_python3}
437741
%package -n python%{python3_pkgversion}-%{pypi_name}
437741
Summary:        %{summary}
437741
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
437741
 
437741
Requires:       python%{python3_pkgversion}-pyparsing
437741
Requires:       python%{python3_pkgversion}-six
437741
%description -n python%{python3_pkgversion}-%{pypi_name}
437741
python3-packaging provides core utilities for Python packages like utilities for
437741
dealing with versions, specifiers, markers etc.
437741
%endif
437741
437741
%package -n python-%{pypi_name}-doc
437741
Summary:        python-packaging documentation
437741
%description -n python-%{pypi_name}-doc
437741
Documentation for python-packaging
437741
437741
%prep
437741
%autosetup -n %{pypi_name}-%{version}
437741
# Remove bundled egg-info
437741
rm -rf %{pypi_name}.egg-info
437741
437741
%build
437741
%if %{with python2}
437741
%if 0%{?build_wheel}
437741
%py2_build_wheel
437741
%else
437741
%py2_build
437741
%endif
437741
%endif # with python2
437741
437741
%if 0%{?with_python3}
437741
%if 0%{?build_wheel}
437741
%py3_build_wheel
437741
%else
437741
%py3_build
437741
%endif
437741
%endif
437741
437741
# generate html docs
437741
%if 0%{?with_python3}
437741
sphinx-build-3 docs html
437741
%else
437741
sphinx-build docs html
437741
%endif
437741
437741
# remove the sphinx-build leftovers
437741
rm -rf html/.{doctrees,buildinfo}
437741
# Do not bundle fonts
437741
rm -rf html/_static/fonts/
437741
437741
%install
437741
%if %{with python2}
437741
%if 0%{?build_wheel}
437741
%py2_install_wheel %{python2_wheelname}
437741
%else
437741
%py2_install
437741
%endif
437741
%endif # with python2
437741
437741
%if 0%{?with_python3}
437741
%if 0%{?build_wheel}
437741
%py3_install_wheel %{python3_wheelname}
437741
%else
437741
%py3_install
437741
%endif
437741
%endif
437741
437741
%check
437741
%if %{with python2}
437741
%if 0%{?fedora} || 0%{?rhel} > 7
437741
%{__python2} -m pytest tests/
437741
%else
437741
# Disable non-working tests in Epel7
437741
%{__python2} -m pytest --ignore=tests/test_requirements.py tests/
437741
%endif
437741
%endif # with python2
437741
437741
%if 0%{?with_python3}
437741
%{__python3} -m pytest tests/
437741
%endif
437741
437741
%if %{with python2}
437741
%files -n python2-%{pypi_name}
437741
%license LICENSE LICENSE.APACHE LICENSE.BSD
437741
%doc README.rst CHANGELOG.rst CONTRIBUTING.rst
437741
%{python2_sitelib}/%{pypi_name}/
437741
%{python2_sitelib}/%{pypi_name}-*-info/
437741
%endif # with python2
437741
437741
%if 0%{?with_python3}
437741
%files -n python%{python3_pkgversion}-%{pypi_name}
437741
%license LICENSE LICENSE.APACHE LICENSE.BSD
437741
%doc README.rst CHANGELOG.rst CONTRIBUTING.rst
437741
%{python3_sitelib}/%{pypi_name}/
437741
%{python3_sitelib}/%{pypi_name}-*-info/
437741
%endif
437741
437741
%files -n python-%{pypi_name}-doc
437741
%doc html
437741
%license LICENSE LICENSE.APACHE LICENSE.BSD
437741
437741
%changelog
437741
* Thu Jun 14 2018 Charalampos Stratakis <cstratak@redhat.com> - 16.8-9
437741
- Conditionalize the python2 subpackage
437741
437741
* Tue May 22 2018 Petr Viktorin <pviktori@redhat.com> - 16.8-8
437741
- Build the Python 3 subpackage also on EL>7
437741
437741
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 16.8-7
437741
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
437741
437741
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 16.8-6
437741
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
437741
437741
* Wed Mar 22 2017 Lumir Balhar <lbalhar@redhat.com> - 16.8-5
437741
- Epel7 compatible spec/package
437741
437741
* Mon Feb 13 2017 Charalampos Stratakis <cstratak@redhat.com> - 16.8-4
437741
- Rebuild as wheel
437741
437741
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 16.8-3
437741
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
437741
437741
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 16.8-2
437741
- Rebuild for Python 3.6
437741
437741
* Wed Nov 02 2016 Lumir Balhar <lbalhar@redhat.com> - 16.8-1
437741
- New upstream version
437741
437741
* Fri Sep 16 2016 Lumir Balhar <lbalhar@redhat.com> - 16.7-1
437741
- Initial package.