%global pypi_name ruamel.std.pathlib %global pname ruamel-std-pathlib %global commit 79fff2a1baf7 %bcond_without python3 Name: python-%{pname} Version: 0.6.3 Release: 3%{?dist} Summary: An improvement over the standard pathlib module and pathlib2 package License: MIT URL: https://bitbucket.org/ruamel/std.pathlib #Source0: https://files.pythonhosted.org/packages/source/r/%%{pypi_name}/%%{pypi_name}-%%{version}.tar.gz # Use bitbucket sources so we can run the tests Source0: https://bitbucket.org/ruamel/std.pathlib/get/%{version}.tar.gz#/%{pname}-%{version}.tar.gz BuildArch: noarch %description This is a drop-in replacement to extend the Python standard pathlib module. %package -n python2-%{pname} Summary: An improvement over the standard pathlib module and pathlib2 package BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-pathlib2 # For tests BuildRequires: python2-pytest %{?python_provide:%python_provide python2-%{pypi_name}} %description -n python2-%{pname} This is a drop-in replacement to extend the Python standard pathlib module. %if %{with python3} %package -n python%{python3_pkgversion}-%{pname} Summary: An improvement over the standard pathlib module and pathlib2 package BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-pathlib2 # For tests BuildRequires: python%{python3_pkgversion}-pytest %{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}} Requires: python%{python3_pkgversion}-setuptools %description -n python%{python3_pkgversion}-%{pname} This is a drop-in replacement to extend the Python standard pathlib module. %endif %prep %autosetup -n ruamel-std.pathlib-%{commit} -p1 rm -rf %{pypi_name}.egg-info %build %py2_build %if %{with python3} %py3_build %endif %install RUAMEL_NO_PIP_INSTALL_CHECK=1 %py2_install %if %{with python3} RUAMEL_NO_PIP_INSTALL_CHECK=1 %py3_install %endif %check PYTHONPATH=$PYTHONPATH:%{buildroot}%{python2_sitelib} py.test-2 %if %{with python3} PYTHONPATH=$PYTHONPATH:%{buildroot}%{python3_sitelib} py.test-3 %endif %files -n python2-%{pname} %license LICENSE %doc README.rst %{python2_sitelib}/ruamel/ %{python2_sitelib}/ruamel.std.pathlib-%{version}-py?.?.egg-info/ %{python2_sitelib}/ruamel.std.pathlib-%{version}-py?.?-nspkg.pth %if %{with python3} %files -n python%{python3_pkgversion}-%{pname} %license LICENSE %doc README.rst %{python3_sitelib}/ruamel/ %{python3_sitelib}/ruamel.std.pathlib-%{version}-py?.?.egg-info/ %{python3_sitelib}/ruamel.std.pathlib-%{version}-py?.?-nspkg.pth %endif %changelog * Fri Dec 15 2017 Jared Smith - 0.6.3-3 - Fix use of py2_install and py3_install macros * Fri Dec 15 2017 Jared Smith - 0.6.3-2 - Use py2_install/py3_install macros * Tue Dec 12 2017 Jared Smith - 0.6.3-1 - Initial packaging