]>
Commit | Line | Data |
---|---|---|
0a06be20 JB |
1 | # TODO: GootTests based tests |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_without tests # unit tests | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | Summary: Python module to support running any existing function with a given timeout | |
9 | Summary(pl.UTF-8): Moduł Pythona pozwalający uruchamiać istniejące funkcje z podanym limitem czasu | |
10 | Name: python-func_timeout | |
11 | Version: 4.3.5 | |
9a3f1aa8 | 12 | Release: 3 |
0a06be20 JB |
13 | License: LGPL v3 |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.org/simple/func-timeout/ | |
16 | Source0: https://files.pythonhosted.org/packages/source/f/func-timeout/func_timeout-%{version}.tar.gz | |
17 | # Source0-md5: 3535d4e00d54e36757ba7c65f20e4c91 | |
18 | URL: https://pypi.org/project/func-timeout/ | |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.7 | |
21 | BuildRequires: python-setuptools | |
22 | %if %{with tests} | |
23 | #BuildRequires: python-GoodTests | |
24 | %endif | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-modules >= 1:3.4 | |
28 | BuildRequires: python3-setuptools | |
29 | %if %{with tests} | |
30 | #BuildRequires: python3-GoodTests | |
31 | %endif | |
32 | %endif | |
33 | BuildRequires: rpm-pythonprov | |
34 | BuildRequires: rpmbuild(macros) >= 1.714 | |
35 | Requires: python-modules >= 1:2.7 | |
36 | BuildArch: noarch | |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %description | |
40 | Python module which allows you to specify timeouts when calling any | |
41 | existing function. Also provides support for stoppable-threads. | |
42 | ||
43 | %description -l pl.UTF-8 | |
44 | Moduł Pythona pozwalający na określenie limitów czasu przy wywoływaniu | |
45 | dowolnej istniejącej funkcji. Obsługuje także zatrzymywanie wątków. | |
46 | ||
47 | %package -n python3-func_timeout | |
48 | Summary: Python module to support running any existing function with a given timeout | |
49 | Summary(pl.UTF-8): Moduł Pythona pozwalający uruchamiać istniejące funkcje z podanym limitem czasu | |
50 | Group: Libraries/Python | |
51 | Requires: python3-modules >= 1:3.4 | |
52 | ||
53 | %description -n python3-func_timeout | |
54 | Python module which allows you to specify timeouts when calling any | |
55 | existing function. Also provides support for stoppable-threads. | |
56 | ||
57 | %description -n python3-func_timeout -l pl.UTF-8 | |
58 | Moduł Pythona pozwalający na określenie limitów czasu przy wywoływaniu | |
59 | dowolnej istniejącej funkcji. Obsługuje także zatrzymywanie wątków. | |
60 | ||
61 | %package apidocs | |
62 | Summary: API documentation for Python func_timeout module | |
63 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona func_timeout | |
64 | Group: Documentation | |
65 | ||
66 | %description apidocs | |
67 | API documentation for Python func_timeout module. | |
68 | ||
69 | %description apidocs -l pl.UTF-8 | |
70 | Dokumentacja API modułu Pythona func_timeout. | |
71 | ||
72 | %prep | |
73 | %setup -q -n func_timeout-%{version} | |
74 | ||
75 | %build | |
76 | %if %{with python2} | |
77 | %py_build | |
78 | ||
79 | %if %{with tests} | |
80 | %{__python} testit.py | |
81 | #%{__python} tests/runTests.py | |
82 | %endif | |
83 | %endif | |
84 | ||
85 | %if %{with python3} | |
86 | %py3_build | |
87 | ||
88 | %if %{with tests} | |
89 | %{__python3} testit.py | |
90 | #%{__python3} tests/runTests.py | |
91 | %endif | |
92 | %endif | |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
97 | %if %{with python2} | |
98 | %py_install | |
99 | ||
100 | %py_postclean | |
101 | %endif | |
102 | ||
103 | %if %{with python3} | |
104 | %py3_install | |
105 | ||
106 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/func_timeout/py2_raise.py | |
107 | %endif | |
108 | ||
109 | %clean | |
110 | rm -rf $RPM_BUILD_ROOT | |
111 | ||
112 | %if %{with python2} | |
113 | %files | |
114 | %defattr(644,root,root,755) | |
115 | %doc ChangeLog LICENSE README.md | |
116 | %{py_sitescriptdir}/func_timeout | |
117 | %{py_sitescriptdir}/func_timeout-%{version}-py*.egg-info | |
118 | %endif | |
119 | ||
120 | %if %{with python3} | |
121 | %files -n python3-func_timeout | |
122 | %defattr(644,root,root,755) | |
123 | %doc ChangeLog LICENSE README.md | |
124 | %{py3_sitescriptdir}/func_timeout | |
125 | %{py3_sitescriptdir}/func_timeout-%{version}-py*.egg-info | |
126 | %endif | |
127 | ||
128 | %files apidocs | |
129 | %defattr(644,root,root,755) | |
130 | %doc doc/*.html |