%global modname pytaglib
Name: python-%{modname}
Version: 1.4.3
Release: 3%{?dist}
Summary: Python audio metadata ("tagging") library based on TagLib
License: GPLv3+
URL: https://github.com/supermihi/pytaglib
Source0: %{url}/archive/v%{version}/%{modname}-%{version}.tar.gz
BuildRequires: gcc-c++
BuildRequires: taglib-devel
%global _description \
pytaglib is a full-featured, easy-to-use, cross-platform audio metadata\
(“tag”) library for Python (all versions supported). It uses the popular,\
fast and rock-solid TagLib C++ library internally.\
\
pytaglib is a very thin wrapper about TagLib (<150 lines of code), meaning\
that you immediately profit from the underlying library’s speed and stability.
%description %{_description}
%package -n python2-%{modname}
Summary: %{summary}
%{?python_provide:%python_provide python2-%{modname}}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-Cython
%description -n python2-%{modname} %{_description}
Python 2 version.
%package -n python3-%{modname}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{modname}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-Cython
%description -n python3-%{modname} %{_description}
Python 3 version.
%prep
%autosetup -n %{modname}-%{version}
# Remove pre-generated source
rm -vf src/taglib.cpp
# remove useless shebang
sed -i -e '1{\@^#!/usr/bin/env python@d}' src/pyprinttags.py
%build
%py2_build "--cython"
%py3_build "--cython"
%install
%py2_install
%py3_install
# Not interested in having 2 binaries doing same thing
mv -f %{buildroot}%{_bindir}/pyprinttags{3,}
%check
export LC_ALL=C.UTF-8
%{__python2} setup.py test
%{__python3} setup.py test
%files -n python2-%{modname}
%license COPYING
%doc README.md CHANGELOG.md
%{python2_sitearch}/%{modname}-*.egg-info/
%{python2_sitearch}/taglib.so
%{python2_sitearch}/pyprinttags.py*
%files -n python3-%{modname}
%license COPYING
%doc README.md CHANGELOG.md
%{_bindir}/pyprinttags
%{python3_sitearch}/%{modname}-*.egg-info/
%{python3_sitearch}/taglib.*.so
%{python3_sitearch}/pyprinttags.py
%{python3_sitearch}/__pycache__/pyprinttags.*
%changelog
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.4.3-2
- Rebuilt for Python 3.7
* Sun Mar 11 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.4.3-1
- Update to 1.4.3
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jan 18 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.4.2-1
- Update to 1.4.2
* Sat Sep 30 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.4.1-1
- Update to 1.4.1
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Sat Dec 31 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.4.0-1
- Initial package