]>
Commit | Line | Data |
---|---|---|
a93e6fa9 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
d2f5553e | 5 | %bcond_without tests # unit tests (250+ processes created, max processes ulimit must allow it) |
a93e6fa9 JB |
6 | |
7 | Summary: A platform independent file lock | |
8 | Summary(pl.UTF-8): Niezależne od platformy blokady plikowe | |
9 | Name: python-filelock | |
4e2d35e3 JP |
10 | Version: 3.2.1 |
11 | Release: 1 | |
d2f5553e | 12 | License: Public Domain |
a93e6fa9 JB |
13 | Group: Libraries/Python |
14 | #Source0Download: https://pypi.org/simple/filelock/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/f/filelock/filelock-%{version}.tar.gz | |
4e2d35e3 | 16 | # Source0-md5: 92fea9fb4ebf39d746c77ec6c4c87be0 |
a93e6fa9 JB |
17 | URL: https://pypi.org/project/filelock/ |
18 | BuildRequires: rpm-pythonprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.714 | |
20 | %if %{with python2} | |
d2f5553e | 21 | BuildRequires: python-modules >= 1:2.7 |
a93e6fa9 | 22 | BuildRequires: python-setuptools |
3be7e3a5 JP |
23 | %if %{with tests} |
24 | BuildRequires: python-pytest | |
25 | %endif | |
a93e6fa9 JB |
26 | %endif |
27 | %if %{with python3} | |
d2f5553e | 28 | BuildRequires: python3-modules >= 1:3.4 |
a93e6fa9 | 29 | BuildRequires: python3-setuptools |
3be7e3a5 JP |
30 | %if %{with tests} |
31 | BuildRequires: python3-pytest | |
32 | %endif | |
a93e6fa9 | 33 | %endif |
d2f5553e | 34 | Requires: python-modules >= 1:2.7 |
a93e6fa9 JB |
35 | BuildArch: noarch |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | %description | |
39 | This package contains a single module, which implements a platform | |
40 | independent file lock in Python, which provides a simple way of | |
41 | inter-process communication. | |
42 | ||
43 | %description -l pl.UTF-8 | |
44 | Ten pakiet zawiera pojedynczny moduł implementujący niezależne od | |
45 | platformy blokady plikowe w Pythonie. Zapewniają one prosty sposób | |
46 | komunikacji międzyprocesowej. | |
47 | ||
48 | %package -n python3-filelock | |
49 | Summary: A platform independent file lock | |
50 | Summary(pl.UTF-8): Niezależne od platformy blokady plikowe | |
51 | Group: Libraries/Python | |
d2f5553e | 52 | Requires: python3-modules >= 1:3.4 |
a93e6fa9 JB |
53 | |
54 | %description -n python3-filelock | |
55 | This package contains a single module, which implements a platform | |
56 | independent file lock in Python, which provides a simple way of | |
57 | inter-process communication. | |
58 | ||
59 | %description -n python3-filelock -l pl.UTF-8 | |
60 | Ten pakiet zawiera pojedynczny moduł implementujący niezależne od | |
61 | platformy blokady plikowe w Pythonie. Zapewniają one prosty sposób | |
62 | komunikacji międzyprocesowej. | |
63 | ||
64 | %prep | |
65 | %setup -q -n filelock-%{version} | |
66 | ||
67 | %build | |
68 | %if %{with python2} | |
69 | %py_build | |
d2f5553e JB |
70 | |
71 | %if %{with tests} | |
3be7e3a5 JP |
72 | PYTHONPATH=$(pwd)/src \ |
73 | %{__python} -m pytest tests | |
d2f5553e | 74 | %endif |
a93e6fa9 JB |
75 | %endif |
76 | ||
77 | %if %{with python3} | |
78 | %py3_build | |
d2f5553e JB |
79 | |
80 | %if %{with tests} | |
3be7e3a5 JP |
81 | PYTHONPATH=$(pwd)/src \ |
82 | %{__python3} -m pytest tests | |
d2f5553e | 83 | %endif |
a93e6fa9 JB |
84 | %endif |
85 | ||
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %if %{with python2} | |
90 | %py_install | |
91 | ||
92 | %py_postclean | |
93 | %endif | |
94 | ||
95 | %if %{with python3} | |
96 | %py3_install | |
97 | %endif | |
98 | ||
99 | %clean | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
102 | %if %{with python2} | |
103 | %files | |
104 | %defattr(644,root,root,755) | |
d2f5553e | 105 | %doc LICENSE README.md |
4e2d35e3 | 106 | %{py_sitescriptdir}/filelock |
a93e6fa9 JB |
107 | %{py_sitescriptdir}/filelock-%{version}-py*.egg-info |
108 | %endif | |
109 | ||
110 | %if %{with python3} | |
111 | %files -n python3-filelock | |
112 | %defattr(644,root,root,755) | |
d2f5553e | 113 | %doc LICENSE README.md |
4e2d35e3 | 114 | %{py3_sitescriptdir}/filelock |
a93e6fa9 JB |
115 | %{py3_sitescriptdir}/filelock-%{version}-py*.egg-info |
116 | %endif |