%global upstream_name www-authenticate %global modname www_authenticate %if 0%{?fedora} || 0%{?rhel} > 6 %bcond_without python3 %else %bcond_with python3 %endif Name: python-%{upstream_name} Version: 0.9.2 Release: 1%{?dist} Summary: Python library for parsing WWW-Authenticate HTTP header values License: BSD URL: https://github.com/alexsdutton/www-authenticate Source0: https://github.com/alexsdutton/%{upstream_name}/archive/%{version}.tar.gz#/%{upstream_name}-%{version}.tar.gz # https://github.com/alexsdutton/www-authenticate/issues/1 Source1: https://raw.githubusercontent.com/lphuberdeau/www-authenticate/a35e5df38d909e0f73bb6df0573fa80333a4922e/LICENSE BuildArch: noarch %global _description \ Parsing WWW-Authenticate headers is difficult. Let this tiny library do all \ the hard work for you. %description %{_description} %package -n python2-%{upstream_name} Summary: %{summary} %{?python_provide:%python_provide python2-%{upstream_name}} BuildRequires: python2-devel %if 0%{?fedora} || 0%{?rhel} > 7 BuildRequires: python2-setuptools BuildRequires: python2-nose %else BuildRequires: python-setuptools BuildRequires: python-nose %endif %description -n python2-%{upstream_name} %{_description} Python 2 version. %if %{with python3} %package -n python%{python3_pkgversion}-%{upstream_name} Summary: %{summary} %{?python_provide:%python_provide python%{python3_pkgversion}-%{upstream_name}} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-nose %description -n python%{python3_pkgversion}-%{upstream_name} %{_description} Python %{python3_pkgversion} version. %if 0%{?with_python3_other} %package -n python%{python3_other_pkgversion}-%{upstream_name} Summary: %{summary} %{?python_provide:%python_provide python%{python3_other_pkgversion}-%{upstream_name}} BuildRequires: python%{python3_other_pkgversion}-devel BuildRequires: python%{python3_other_pkgversion}-setuptools BuildRequires: python%{python3_other_pkgversion}-nose %description -n python%{python3_other_pkgversion}-%{upstream_name} %{_description} Python %{python3_other_pkgversion} version. %endif %endif %prep %autosetup -n %{upstream_name}-%{version} cp -p %{SOURCE1} . %build %py2_build %if %{with python3} %py3_build %if 0%{?with_python3_other} %py3_other_build %endif %endif %install %py2_install %if %{with python3} %py3_install %if 0%{?with_python3_other} %py3_other_install %endif %endif %check %{__python2} setup.py test %if %{with python3} %{__python3} setup.py test %if 0%{?with_python3_other} %{__python3_other} setup.py test %endif %endif %files -n python2-%{upstream_name} %license LICENSE %doc README.rst %{python2_sitelib}/%{modname}.py* %{python2_sitelib}/%{modname}-*.egg-info %if %{with python3} %files -n python%{python3_pkgversion}-%{upstream_name} %license LICENSE %doc README.rst %{python3_sitelib}/%{modname}.py* %{python3_sitelib}/__pycache__/%{modname}.* %{python3_sitelib}/%{modname}-*.egg-info %if 0%{?with_python3_other} %files -n python%{python3_other_pkgversion}-%{upstream_name} %license LICENSE %doc README.rst %{python3_other_sitelib}/%{modname}.py* %{python3_other_sitelib}/__pycache__/%{modname}.* %{python3_other_sitelib}/%{modname}-*.egg-info %endif %endif %changelog * Thu Dec 08 2016 Dan Callaghan - 0.9.2-1 - initial version