d9915f8
%global modname pytaglib
d9915f8
d9915f8
Name:           python-%{modname}
d9915f8
Version:        1.4.0
d9915f8
Release:        1%{?dist}
d9915f8
Summary:        Python audio metadata ("tagging") library based on TagLib
d9915f8
d9915f8
License:        GPLv3+
d9915f8
URL:            https://github.com/supermihi/pytaglib
d9915f8
Source0:        %{url}/archive/v%{version}/%{modname}-%{version}.tar.gz
d9915f8
d9915f8
BuildRequires:  gcc-c++
d9915f8
BuildRequires:  taglib-devel
d9915f8
d9915f8
%global _description \
d9915f8
pytaglib is a full-featured, easy-to-use, cross-platform audio metadata\
d9915f8
(“tag”) library for Python (all versions supported). It uses the popular,\
d9915f8
fast and rock-solid TagLib C++ library internally.\
d9915f8
\
d9915f8
pytaglib is a very thin wrapper about TagLib (<150 lines of code), meaning\
d9915f8
that you immediately profit from the underlying library’s speed and stability.
d9915f8
d9915f8
%description %{_description}
d9915f8
d9915f8
%package -n python2-%{modname}
d9915f8
Summary:        %{summary}
d9915f8
%{?python_provide:%python_provide python2-%{modname}}
d9915f8
BuildRequires:  python2-devel
d9915f8
BuildRequires:  python2-setuptools
d9915f8
BuildRequires:  python2-Cython
d9915f8
d9915f8
%description -n python2-%{modname} %{_description}
d9915f8
d9915f8
Python 2 version.
d9915f8
d9915f8
%package -n python3-%{modname}
d9915f8
Summary:        %{summary}
d9915f8
%{?python_provide:%python_provide python3-%{modname}}
d9915f8
BuildRequires:  python3-devel
d9915f8
BuildRequires:  python3-setuptools
d9915f8
BuildRequires:  python3-Cython
d9915f8
d9915f8
%description -n python3-%{modname} %{_description}
d9915f8
d9915f8
Python 3 version.
d9915f8
d9915f8
%prep
d9915f8
%autosetup -n %{modname}-%{version}
d9915f8
# Remove pre-generated source
d9915f8
rm -vf src/taglib.cpp
d9915f8
# remove useless shebang
d9915f8
sed -i -e '1{\@^#!/usr/bin/env python@d}' src/pyprinttags.py
d9915f8
d9915f8
%build
d9915f8
%py2_build "--cython"
d9915f8
%py3_build "--cython"
d9915f8
d9915f8
%install
d9915f8
%py2_install
d9915f8
%py3_install
d9915f8
# Not interested in having 2 binaries doing same thing
d9915f8
mv -f %{buildroot}%{_bindir}/pyprinttags{3,}
d9915f8
d9915f8
%check
d9915f8
export LC_ALL=C.UTF-8
d9915f8
%{__python2} setup.py test
d9915f8
%{__python3} setup.py test
d9915f8
d9915f8
%files -n python2-%{modname}
d9915f8
%license COPYING
d9915f8
%doc README.md NEWS
d9915f8
%{python2_sitearch}/%{modname}-*.egg-info/
d9915f8
%{python2_sitearch}/taglib.so
d9915f8
%{python2_sitearch}/pyprinttags.py*
d9915f8
d9915f8
%files -n python3-%{modname}
d9915f8
%license COPYING
d9915f8
%doc README.md NEWS
d9915f8
%{_bindir}/pyprinttags
d9915f8
%{python3_sitearch}/%{modname}-*.egg-info/
d9915f8
%{python3_sitearch}/taglib.*.so
d9915f8
%{python3_sitearch}/pyprinttags.py
d9915f8
%{python3_sitearch}/__pycache__/pyprinttags.*
d9915f8
d9915f8
%changelog
d9915f8
* Sat Dec 31 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.4.0-1
d9915f8
- Initial package