diff --git a/fasteners-monotonic.patch b/fasteners-monotonic.patch new file mode 100644 index 0000000..c12d450 --- /dev/null +++ b/fasteners-monotonic.patch @@ -0,0 +1,16 @@ +diff --git a/fasteners/_utils.py b/fasteners/_utils.py +index c5418d7..e0eff38 100644 +--- a/fasteners/_utils.py ++++ b/fasteners/_utils.py +@@ -19,7 +19,10 @@ + import logging + import time + +-from monotonic import monotonic as now # noqa ++try: ++ from time import monotonic as now ++except ImportError: ++ from monotonic import monotonic as now + + # log level for low-level debugging + BLATHER = 5 diff --git a/python-fasteners.spec b/python-fasteners.spec index 1cdcf6a..7a6a696 100644 --- a/python-fasteners.spec +++ b/python-fasteners.spec @@ -6,12 +6,13 @@ Name: python-%{pypi_name} Version: 0.14.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A python package that provides useful locks License: ASL 2.0 URL: https://github.com/harlowja/fasteners Source0: https://codeload.github.com/harlowja/fasteners/tar.gz/%{version}#/%{pypi_name}-%{version}.tar.gz +Patch0: fasteners-monotonic.patch BuildArch: noarch @@ -56,41 +57,20 @@ A python package that provides useful locks. %prep -%setup -qc -mv %{pypi_name}-%{version} python2 -pushd python2 - -# copy LICENSE etc. to top level dir -cp -a LICENSE .. -cp -a README.rst .. - -popd - -%if 0%{?with_python3} -cp -a python2 python3 -%endif +%autosetup -p1 -n %{pypi_name}-%{version} %build -pushd python2 -%{__python2} setup.py build -popd +%py2_build %if 0%{?with_python3} -pushd python3 -%{__python3} setup.py build -popd +%py3_build %endif # with_python3 %install -pushd python2 -%{__python2} setup.py install --skip-build --root %{buildroot} -popd - +%py2_install %if 0%{?with_python3} -pushd python3 -%{__python3} setup.py install --skip-build --root %{buildroot} -popd +%py3_install %endif # with_python3 %check @@ -116,6 +96,11 @@ nosetests-%{python3_version} %changelog +* Mon Aug 29 2016 Matthias Runge - 0.14.1-6 +- Use time.monotonic if available (Python3 > 3.2) + patch thanks to Ville Skyttä (rhbz#1294335) +- modernize spec + * Tue Jul 19 2016 Fedora Release Engineering - 0.14.1-5 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages