%global pypi_name Flask-HTTPAuth
%global pkg_name flask-httpauth
%if 0%{?fedora}
%global with_python3 1
%endif
Name: python-%{pkg_name}
Version: 3.2.3
Release: 5%{?dist}
Summary: Basic and Digest HTTP authentication for Flask routes
License: MIT
URL: http://github.com/miguelgrinberg/flask-httpauth/
Source0: https://files.pythonhosted.org/packages/source/F/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
%description
FlaskHTTPAuth Basic and Digest HTTP authentication for Flask routes.
%package -n python2-%{pkg_name}
Summary: Basic and Digest HTTP authentication for Flask routes
%{?python_provide:%python_provide python2-%{pkg_name}}
BuildRequires: python2-devel
BuildRequires: python2-flask
BuildRequires: python2-setuptools
BuildRequires: python2-sphinx
Requires: python2-flask
Requires: python2-werkzeug
%description -n python2-%{pkg_name}
FlaskHTTPAuth Basic and Digest HTTP authentication for Flask routes.
%package -n python-%{pkg_name}-doc
Summary: Documentation for Flask-HTTPAuth
%description -n python-%{pkg_name}-doc
FlaskHTTPAuth Basic and Digest HTTP authentication for Flask routes.
This package provides the documentation.
%if 0%{?with_python3}
%package -n python3-%{pkg_name}
Summary: Basic and Digest HTTP authentication for Flask routes
%{?python_provide:%python_provide python3-%{pkg_name}}
BuildRequires: python3-devel
BuildRequires: python3-flask
BuildRequires: python3-setuptools
BuildRequires: python3-sphinx
Requires: python3-flask
Requires: python3-werkzeug
%description -n python3-%{pkg_name}
FlaskHTTPAuth Basic and Digest HTTP authentication for Flask routes.
%endif # with_python3
%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif # with_python3
# generate html docs
%{__python2} setup.py build_sphinx
# remove the sphinx-build leftovers
rm -rf build/sphinx/html/.{doctrees,buildinfo}
%install
%if 0%{?with_python3}
%py3_install
%endif # with_python3
%py2_install
%check
%if 0%{?with_python3}
%{__python3} setup.py test
%endif # with_python3
%{__python2} setup.py test
%files -n python2-%{pkg_name}
%license LICENSE
%doc README.md
%{python2_sitelib}/flask_httpauth.py*
%{python2_sitelib}/Flask_HTTPAuth-%{version}-py?.?.egg-info
%files -n python-%{pkg_name}-doc
%license LICENSE
%doc build/sphinx/html
%if 0%{?with_python3}
%files -n python3-%{pkg_name}
%license LICENSE
%doc README.md
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/flask_httpauth.py
%{python3_sitelib}/Flask_HTTPAuth-%{version}-py?.?.egg-info
%endif # with_python3
%changelog
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jan 18 2018 Iryna Shcherbina <ishcherb@redhat.com> - 3.2.3-4
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Sep 15 2017 Javier Peña <jpena@redhat.com> - 3.2.3-3
- Fix provides for python2 and python3 subpackages
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Mon Jun 05 2017 Javier Peña <jpena@redhat.com> - 3.2.3-1
- Updated to upstream version 3.2.3
- Added %check, doc and test subpackages
* Tue May 16 2017 Javier Peña <jpena@redhat.com> - 3.2.2-1
- Initial package.