2826036
%global pypiname pluggy
2826036
2826036
%{!?__python2:%global __python2 %{__python}}
2826036
%{!?python2_sitelib:   %global python2_sitelib  %{python_sitelib}}
2826036
%{!?python2_sitearch:  %global python2_sitearch %{python_sitearch}}
2826036
%{!?python2_version:   %global python2_version  %{python_version}}
2826036
2826036
%if 0%{?fedora}
2826036
%global with_python3 1
2826036
%else
2826036
%global with_python3 0
2826036
%endif
2826036
2826036
Name:           python-pluggy
2826036
Version:        0.3.0
95bc8ec
Release:        3%{?dist}
2826036
Summary:        The plugin manager stripped of pytest specific details
2826036
2826036
License:        MIT
2826036
URL:            https://github.com/hpk42/pluggy
2826036
Source0:        http://pypi.python.org/packages/source/t/%{pypiname}/%{pypiname}-%{version}.tar.gz
2826036
2826036
2826036
BuildArch:      noarch
2826036
BuildRequires:  python2-devel
2826036
BuildRequires:  pytest
2826036
BuildRequires:  python-setuptools
95bc8ec
%if 0%{?with_python3}
2826036
BuildRequires:  python3-devel
2826036
BuildRequires:  python3-pytest
2826036
BuildRequires:  python3-setuptools
2826036
%endif # with python3
2826036
2826036
%description
2826036
The plugin manager stripped of pytest specific details.
2826036
2826036
%if 0%{?with_python3}
2826036
%package -n python3-%{pypiname}
2826036
Summary:  The plugin manager stripped of pytest specific details.
2826036
2826036
%description -n python3-%{pypiname}
2826036
The plugin manager stripped of pytest specific details.
2826036
2826036
%endif # with python3
2826036
2826036
2826036
%prep
2826036
%setup -qc
2826036
mv %{pypiname}-%{version} python2
2826036
2826036
pushd python2
2826036
cp -a LICENSE ..
2826036
cp -a README.rst ..
2826036
2826036
rm -rf {pypiname}.egg-info
2826036
popd
2826036
2826036
%if 0%{?with_python3}
2826036
cp -a python2 python3
2826036
%endif # with python3
2826036
2826036
2826036
%build
2826036
pushd python2
2826036
%{__python2} setup.py build
2826036
popd
2826036
2826036
%if 0%{?with_python3}
2826036
pushd python3
2826036
%{__python3} setup.py build
2826036
popd
2826036
%endif # with python3
2826036
2826036
2826036
%install
2826036
%if 0%{?with_python3}
2826036
pushd python3
95bc8ec
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
2826036
popd
2826036
%endif # with python3
2826036
2826036
pushd python2
95bc8ec
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
2826036
popd
2826036
2826036
2826036
%check
2826036
pushd python2
2826036
py.test test_pluggy.py
2826036
popd
2826036
2826036
%if 0%{?with_python3}
2826036
pushd python3
2826036
py.test-3.4 test_pluggy.py
2826036
popd
2826036
%endif
2826036
2826036
2826036
%files
95bc8ec
%doc README.rst
95bc8ec
%license LICENSE
95bc8ec
%{python2_sitelib}/%{pypiname}.py
95bc8ec
%{python2_sitelib}/%{pypiname}.pyc
95bc8ec
%{python2_sitelib}/%{pypiname}.pyo
95bc8ec
%{python2_sitelib}/%{pypiname}-%{version}-py%{python2_version}.egg-info
95bc8ec
2826036
2826036
%if 0%{?with_python3}
95bc8ec
%files -n python3-%{pypiname}
2826036
%{python3_sitelib}/%{pypiname}.py
2826036
%{python3_sitelib}/__pycache__/%{pypiname}.cpython-34.pyc
2826036
%{python3_sitelib}/__pycache__/%{pypiname}.cpython-34.pyo
95bc8ec
%{python3_sitelib}/%{pypiname}-%{version}-py%{python3_version}.egg-info
2826036
%doc README.rst
2826036
%license LICENSE
95bc8ec
%endif # with python3
2826036
2826036
2826036
%changelog
95bc8ec
* Tue Aug 25 2015 Matthias Runge <mrunge@redhat.com> - 0.3.0-3
95bc8ec
- fix python3 builds
95bc8ec
2826036
* Fri Aug 21 2015 Matthias Runge <mrunge@redhat.com> - 0.3.0-2
2826036
- add python2_sitelib macros and BR to setuptools (rhbz#1254484)
2826036
2826036
* Fri Aug 14 2015 Matthias Runge <mrunge@redhat.com> - 0.3.0-1
2826036
- version based on the inital proposal of Adam Young