]>
Commit | Line | Data |
---|---|---|
5d118f35 AM |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
e746740d | 5 | %bcond_without python3 # CPython 3.x module |
5d118f35 | 6 | |
b57e1804 ER |
7 | %define module sure |
8 | %define egg_name sure | |
9 | %define pypi_name sure | |
10 | Summary: Utility belt for automated testing in Python for Python | |
5d118f35 | 11 | Name: python-%{module} |
b57e1804 | 12 | Version: 1.2.24 |
ae9a5ca4 | 13 | Release: 4 |
5d118f35 AM |
14 | License: GPL v3+ |
15 | Group: Libraries/Python | |
b57e1804 ER |
16 | Source0: https://pypi.python.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz |
17 | # Source0-md5: a396cc3c71d551bfdb9bc45363ca05da | |
5d118f35 AM |
18 | URL: https://github.com/gabrielfalcao/sure |
19 | BuildRequires: rpm-pythonprov | |
f1c8fb31 | 20 | BuildRequires: rpmbuild(macros) >= 1.710 |
5d118f35 AM |
21 | %if %{with python2} |
22 | BuildRequires: python-devel | |
23 | BuildRequires: python-distribute | |
0b5d1b0d MK |
24 | BuildRequires: python-mock |
25 | BuildRequires: python-nose | |
26 | BuildRequires: python-six | |
5d118f35 AM |
27 | %endif |
28 | %if %{with python3} | |
29 | BuildRequires: python3-devel | |
30 | BuildRequires: python3-distribute | |
0b5d1b0d | 31 | BuildRequires: python3-mock |
5d118f35 | 32 | BuildRequires: python3-modules |
0b5d1b0d MK |
33 | BuildRequires: python3-nose |
34 | BuildRequires: python3-six | |
5d118f35 AM |
35 | %endif |
36 | Requires: python-modules | |
37 | BuildArch: noarch | |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %description | |
41 | A testing library for python with powerful and flexible assertions. | |
42 | Sure is heavily inspired by should.js. | |
43 | ||
44 | %package -n python3-%{module} | |
45 | Summary: Utility belt for automated testing in python for python | |
46 | Group: Libraries/Python | |
47 | Requires: python3-modules | |
48 | ||
49 | %description -n python3-%{module} | |
50 | A testing library for python with powerful and flexible assertions. | |
51 | Sure is heavily inspired by should.js. | |
52 | ||
53 | %prep | |
54 | %setup -q -n %{module}-%{version} | |
55 | ||
56 | %build | |
57 | %if %{with python2} | |
5cbb06d2 | 58 | %py_build %{?with_tests:test} |
5d118f35 AM |
59 | %endif |
60 | ||
61 | %if %{with python3} | |
5cbb06d2 | 62 | %py3_build %{?with_tests:test} |
5d118f35 AM |
63 | %endif |
64 | ||
65 | %install | |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | ||
68 | %if %{with python2} | |
5cbb06d2 | 69 | %py_install |
5d118f35 AM |
70 | |
71 | %py_postclean | |
72 | %endif | |
73 | ||
74 | %if %{with python3} | |
5cbb06d2 | 75 | %py3_install |
5d118f35 AM |
76 | %endif |
77 | ||
78 | %clean | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %if %{with python2} | |
82 | %files | |
83 | %defattr(644,root,root,755) | |
66ec76e3 | 84 | %doc README.md |
b57e1804 ER |
85 | %dir %{py_sitescriptdir}/%{module} |
86 | %{py_sitescriptdir}/%{module}/*.py[co] | |
87 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
5d118f35 AM |
88 | %endif |
89 | ||
90 | %if %{with python3} | |
91 | %files -n python3-%{module} | |
92 | %defattr(644,root,root,755) | |
66ec76e3 | 93 | %doc README.md |
5d118f35 | 94 | %{py3_sitescriptdir}/%{module} |
b57e1804 | 95 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info |
5d118f35 | 96 | %endif |