%global modname pathlib2 %global pkgname pathlib2 Name: python-%{pkgname} Version: 2.3.3 Release: 1%{?dist} Summary: pathlib backport License: MIT URL: https://pypi.io/project/%{pkgname} Source0: %pypi_source %{modname} Patch0: pathlib2_setup_workaround.patch BuildArch: noarch BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-pytest BuildRequires: python2-scandir BuildRequires: python2-six BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-scandir BuildRequires: python%{python3_pkgversion}-six %global _description\ The old pathlib module on bitbucket is in bugfix-only mode. The goal\ of pathlib2 is to provide a backport of standard pathlib module which\ tracks the standard library module, so all the newest features of the\ standard pathlib can be used also on older Python versions. %description %_description %package -n python2-%{pkgname} Summary: %summary Requires: python2-scandir Requires: python2-six %{?python_provide:%python_provide python2-%{pkgname}} %description -n python2-%{pkgname} %_description %package -n python%{python3_pkgversion}-%{pkgname} Summary: %summary Requires: python%{python3_pkgversion}-scandir Requires: python%{python3_pkgversion}-six %{?python_provide:%python_provide python%{python3_pkgversion}-%{pkgname}} %description -n python%{python3_pkgversion}-%{pkgname} %_description %prep %autosetup -p1 -n %{modname}-%{version} rm -rf %{py3dir} cp -a . %{py3dir} %build %{__python2} setup.py build pushd %{py3dir} %{__python3} setup.py build popd %install install -d -m 0755 %{buildroot}%{_mandir}/man1 pushd %{py3dir} %{__python3} setup.py install --skip-build --root=%{buildroot} popd %{__python2} setup.py install -O1 --skip-build --root=%{buildroot} %check %{__python2} setup.py test %{__python3} setup.py test %files -n python2-%{pkgname} %doc README.rst LICENSE.rst %{python2_sitelib}/%{pkgname}/ %{python2_sitelib}/%{pkgname}-%{version}* %files -n python%{python3_pkgversion}-%{pkgname} %doc README.rst LICENSE.rst %{python3_sitelib}/%{pkgname}/ %{python3_sitelib}/%{pkgname}-%{version}-* %changelog * Wed Apr 10 2019 Marc Dequènes (Duck) - 2.3.3-1 - Initial release