[packages/python-lockfile] Version: 0.12.2, Python 3 support
jajcus
jajcus at pld-linux.org
Mon Sep 19 17:41:42 CEST 2016
commit 882f0b9e9992a061a4b20caddbf472adb1cc1161
Author: Jacek Konieczny <jajcus at jajcus.net>
Date: Mon Sep 19 17:41:24 2016 +0200
Version: 0.12.2, Python 3 support
python-lockfile.spec | 59 ++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 53 insertions(+), 6 deletions(-)
---
diff --git a/python-lockfile.spec b/python-lockfile.spec
index fd2b3f8..a130576 100644
--- a/python-lockfile.spec
+++ b/python-lockfile.spec
@@ -1,17 +1,27 @@
+
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+
%define module lockfile
Summary: Exports a LockFile class which provides a simple API for locking files
Name: python-%{module}
-Version: 0.10.2
-Release: 2
+Version: 0.12.2
+Release: 1
License: MIT
Group: Development/Languages/Python
Source0: https://github.com/openstack/pylockfile/archive/%{version}.tar.gz
-# Source0-md5: 649ec12618fb02b215c1421471c3e240
+# Source0-md5: f2927523a056f4943604d08f4aa4c260
URL: http://pypi.python.org/pypi/lockfile
-BuildRequires: python-distribute
-BuildRequires: python-pbr
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.710
+%if %{with python2}
+BuildRequires: python-setuptools
+BuildRequires: python-pbr
+%endif
+%if %{with python3}
+BuildRequires: python3-setuptools
+BuildRequires: python3-pbr
+%endif
Requires: python-modules
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -27,28 +37,65 @@ implementation based on SQLite is also provided, more as a
demonstration of the possibilities it provides than as
production-quality code.
+%package -n python3-%{module}
+Summary: Exports a LockFile class which provides a simple API for locking files
+Group: Libraries/Python
+Requires: python3-modules
+
+%description -n python3-%{module}
+The lockfile package exports a LockFile class which provides a simple
+API for locking files. Unlike the Windows msvcrt.locking function, the
+fcntl.lockf and flock functions, and the deprecated posixfile module,
+the API is identical across both Unix (including Linux and Mac) and
+Windows platforms. The lock mechanism relies on the atomic nature of
+the link (on Unix) and mkdir (on Windows) system calls. An
+implementation based on SQLite is also provided, more as a
+demonstration of the possibilities it provides than as
+production-quality code.
+
%prep
%setup -q -n pylockfile-%{version}
%build
+%if %{with python2}
export PBR_VERSION=$(rpm -q --qf '%{VERSION}' python-pbr)
%py_build
+%endif
+
+%if %{with python3}
+export PBR_VERSION=$(rpm -q --qf '%{VERSION}' python3-pbr)
+%py3_build
+%endif
%install
rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
export PBR_VERSION=$(rpm -q --qf '%{VERSION}' python-pbr)
%py_install
%py_postclean
+%endif
+
+%if %{with python3}
+export PBR_VERSION=$(rpm -q --qf '%{VERSION}' python3-pbr)
+%py3_install
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc ACKS README RELEASE-NOTES
+%doc ACKS README.rst RELEASE-NOTES
%dir %{py_sitescriptdir}/lockfile
%{py_sitescriptdir}/lockfile/*.py[co]
%if "%{py_ver}" > "2.4"
%{py_sitescriptdir}/lockfile-*.egg-info
%endif
+
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc ACKS README.rst RELEASE-NOTES
+%{py3_sitescriptdir}/lockfile
+%{py3_sitescriptdir}/lockfile-*.egg-info
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-lockfile.git/commitdiff/882f0b9e9992a061a4b20caddbf472adb1cc1161
More information about the pld-cvs-commit
mailing list