File python-setuptools_trial.spec of Package python-setuptools_trial

%if 0%{?rhel} >= 9 || 0%{?fedora} >= 33
%bcond_with python2
%else
%bcond_without python2
%endif

%global libname setuptools_trial

Name:           python-%{libname}
Version:        0.6.0
Release:        1%{?dist}
Summary:        Setuptools plugin that makes unit tests execute with trial instead of pyunit

Group:          Development/Languages
License:        BSD
URL:            http://allmydata.org/trac/setuptools_trial
Source0:        https://pypi.python.org/packages/source/s/%{libname}/%{libname}-%{version}.tar.gz

BuildArch:      noarch
%if %{with python2}
BuildRequires:  python2-devel, python2-twisted, python2-setuptools
%endif
BuildRequires:  python3-devel, python3-twisted, python3-setuptools

%description
Setuptools plugin that makes unit tests execute with trial instead of pyunit

%if %{with python2}
BuildRequires:  python2-devel, python2-twisted, python2-setuptools
%package -n     python2-%{libname}
Summary:        Setuptools plugin that makes unit tests execute with trial instead of pyunit
Requires:       python2-twisted, python2-setuptools, python2-pathlib2
%{?python_provide:%python_provide python2-%{libname}}

%description -n python2-%{libname}
Setuptools plugin that makes unit tests execute with trial instead of pyunit

%endif

%package -n     python3-%{libname}
Summary:        Setuptools plugin that makes unit tests execute with trial instead of pyunit
Requires:       python3-twisted, python3-setuptools, python3-pathlib2
%{?python_provide:%python_provide python3-%{libname}}

%description -n python3-%{libname}
Setuptools plugin that makes unit tests execute with trial instead of pyunit

%prep
%setup -q -n %{libname}-%{version}


%build
%if %{with python2}
%py2_build
%endif
%py3_build


%install
%py3_install
%if %{with python2}
%py2_install
%endif
rm -rf %{buildroot}%{_docdir}


%if %{with python2}
%files -n python2-%{libname}
%defattr(-,root,root,-)
%doc README.rst COPYING.SPL.txt
%{python2_sitelib}/%{libname}
%{python2_sitelib}/%{libname}-%{version}-*egg-info
%endif

%files -n python3-%{libname}
%defattr(-,root,root,-)
%doc README.rst COPYING.SPL.txt
%{python3_sitelib}/%{libname}
%{python3_sitelib}/%{libname}-%{version}-*egg-info