]> git.pld-linux.org Git - packages/python-lockfile.git/blob - python-lockfile.spec
1523321ea526317f2b8eb1bbe7ba008fd8cf8897
[packages/python-lockfile.git] / python-lockfile.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5
6 %define         module  lockfile
7 Summary:        Exports a LockFile class which provides a simple API for locking files
8 Name:           python-%{module}
9 Version:        0.12.2
10 Release:        7
11 License:        MIT
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
18 %if %{with python2}
19 BuildRequires:  python-pbr
20 BuildRequires:  python-setuptools
21 %endif
22 %if %{with python3}
23 BuildRequires:  python3-pbr
24 BuildRequires:  python3-setuptools
25 %endif
26 Requires:       python-modules
27 BuildArch:      noarch
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %description
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.
40
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
45
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.
56
57 %prep
58 %setup -q -n pylockfile-%{version}
59
60 %build
61 %if %{with python2}
62 export PBR_VERSION=$(rpm -q --qf '%{VERSION}' python-pbr)
63 %py_build
64 %endif
65
66 %if %{with python3}
67 export PBR_VERSION=$(rpm -q --qf '%{VERSION}' python3-pbr)
68 %py3_build
69 %endif
70
71 %install
72 rm -rf $RPM_BUILD_ROOT
73
74 %if %{with python2}
75 export PBR_VERSION=$(rpm -q --qf '%{VERSION}' python-pbr)
76 %py_install
77
78 %py_postclean
79 %endif
80
81 %if %{with python3}
82 export PBR_VERSION=$(rpm -q --qf '%{VERSION}' python3-pbr)
83 %py3_install
84 %endif
85
86 %clean
87 rm -rf $RPM_BUILD_ROOT
88
89 %if %{with python2}
90 %files
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
96 %endif
97
98 %if %{with python3}
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
104 %endif
This page took 0.044065 seconds and 2 git commands to generate.