From 9f93e996a6e2180eccb3d27be1ecc4665a1de5da Mon Sep 17 00:00:00 2001 From: Ville Skyttä Date: Dec 04 2015 16:51:38 +0000 Subject: Use Python 3 on F-23+ --- diff --git a/isrcsubmit.spec b/isrcsubmit.spec index 27e2d0e..125d03e 100644 --- a/isrcsubmit.spec +++ b/isrcsubmit.spec @@ -1,8 +1,13 @@ -# TODO: switch to python3 once musicbrainzngs is available for it (#1210937) +%if 0%{?fedora} < 23 +%bcond_with python3 +%else +%bcond_without python3 +%endif +%{!?python3_pkgversion: %global python3_pkgversion 3} Name: isrcsubmit Version: 2.0.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Script to submit ISRCs from disc to MusicBrainz License: GPLv3+ @@ -11,6 +16,15 @@ Source0: http://isrcsubmit.jonnyjd.net/downloads/%{name}-%{version}.tar.g Patch0: %{name}-2.0.1-no-setup-requires.patch BuildArch: noarch +%if %{with python3} +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-libdiscid +BuildRequires: python%{python3_pkgversion}-musicbrainzngs +BuildRequires: python%{python3_pkgversion}-sphinx +Requires: python%{python3_pkgversion}-libdiscid +Requires: python%{python3_pkgversion}-musicbrainzngs +Requires: python%{python3_pkgversion}-keyring +%else BuildRequires: python2-devel BuildRequires: python-libdiscid BuildRequires: python-musicbrainzngs @@ -18,6 +32,7 @@ BuildRequires: python-sphinx Requires: python-libdiscid Requires: python-musicbrainzngs Requires: python-keyring +%endif %description This python script extracts ISRCs from audio cds and submits them to @@ -32,30 +47,50 @@ and on server), keyring support for login information. %build -%{__python2} setup.py build +%if %{with python3} +%py3_build +%else +%py2_build +%endif %install rm -rf $RPM_BUILD_ROOT -%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%if %{with python3} +%py3_install +%else +%py2_install +%endif %check # sys.stdin.encoding can be None in mock, hence override with PYTHONIOENCODING -PYTHONIOENCODING=UTF-8 %{__python2} setup.py test +export PYTHONIOENCODING=UTF-8 +%if %{with python3} +%{__python3} setup.py test +%else +%{__python2} setup.py test +%endif %files %license COPYING %doc AUTHORS CHANGES.markdown README.rst %{_bindir}/isrcsubmit.py +%if %{with python3} +%{python3_sitelib}/%{name}-%{version}* +%else %{python2_sitelib}/%{name}-%{version}* +%endif %{_mandir}/man1/isrcsubmit.1* %{_mandir}/man5/isrcsubmit-config.5* %changelog +* Fri Dec 4 2015 Ville Skyttä - 2.0.1-3 +- Use Python 3 on F-23+ + * Mon Jun 29 2015 Ville Skyttä - 2.0.1-2 - Do not try to download any packages during build