%global mod_name python-xz
%global mod_version 0.4.0
%global srcname xz
%global pypi_source https://files.pythonhosted.org/packages/fe/2f/7ed0c25005eba0efb1cea3cdf4a325852d63167cc77f96b0a0534d19e712/python-xz-0.4.0.tar.gz

Name:           python-%{srcname}
Version:        %{mod_version}
Release:        1%{?dist}
Summary:        Pure Python implementation of the XZ file format with random access support

License:        MIT
URL:            https://github.com/rogdham/python-xz
Source0:        %{pypi_source}
BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3dist(setuptools)
BuildRequires:  python3dist(setuptools-scm)
BuildRequires:  python3dist(wheel)

%description
Pure Python implementation of the XZ file format
with random access support

Leveraging the lzma module for fast (de)compression


%package -n     python3-%{srcname}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}
Pure Python implementation of the XZ file format
with random access support

Leveraging the lzma module for fast (de)compression


%prep
%autosetup -n %{mod_name}-%{mod_version}
# Remove bundled egg-info
rm -rf %{mod_name}.egg-info

%build
%py3_build

%install
%py3_install

%check
%{__python3} setup.py test

%files -n python3-%{srcname}
%license LICENSE.txt
%doc README.md tests/integration/test_readme.py
%{python3_sitelib}/xz
%{python3_sitelib}/python_xz-%{mod_version}-py%{python3_version}.egg-info

%changelog
* Wed Nov 30 2022 Josh Lay - 0.4.0-1
- Initial package.
