%global upstream_name pykrb5
%global module_name krb5

Name: python-%{upstream_name}
Version: 0.3.0
Release: 1%{?dist}
Summary: Python library providing wrapping functions for the Kerberos 5 C API
License: MIT
URL: https://github.com/jborean93/pykrb5

Source0: %{url}/archive/v%{version}/%{upstream_name}-%{version}.tar.gz

BuildRequires: python3-devel
BuildRequires: python3-Cython
BuildRequires: python3-wheel
BuildRequires: python3-k5test
BuildRequires: gcc

%global _description %{expand:
This library provides Python functions that wraps the Kerberos 5 C API. Due to
the complex nature of this API it is highly recommended to use something like
python-gssapi which exposes the Kerberos authentication details through GSSAPI.}

%description %_description

%package -n python3-%{upstream_name}
Summary: %{summary}

%description -n python3-%{upstream_name} %_description

%prep
%autosetup -p1 -n %{upstream_name}-%{version}

%generate_buildrequires
%pyproject_buildrequires -t

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files %{module_name}

%check
%tox

%files -n python3-%{upstream_name}
%{python3_sitearch}/%{module_name}/
%{python3_sitearch}/%{module_name}-%{version}.dist-info/
%license LICENSE
%doc README.md CHANGELOG.md

%changelog
* Tue Jun 21 2022 Julien Rische <jrische@redhat.com> - 0.3.0-1
- Initial package release