3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
6 %define module lockfile
7 Summary: Exports a LockFile class which provides a simple API for locking files
12 Group: Development/Languages/Python
13 Source0: https://github.com/openstack/pylockfile/archive/%{version}.tar.gz
14 # Source0-md5: f2927523a056f4943604d08f4aa4c260
15 URL: http://pypi.python.org/pypi/lockfile
16 BuildRequires: rpm-pythonprov
17 BuildRequires: rpmbuild(macros) >= 1.710
19 BuildRequires: python-pbr
20 BuildRequires: python-setuptools
23 BuildRequires: python3-pbr
24 BuildRequires: python3-setuptools
26 Requires: python-modules
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 The lockfile package exports a LockFile class which provides a simple
32 API for locking files. Unlike the Windows msvcrt.locking function, the
33 fcntl.lockf and flock functions, and the deprecated posixfile module,
34 the API is identical across both Unix (including Linux and Mac) and
35 Windows platforms. The lock mechanism relies on the atomic nature of
36 the link (on Unix) and mkdir (on Windows) system calls. An
37 implementation based on SQLite is also provided, more as a
38 demonstration of the possibilities it provides than as
39 production-quality code.
41 %package -n python3-%{module}
42 Summary: Exports a LockFile class which provides a simple API for locking files
43 Group: Libraries/Python
44 Requires: python3-modules
46 %description -n python3-%{module}
47 The lockfile package exports a LockFile class which provides a simple
48 API for locking files. Unlike the Windows msvcrt.locking function, the
49 fcntl.lockf and flock functions, and the deprecated posixfile module,
50 the API is identical across both Unix (including Linux and Mac) and
51 Windows platforms. The lock mechanism relies on the atomic nature of
52 the link (on Unix) and mkdir (on Windows) system calls. An
53 implementation based on SQLite is also provided, more as a
54 demonstration of the possibilities it provides than as
55 production-quality code.
58 %setup -q -n pylockfile-%{version}
62 export PBR_VERSION=$(rpm -q --qf '%{VERSION}' python-pbr)
67 export PBR_VERSION=$(rpm -q --qf '%{VERSION}' python3-pbr)
72 rm -rf $RPM_BUILD_ROOT
75 export PBR_VERSION=$(rpm -q --qf '%{VERSION}' python-pbr)
82 export PBR_VERSION=$(rpm -q --qf '%{VERSION}' python3-pbr)
87 rm -rf $RPM_BUILD_ROOT
91 %defattr(644,root,root,755)
92 %doc ACKS README.rst RELEASE-NOTES
93 %dir %{py_sitescriptdir}/lockfile
94 %{py_sitescriptdir}/lockfile/*.py[co]
95 %{py_sitescriptdir}/lockfile-*.egg-info
99 %files -n python3-%{module}
100 %defattr(644,root,root,755)
101 %doc ACKS README.rst RELEASE-NOTES
102 %{py3_sitescriptdir}/lockfile
103 %{py3_sitescriptdir}/lockfile-*.egg-info