Blob Blame History Raw
%if 0%{?fedora}
%bcond_without python3
%else
# Until dependencies are available in EPEL7
%bcond_with python3
%endif

Name:           python-libdiscid
Version:        0.4.1
Release:        9%{?dist}
Summary:        Python bindings for libdiscid

License:        MIT
URL:            http://pythonhosted.org/python-libdiscid/
Source0:        https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
Patch0:         https://github.com/sebastinas/python-libdiscid/commit/91955e9.patch

BuildRequires:  libdiscid-devel
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  python-sphinx
BuildRequires:  Cython >= 0.15
%if %{with python3}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-Cython >= 0.15
%endif # with python3

%description
python-libdiscid provides Python bindings for libdiscid. libdiscid's
main purpose is the calculation of identifiers for audio discs to use
for the MusicBrainz database.

%package     -n python2-libdiscid
Summary:        Python 2 bindings for libdiscid
%{?python_provide:%python_provide python2-libdiscid}
Obsoletes:      python-libdiscid < 0.4.1-4

%description -n python2-libdiscid
python2-libdiscid provides Python 2 bindings for libdiscid. libdiscid's
main purpose is the calculation of identifiers for audio discs to use
for the MusicBrainz database.

%package     -n python3-libdiscid
Summary:        Python 3 bindings for libdiscid
%{?python_provide:%python_provide python3-libdiscid}

%description -n python3-libdiscid
python3-libdiscid provides Python 3 bindings for libdiscid. libdiscid's
main purpose is the calculation of identifiers for audio discs to use
for the MusicBrainz database.


%prep
%autosetup -p1
rm libdiscid/_discid.c  # rebuilt with system Cython


%build
%py2_build
# Until https://fedorahosted.org/fpc/ticket/557 is fixed
%{__python2} setup.py build_ext -i build_sphinx
rm build/html/.buildinfo
%{?with_python3:%py3_build}


%install
rm -rf $RPM_BUILD_ROOT
%py2_install
%{?with_python3:%py3_install}


%check
%{__python2} setup.py test
%{?with_python3:%{__python3} setup.py test}


%files -n python2-libdiscid
%license LICENSE
%doc changelog PKG-INFO build/html/
%{python2_sitearch}/*libdiscid*/
%exclude %{python2_sitearch}/*libdiscid*/tests/

%if %{with python3}
%files -n python3-libdiscid
%license LICENSE
%doc changelog PKG-INFO build/html/
%{python3_sitearch}/*libdiscid*/
%exclude %{python3_sitearch}/*libdiscid*/tests/
%endif # with python3


%changelog
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.4.1-8
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-7
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Nov  4 2015 Ville Skyttä <ville.skytta@iki.fi> - 0.4.1-5
- Apply upstream fix for Cython >= 0.23

* Thu Aug  6 2015 Ville Skyttä <ville.skytta@iki.fi> - 0.4.1-4
- Spec cleanup per current Python guidelines; Python 2 package is now python2-*

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Mar 11 2015 Ville Skyttä <ville.skytta@iki.fi> - 0.4.1-2
- Build below source dir instead of in %%{py3dir}

* Thu Mar  5 2015 Ville Skyttä <ville.skytta@iki.fi> - 0.4.1-1
- First build