Blame python-argon2-cffi.spec

4ea1f67
%global pypi_name argon2-cffi
4ea1f67
4ea1f67
Name:           python-%{pypi_name}
4bf78e5
Version:        21.1.0
206da99
Release:        %autorelease
4ea1f67
Summary:        The secure Argon2 password hashing algorithm
4ea1f67
4ea1f67
License:        MIT
4ea1f67
URL:            https://argon2-cffi.readthedocs.io/
0aececf
Source0:        %{pypi_source}
855f54e
4ea1f67
BuildRequires:  gcc
0aececf
BuildRequires:  python3-devel >= 3.5
4bf78e5
4ea1f67
BuildRequires:  python3dist(cffi)
4ea1f67
BuildRequires:  python3dist(hypothesis)
4ea1f67
BuildRequires:  python3dist(pytest)
4ea1f67
BuildRequires:  python3dist(setuptools)
4ea1f67
BuildRequires:  python3dist(six)
4ea1f67
BuildRequires:  python3dist(sphinx)
0aececf
BuildRequires:  python3dist(wheel)
4bf78e5
0aececf
BuildRequires:  pkgconfig(libargon2)
4ea1f67
4bf78e5
%global _description %{expand:
4bf78e5
CFFI-based Argon2 Bindings for Python.}
4bf78e5
4bf78e5
%description %_description
0aececf
4ea1f67
4ea1f67
%package -n     python3-%{pypi_name}
4ea1f67
Summary:        %{summary}
4ea1f67
%{?python_provide:%python_provide python3-%{pypi_name}}
855f54e
4bf78e5
%description -n python3-%{pypi_name} %_description
4ea1f67
0aececf
0aececf
%package     -n python-%{pypi_name}-doc
4ea1f67
Summary:        Documentation for argon2-cffi
4bf78e5
BuildRequires:  python3dist(argon2-cffi)
0aececf
4ea1f67
%description -n python-%{pypi_name}-doc
0aececf
Documentation for argon2-cffi.
0aececf
4ea1f67
4ea1f67
%prep
0aececf
%autosetup -n %{pypi_name}-%{version}
4ea1f67
# Remove bundled egg-info
4ea1f67
rm -rf %{pypi_name}.egg-info
855f54e
4ea1f67
# using system libargon
0aececf
rm -r   extras/libargon2/LICENSE \
0aececf
        extras/libargon2/README.md \
0aececf
        docs/license.rst
0aececf
4bf78e5
# Theme error:
4bf78e5
# no theme named 'furo' found (missing theme.conf?)
4bf78e5
sed -i '/html_theme = "furo"/d' \
4bf78e5
    docs/conf.py
4bf78e5
4ea1f67
4ea1f67
%build
4ea1f67
export ARGON2_CFFI_USE_SYSTEM=1
4ea1f67
%py3_build
855f54e
# generate html docs
4ea1f67
PYTHONPATH=${PWD} sphinx-build-3 docs html
855f54e
4ea1f67
# remove the sphinx-build leftovers
4ea1f67
rm -rf html/.{doctrees,buildinfo}
4ea1f67
0aececf
4ea1f67
%install
4ea1f67
%py3_install
4ea1f67
0aececf
4ea1f67
%check
4bf78e5
%pytest
4ea1f67
4ea1f67
4ea1f67
%files -n python3-%{pypi_name}
855f54e
%license LICENSE
4ea1f67
%doc README.rst
0aececf
%{python3_sitearch}/argon2/
0aececf
%{python3_sitearch}/argon2_cffi-%{version}-py%{python3_version}.egg-info/
4ea1f67
4ea1f67
%files -n python-%{pypi_name}-doc
4ea1f67
%license LICENSE
0aececf
%doc html
4ea1f67
4ea1f67
4ea1f67
%changelog
206da99
%autochangelog