Blob Blame History Raw
%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:        4%{?dist}
Summary:        Script to submit ISRCs from disc to MusicBrainz

License:        GPLv3+
URL:            http://jonnyjd.github.io/musicbrainz-isrcsubmit/
Source0:        http://isrcsubmit.jonnyjd.net/downloads/%{name}-%{version}.tar.gz
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
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
MusicBrainz. Features: read and submit ISRCs from disc, search for
releases with the TOC of the disc, submit discIds / TOCs, display
release information from MusicBrainz, duplicate ISRC detection (local
and on server), keyring support for login information.


%prep
%autosetup


%build
%if %{with python3}
%py3_build
%else
%py2_build
%endif


%install
rm -rf $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
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
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Dec  4 2015 Ville Skyttä <ville.skytta@iki.fi> - 2.0.1-3
- Use Python 3 on F-23+

* Mon Jun 29 2015 Ville Skyttä <ville.skytta@iki.fi> - 2.0.1-2
- Do not try to download any packages during build

* Tue Jun 16 2015 Ville Skyttä <ville.skytta@iki.fi> - 2.0.1-1
- Update to 2.0.1

* Sun Apr 19 2015 Ville Skyttä <ville.skytta@iki.fi> - 2.0.0-2
- Add man page, fix and run test suite (#1210941)

* Sat Apr 11 2015 Ville Skyttä <ville.skytta@iki.fi> - 2.0.0-1
- First build