e00695d
# Created by pyp2rpm-1.0.1
e00695d
%global pypi_name cov-core
e00695d
%global with_python3 1
e00695d
e00695d
Name:           python-%{pypi_name}
e00695d
Version:        1.7
303d098
Release:        2%{?dist}
e00695d
Summary:        Plugin core for use by pytest-cov, nose-cov and nose2-cov
e00695d
e00695d
License:        MIT
e00695d
URL:            http://bitbucket.org/memedough/cov-core/overview
e00695d
Source0:        https://pypi.python.org/packages/source/c/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
e00695d
BuildArch:      noarch
e00695d
 
e00695d
BuildRequires:  python2-devel
303d098
BuildRequires:  python-setuptools
e00695d
 
e00695d
%if %{?with_python3}
e00695d
BuildRequires:  python3-devel
303d098
BuildRequires:  python3-setuptools
e00695d
%endif # if with_python3
e00695d
 
e00695d
Requires:       python-coverage >= 3.4
e00695d
e00695d
%description
e00695d
This is a lib package for use by pytest-cov, nose-cov and nose2-cov. If
e00695d
you're developing a coverage plugin for a test framework then you probably
e00695d
want one of those.
e00695d
e00695d
%if 0%{?with_python3}
e00695d
%package -n     python3-%{pypi_name}
e00695d
Summary:        Plugin core for use by pytest-cov, nose-cov and nose2-cov
e00695d
 
e00695d
Requires:       python3-coverage >= 3.4
e00695d
e00695d
%description -n python3-%{pypi_name}
e00695d
This is a lib package for use by pytest-cov, nose-cov and nose2-cov. If
e00695d
you're developing a coverage plugin for a test framework then you probably
e00695d
want one of those.
e00695d
%endif # with_python3
e00695d
e00695d
e00695d
%prep
e00695d
%setup -q -n %{pypi_name}-%{version}
e00695d
# Remove bundled egg-info
e00695d
rm -rf %{pypi_name}.egg-info
e00695d
e00695d
%if 0%{?with_python3}
e00695d
rm -rf %{py3dir}
e00695d
cp -a . %{py3dir}
e00695d
%endif # with_python3
e00695d
e00695d
%build
e00695d
%{__python2} setup.py build
e00695d
e00695d
%if 0%{?with_python3}
e00695d
pushd %{py3dir}
e00695d
%{__python3} setup.py build
e00695d
popd
e00695d
%endif # with_python3
e00695d
e00695d
%install
e00695d
# Must do the subpackages' install first because the scripts in /usr/bin are
e00695d
# overwritten with every setup.py install (and we want the python2 version
e00695d
# to be the default for now).
e00695d
%if 0%{?with_python3}
e00695d
pushd %{py3dir}
e00695d
%{__python3} setup.py install --skip-build --root %{buildroot}
e00695d
popd
e00695d
%endif # with_python3
e00695d
e00695d
%{__python2} setup.py install --skip-build --root %{buildroot}
e00695d
e00695d
%files
e00695d
%doc README.txt LICENSE.txt
e00695d
%{python2_sitelib}/cov_core*
e00695d
e00695d
%if 0%{?with_python3}
e00695d
%files -n python3-%{pypi_name}
e00695d
%doc README.txt LICENSE.txt
e00695d
%{python3_sitelib}/cov_core*
e00695d
%{python3_sitelib}/__pycache__/*
e00695d
%endif # with_python3
e00695d
e00695d
%changelog
303d098
* Mon Sep 16 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 1.7-2
303d098
- Add BR: python-setuptools.
303d098
e00695d
* Thu Sep 05 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 1.7-1
e00695d
- Initial package.