]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module sure | |
8 | Summary: Utility belt for automated testing in Python for Python | |
9 | Summary(pl.UTF-8): Narzędzia do automatycznego testowania w Pythonie | |
10 | Name: python-%{module} | |
11 | Version: 1.4.11 | |
12 | Release: 4 | |
13 | License: GPL v3+ | |
14 | Group: Libraries/Python | |
15 | #Source0Download; https://pypi.org/simple/sure/ | |
16 | Source0: https://files.pythonhosted.org/packages/source/s/sure/%{module}-%{version}.tar.gz | |
17 | # Source0-md5: 51f28b4ea7a6f59d1dd09f8eaaeabee7 | |
18 | Patch0: %{name}-mock.patch | |
19 | URL: https://github.com/gabrielfalcao/sure | |
20 | %if %{with python2} | |
21 | BuildRequires: python-devel >= 1:2.7 | |
22 | BuildRequires: python-mock >= 2.0.0 | |
23 | BuildRequires: python-nose | |
24 | BuildRequires: python-setuptools | |
25 | BuildRequires: python-six >= 1.10.0 | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-devel >= 1:3.4 | |
29 | BuildRequires: python3-nose | |
30 | BuildRequires: python3-setuptools | |
31 | BuildRequires: python3-six >= 1.10.0 | |
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 | A testing library for Python with powerful and flexible assertions. | |
41 | Sure is heavily inspired by should.js. | |
42 | ||
43 | %description -l pl.UTF-8 | |
44 | Biblioteka testów dla Pythona z bardzo elastycznymi asercjami. Sure | |
45 | jest znacząco zainspirowany should.js. | |
46 | ||
47 | %package -n python3-%{module} | |
48 | Summary: Utility belt for automated testing in python for python | |
49 | Summary(pl.UTF-8): Narzędzia do automatycznego testowania w Pythonie | |
50 | Group: Libraries/Python | |
51 | Requires: python3-modules >= 1:3.4 | |
52 | ||
53 | %description -n python3-%{module} | |
54 | A testing library for Python with powerful and flexible assertions. | |
55 | Sure is heavily inspired by should.js. | |
56 | ||
57 | %description -n python3-%{module} -l pl.UTF-8 | |
58 | Biblioteka testów dla Pythona z bardzo elastycznymi asercjami. Sure | |
59 | jest znacząco zainspirowany should.js. | |
60 | ||
61 | %prep | |
62 | %setup -q -n %{module}-%{version} | |
63 | %patch0 -p1 | |
64 | ||
65 | %build | |
66 | %if %{with python2} | |
67 | %py_build %{?with_tests:test} | |
68 | %endif | |
69 | ||
70 | %if %{with python3} | |
71 | %py3_build %{?with_tests:test} | |
72 | %endif | |
73 | ||
74 | %install | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
77 | %if %{with python2} | |
78 | %py_install | |
79 | ||
80 | %py_postclean | |
81 | %endif | |
82 | ||
83 | %if %{with python3} | |
84 | %py3_install | |
85 | %endif | |
86 | ||
87 | %clean | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
90 | %if %{with python2} | |
91 | %files | |
92 | %defattr(644,root,root,755) | |
93 | %doc README.rst | |
94 | %{py_sitescriptdir}/sure | |
95 | %{py_sitescriptdir}/sure-%{version}-py*.egg-info | |
96 | %endif | |
97 | ||
98 | %if %{with python3} | |
99 | %files -n python3-%{module} | |
100 | %defattr(644,root,root,755) | |
101 | %doc README.rst | |
102 | %{py3_sitescriptdir}/sure | |
103 | %{py3_sitescriptdir}/sure-%{version}-py*.egg-info | |
104 | %endif |