Blob Blame History Raw
%global pypiname pluggy

%{!?__python2:%global __python2 %{__python}}
%{!?python2_sitelib:   %global python2_sitelib  %{python_sitelib}}
%{!?python2_sitearch:  %global python2_sitearch %{python_sitearch}}
%{!?python2_version:   %global python2_version  %{python_version}}

%if 0%{?fedora}
%global with_python3 1
%else
%global with_python3 0
%endif

Name:           python-pluggy
Version:        0.3.1
Release:        4%{?dist}
Summary:        The plugin manager stripped of pytest specific details

License:        MIT
URL:            https://github.com/hpk42/pluggy
Source0:        http://pypi.python.org/packages/source/p/%{pypiname}/%{pypiname}-%{version}.tar.gz


BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  pytest
BuildRequires:  python-setuptools
%if 0%{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-pytest
BuildRequires:  python3-setuptools
%endif # with python3

%description
The plugin manager stripped of pytest specific details.

%if 0%{?with_python3}
%package -n python3-%{pypiname}
Summary:  The plugin manager stripped of pytest specific details.

%description -n python3-%{pypiname}
The plugin manager stripped of pytest specific details.

%endif # with python3


%prep
%setup -qc
mv %{pypiname}-%{version} python2

pushd python2
cp -a LICENSE ..
cp -a README.rst ..

rm -rf {pypiname}.egg-info
popd

%if 0%{?with_python3}
cp -a python2 python3
%endif # with python3


%build
pushd python2
%{__python2} setup.py build
popd

%if 0%{?with_python3}
pushd python3
%{__python3} setup.py build
popd
%endif # with python3


%install
%if 0%{?with_python3}
pushd python3
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
popd
%endif # with python3

pushd python2
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
popd


%check
pushd python2
export PYTHONPATH=.:$PYTHONPATH
py.test testing/test_pluggy.py
popd

%if 0%{?with_python3}
pushd python3
py.test-%{python3_version} testing/test_pluggy.py
popd
%endif


%files
%doc README.rst
%license LICENSE
%{python2_sitelib}/%{pypiname}.py
%{python2_sitelib}/%{pypiname}.pyc
%{python2_sitelib}/%{pypiname}.pyo
%{python2_sitelib}/%{pypiname}-%{version}-py%{python2_version}.egg-info


%if 0%{?with_python3}
%files -n python3-%{pypiname}
%{python3_sitelib}/%{pypiname}.py
%{python3_sitelib}/__pycache__/%{pypiname}.cpython-%{python3_version_nodots}*.pyc
%{python3_sitelib}/%{pypiname}-%{version}-py%{python3_version}.egg-info
%doc README.rst
%license LICENSE
%endif # with python3


%changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Nov 16 2015 Matthias Runge <mrunge@redhat.com> - 0.3.1-3
- make tests pass again on Python 3.5

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Mon Sep 21 2015 Matthias Runge <mrunge@redhat.com> - 0.3.1-1
- update to 0.3.1

* Tue Aug 25 2015 Matthias Runge <mrunge@redhat.com> - 0.3.0-3
- fix python3 builds

* Fri Aug 21 2015 Matthias Runge <mrunge@redhat.com> - 0.3.0-2
- add python2_sitelib macros and BR to setuptools (rhbz#1254484)

* Fri Aug 14 2015 Matthias Runge <mrunge@redhat.com> - 0.3.0-1
- version based on the inital proposal of Adam Young