%global pypi_name pymacaroons %global pypi_version 0.13.0 Name: python-%{pypi_name} Version: %{pypi_version} Release: %mkrel 1 Summary: Macaroon library for Python Group: Development/Python License: MIT URL: https://github.com/ecordell/pymacaroons Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{pypi_version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(setuptools) BuildRequires: python3dist(sphinx) %description PyMacaroons is a Python implementation of Macaroons. %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} Requires: python3dist(pynacl) < 2~~ Requires: python3dist(pynacl) >= 1.1.2 Requires: python3dist(six) >= 1.8 %description -n python3-%{pypi_name} PyMacaroons is a Python implementation of Macaroons. %package -n python-%{pypi_name}-doc Summary: pymacaroons documentation %description -n python-%{pypi_name}-doc Documentation for pymacaroons %prep %autosetup -n %{pypi_name}-%{pypi_version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py3_build # generate html docs PYTHONPATH=${PWD} sphinx-build-3 docs html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %install %py3_install %files -n python3-%{pypi_name} %license LICENSE %doc README.md %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{pypi_version}-py%{python3_version}.egg-info %files -n python-%{pypi_name}-doc %doc html %license LICENSE