diff --git a/python-mutagen.spec b/python-mutagen.spec index 3326f39..3faecc0 100644 --- a/python-mutagen.spec +++ b/python-mutagen.spec @@ -1,8 +1,14 @@ %global realname mutagen +%if 0%{?fedora} +%bcond_without python3 +%else +%bcond_with python3 +%endif + Name: python-%{realname} Version: 1.27 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Mutagen is a Python module to handle audio meta-data Group: Development/Languages @@ -12,6 +18,9 @@ Source0: https://bitbucket.org/lazka/mutagen/downloads/mutagen-%{version} BuildArch: noarch BuildRequires: python2-devel +%if %{with python3} +BuildRequires: python3-devel +%endif %description Mutagen is a Python module to handle audio meta-data. It supports @@ -21,20 +30,55 @@ comments. It can also read MPEG audio and Xing headers, FLAC stream info blocks, and Ogg Vorbis/FLAC/Theora stream headers. Finally, it includes a module to handle generic Ogg bit-streams. +%if %{with python3} +%package -n python3-%{realname} +Summary: Mutagen is a Python module to handle audio meta-data + +%description -n python3-%{realname} +Mutagen is a Python module to handle audio meta-data. It supports +reading ID3 (all versions), APEv2, FLAC, and Ogg Vorbis/FLAC/Theora. +It can write ID3v1.1, ID3v2.4, APEv2, FLAC, and Ogg Vorbis/FLAC/Theora +comments. It can also read MPEG audio and Xing headers, FLAC stream +info blocks, and Ogg Vorbis/FLAC/Theora stream headers. Finally, it +includes a module to handle generic Ogg bit-streams. +%endif + %prep %setup -q -n %{realname}-%{version} +%if %{with python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif + %build %{__python} setup.py build +%if %{with python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif + %install %{__python} setup.py install -O1 --skip-build --root %{buildroot} %{__install} -d %{buildroot}%{_mandir}/man1 %{__install} -p -m 0644 man/*.1 %{buildroot}%{_mandir}/man1 +%if %{with python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root %{buildroot} +popd +%endif + %check %{__python} setup.py test +%if %{with python3} +pushd %{py3dir} +%{__python3} setup.py test +%endif + %files %defattr(-,root,root,-) %doc COPYING NEWS README.rst docs/tutorial.rst docs/api_notes.rst docs/bugs.rst @@ -43,7 +87,17 @@ includes a module to handle generic Ogg bit-streams. %{python_sitelib}/%{realname} %{python_sitelib}/%{realname}-%{version}-*.egg-info +%if %{with python3} +%files -n python3-%{realname} +%doc COPYING NEWS README.rst docs/tutorial.rst docs/api_notes.rst docs/bugs.rst +%{python3_sitelib}/%{realname} +%{python3_sitelib}/%{realname}*.egg-info +%endif + %changelog +* Sun Mar 01 2015 Michele Baldessari - 1.27-2 +- Add initial Python 3 support on Fedora + * Mon Dec 15 2014 Michele Baldessari - 1.27-1 - New upstream release - Only use macro style for buildroot