]>
Commit | Line | Data |
---|---|---|
5d118f35 AM |
1 | # |
2 | # Conditional build: | |
efd08cc3 | 3 | %bcond_without tests # unit tests |
5d118f35 | 4 | %bcond_without python2 # CPython 2.x module |
e746740d | 5 | %bcond_without python3 # CPython 3.x module |
5d118f35 | 6 | |
b57e1804 | 7 | %define module sure |
b57e1804 | 8 | Summary: Utility belt for automated testing in Python for Python |
efd08cc3 | 9 | Summary(pl.UTF-8): Narzędzia do automatycznego testowania w Pythonie |
5d118f35 | 10 | Name: python-%{module} |
efd08cc3 | 11 | Version: 1.4.11 |
81b3c6ca | 12 | Release: 4 |
5d118f35 AM |
13 | License: GPL v3+ |
14 | Group: Libraries/Python | |
efd08cc3 JB |
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 | |
5d118f35 | 19 | URL: https://github.com/gabrielfalcao/sure |
5d118f35 | 20 | %if %{with python2} |
efd08cc3 JB |
21 | BuildRequires: python-devel >= 1:2.7 |
22 | BuildRequires: python-mock >= 2.0.0 | |
0b5d1b0d | 23 | BuildRequires: python-nose |
efd08cc3 JB |
24 | BuildRequires: python-setuptools |
25 | BuildRequires: python-six >= 1.10.0 | |
5d118f35 AM |
26 | %endif |
27 | %if %{with python3} | |
efd08cc3 | 28 | BuildRequires: python3-devel >= 1:3.4 |
0b5d1b0d | 29 | BuildRequires: python3-nose |
efd08cc3 JB |
30 | BuildRequires: python3-setuptools |
31 | BuildRequires: python3-six >= 1.10.0 | |
5d118f35 | 32 | %endif |
efd08cc3 JB |
33 | BuildRequires: rpm-pythonprov |
34 | BuildRequires: rpmbuild(macros) >= 1.714 | |
35 | Requires: python-modules >= 1:2.7 | |
5d118f35 AM |
36 | BuildArch: noarch |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %description | |
efd08cc3 | 40 | A testing library for Python with powerful and flexible assertions. |
5d118f35 AM |
41 | Sure is heavily inspired by should.js. |
42 | ||
efd08cc3 JB |
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 | ||
5d118f35 AM |
47 | %package -n python3-%{module} |
48 | Summary: Utility belt for automated testing in python for python | |
efd08cc3 | 49 | Summary(pl.UTF-8): Narzędzia do automatycznego testowania w Pythonie |
5d118f35 | 50 | Group: Libraries/Python |
efd08cc3 | 51 | Requires: python3-modules >= 1:3.4 |
5d118f35 AM |
52 | |
53 | %description -n python3-%{module} | |
efd08cc3 | 54 | A testing library for Python with powerful and flexible assertions. |
5d118f35 AM |
55 | Sure is heavily inspired by should.js. |
56 | ||
efd08cc3 JB |
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 | ||
5d118f35 AM |
61 | %prep |
62 | %setup -q -n %{module}-%{version} | |
efd08cc3 | 63 | %patch0 -p1 |
5d118f35 AM |
64 | |
65 | %build | |
66 | %if %{with python2} | |
5cbb06d2 | 67 | %py_build %{?with_tests:test} |
5d118f35 AM |
68 | %endif |
69 | ||
70 | %if %{with python3} | |
5cbb06d2 | 71 | %py3_build %{?with_tests:test} |
5d118f35 AM |
72 | %endif |
73 | ||
74 | %install | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
77 | %if %{with python2} | |
5cbb06d2 | 78 | %py_install |
5d118f35 AM |
79 | |
80 | %py_postclean | |
81 | %endif | |
82 | ||
83 | %if %{with python3} | |
5cbb06d2 | 84 | %py3_install |
5d118f35 AM |
85 | %endif |
86 | ||
87 | %clean | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
90 | %if %{with python2} | |
91 | %files | |
92 | %defattr(644,root,root,755) | |
efd08cc3 JB |
93 | %doc README.rst |
94 | %{py_sitescriptdir}/sure | |
95 | %{py_sitescriptdir}/sure-%{version}-py*.egg-info | |
5d118f35 AM |
96 | %endif |
97 | ||
98 | %if %{with python3} | |
99 | %files -n python3-%{module} | |
100 | %defattr(644,root,root,755) | |
efd08cc3 JB |
101 | %doc README.rst |
102 | %{py3_sitescriptdir}/sure | |
103 | %{py3_sitescriptdir}/sure-%{version}-py*.egg-info | |
5d118f35 | 104 | %endif |