d6e60b7
%global pypi_name Flask-HTTPAuth
d6e60b7
%global pkg_name flask-httpauth
d6e60b7
d6e60b7
%if 0%{?fedora}
d6e60b7
%global with_python3 1
d6e60b7
%endif
d6e60b7
d6e60b7
Name:           python-%{pkg_name}
d6e60b7
Version:        3.2.3
d6e60b7
Release:        1%{?dist}
d6e60b7
Summary:        Basic and Digest HTTP authentication for Flask routes
d6e60b7
d6e60b7
License:        MIT
d6e60b7
URL:            http://github.com/miguelgrinberg/flask-httpauth/
d6e60b7
Source0:        https://files.pythonhosted.org/packages/source/F/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
d6e60b7
BuildArch:      noarch
d6e60b7
d6e60b7
%description
d6e60b7
FlaskHTTPAuth Basic and Digest HTTP authentication for Flask routes.
d6e60b7
d6e60b7
%package -n     python2-%{pkg_name}
d6e60b7
Summary:        Basic and Digest HTTP authentication for Flask routes
d6e60b7
%{?python_provide:%python_provide python2-%{pypi_name}}
d6e60b7
BuildRequires:  python2-devel
d6e60b7
BuildRequires:  python-flask
d6e60b7
BuildRequires:  python-setuptools
d6e60b7
BuildRequires:  python-sphinx
d6e60b7
Requires:       python-flask
d6e60b7
Requires:       python-werkzeug
d6e60b7
d6e60b7
%description -n python2-%{pkg_name}
d6e60b7
FlaskHTTPAuth Basic and Digest HTTP authentication for Flask routes.
d6e60b7
d6e60b7
%package -n     python-%{pkg_name}-doc
d6e60b7
Summary:        Documentation for Flask-HTTPAuth
d6e60b7
d6e60b7
%description -n python-%{pkg_name}-doc
d6e60b7
FlaskHTTPAuth Basic and Digest HTTP authentication for Flask routes.
d6e60b7
d6e60b7
This package provides the documentation.
d6e60b7
d6e60b7
d6e60b7
%if 0%{?with_python3}
d6e60b7
%package -n     python3-%{pkg_name}
d6e60b7
Summary:        Basic and Digest HTTP authentication for Flask routes
d6e60b7
%{?python_provide:%python_provide python3-%{pypi_name}}
d6e60b7
BuildRequires:  python3-devel
d6e60b7
BuildRequires:  python3-flask
d6e60b7
BuildRequires:  python3-setuptools
d6e60b7
BuildRequires:  python3-sphinx
d6e60b7
Requires:       python3-flask
d6e60b7
Requires:       python3-werkzeug
d6e60b7
d6e60b7
%description -n python3-%{pkg_name}
d6e60b7
FlaskHTTPAuth Basic and Digest HTTP authentication for Flask routes.
d6e60b7
%endif # with_python3
d6e60b7
d6e60b7
%prep
d6e60b7
%autosetup -n %{pypi_name}-%{version}
d6e60b7
# Remove bundled egg-info
d6e60b7
rm -rf %{pypi_name}.egg-info
d6e60b7
d6e60b7
%build
d6e60b7
%py2_build
d6e60b7
%if 0%{?with_python3}
d6e60b7
%py3_build
d6e60b7
%endif # with_python3
d6e60b7
# generate html docs
d6e60b7
%{__python2} setup.py build_sphinx
d6e60b7
# remove the sphinx-build leftovers
d6e60b7
rm -rf build/sphinx/html/.{doctrees,buildinfo}
d6e60b7
d6e60b7
d6e60b7
%install
d6e60b7
%if 0%{?with_python3}
d6e60b7
%py3_install
d6e60b7
%endif # with_python3
d6e60b7
%py2_install
d6e60b7
d6e60b7
%check
d6e60b7
%if 0%{?with_python3}
d6e60b7
%{__python3} setup.py test
d6e60b7
%endif # with_python3
d6e60b7
%{__python2} setup.py test
d6e60b7
d6e60b7
%files -n python2-%{pkg_name}
d6e60b7
%license LICENSE
d6e60b7
%doc README.md
d6e60b7
%{python2_sitelib}/flask_httpauth.py*
d6e60b7
%{python2_sitelib}/Flask_HTTPAuth-%{version}-py?.?.egg-info
d6e60b7
d6e60b7
%files -n python-%{pkg_name}-doc
d6e60b7
%license LICENSE
d6e60b7
%doc build/sphinx/html
d6e60b7
d6e60b7
%if 0%{?with_python3}
d6e60b7
%files -n python3-%{pkg_name}
d6e60b7
%license LICENSE
d6e60b7
%doc README.md
d6e60b7
%{python3_sitelib}/__pycache__/*
d6e60b7
%{python3_sitelib}/flask_httpauth.py
d6e60b7
%{python3_sitelib}/Flask_HTTPAuth-%{version}-py?.?.egg-info
d6e60b7
%endif # with_python3
d6e60b7
d6e60b7
%changelog
d6e60b7
* Mon Jun 05 2017 Javier Peña <jpena@redhat.com> - 3.2.3-1
d6e60b7
- Updated to upstream version 3.2.3
d6e60b7
- Added %check, doc and test subpackages
d6e60b7
* Tue May 16 2017 Javier Peña <jpena@redhat.com> - 3.2.2-1
d6e60b7
- Initial package.