481d87c
%global srcname pymediainfo
481d87c
481d87c
%if 0%{?rhel} && 0%{?rhel} <= 7
481d87c
%bcond_with python3
481d87c
%else
481d87c
%bcond_without python3
481d87c
%endif
481d87c
481d87c
Name:           python-%{srcname}
481d87c
Version:        2.2.0
0f913a4
Release:        2%{?dist}
481d87c
Summary:        Python wrapper around the MediaInfo library
481d87c
481d87c
License:        MIT
481d87c
URL:            https://github.com/sbraz/%{srcname}
481d87c
Source0:        %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz
481d87c
481d87c
BuildArch:      noarch
481d87c
481d87c
BuildRequires:  libmediainfo
481d87c
481d87c
%description
481d87c
%{sum}.
481d87c
481d87c
%package     -n python2-%{srcname}
481d87c
Summary:        Python2 wrapper around the MediaInfo library
481d87c
BuildRequires:  python2-devel
481d87c
BuildRequires:  python2-setuptools
481d87c
BuildRequires:  python2-pytest
481d87c
BuildRequires:  python2-pytest-runner
481d87c
Requires:       libmediainfo
481d87c
%{?python_provide:%python_provide python2-%{srcname}}
481d87c
481d87c
%description -n python2-%{srcname}
481d87c
This small package is a Python2 wrapper around the MediaInfo library.
481d87c
481d87c
%if %{with python3}
481d87c
%package     -n python3-%{srcname}
481d87c
Summary:        Python3 wrapper around the MediaInfo library
481d87c
BuildRequires:  python3-devel
481d87c
BuildRequires:  python3-setuptools
481d87c
BuildRequires:  python3-pytest
481d87c
BuildRequires:  python3-pytest-runner
481d87c
Requires:       libmediainfo
481d87c
%{?python_provide:%python_provide python3-%{srcname}}
481d87c
481d87c
%description -n python3-%{srcname}
481d87c
This small package is a Python3 wrapper around the MediaInfo library.
481d87c
%endif # with python3
481d87c
481d87c
481d87c
%prep
481d87c
%autosetup -n %{srcname}-%{version}
481d87c
481d87c
481d87c
%build
481d87c
%py2_build
481d87c
481d87c
%if %{with python3}
481d87c
%py3_build
481d87c
%endif # with python3
481d87c
481d87c
481d87c
%install
481d87c
%if %{with python3}
481d87c
%py3_install
481d87c
%endif # with python3
481d87c
481d87c
%py2_install
481d87c
481d87c
%check
481d87c
export LC_ALL=C.UTF-8
481d87c
PYTEST_ADDOPTS='-k "not test_parse_url"' %{__python2} setup.py test
481d87c
481d87c
%if %{with python3}
481d87c
PYTEST_ADDOPTS='-k "not test_parse_url"' %{__python3} setup.py test
481d87c
%endif
481d87c
481d87c
481d87c
%files -n python2-%{srcname}
481d87c
%license LICENSE
481d87c
%doc AUTHORS README.rst
481d87c
%{python2_sitelib}/%{srcname}*
481d87c
481d87c
%if %{with python3}
481d87c
%files -n python3-%{srcname}
481d87c
%license LICENSE
481d87c
%doc AUTHORS README.rst
481d87c
%{python3_sitelib}/%{srcname}*
481d87c
%endif # with python3
481d87c
481d87c
481d87c
%changelog
0f913a4
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-2
0f913a4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
0f913a4
481d87c
* Thu Nov 16 2017 Vasiliy N. Glazov <vascom2@gmail.com> 2.2.0-1
481d87c
- Initial package