%global _srcname     mediafile
%global _description %{expand:
MediaFile is a simple interface to the metadata tags for many audio file
formats. It wraps Mutagen, a high-quality library for low-level tag
manipulation, with a high-level, format-independent interface for a
common set of tags.}

Name:           python-%{_srcname}
Version:        0.9.0
Release:        1%{?dist}
Summary:        Read and write audio files' tags in Python

License:        MIT
URL:            https://github.com/beetbox/%{_srcname}
Source0:        https://github.com/beetbox/%{_srcname}/archive/refs/tags/v%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-flit-core

%description
%{_description}

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

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

%prep
%autosetup -n %{_srcname}-%{version}

%generate_buildrequires
%pyproject_buildrequires -t

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files mediafile

%check
%tox

%files -n python3-%{_srcname} -f %{pyproject_files}
%license LICENSE
%doc README.rst

%changelog
* Wed Jul 20 2022 Alexandre Beloin <alexandre.beloin@gmail.com> - 0.9.0-1
- Initial release