]>
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 AM |
6 | |
7 | %define module sure | |
8 | Summary: Utility belt for automated testing in python for python | |
9 | Name: python-%{module} | |
66ec76e3 | 10 | Version: 1.2.12 |
e746740d | 11 | Release: 2 |
5d118f35 AM |
12 | License: GPL v3+ |
13 | Group: Libraries/Python | |
66ec76e3 MK |
14 | # Source0: https://github.com/gabrielfalcao/sure/archive/%{version}.tar.gz |
15 | Source0: https://pypi.python.org/packages/source/s/%{module}/%{module}-%{version}.tar.gz | |
16 | # Source0-md5: fc57c30e76bddba68f84443ec91e7026 | |
e746740d | 17 | Patch0: %{name}-py3_fixes.patch |
5d118f35 AM |
18 | URL: https://github.com/gabrielfalcao/sure |
19 | BuildRequires: rpm-pythonprov | |
20 | BuildRequires: rpmbuild(macros) >= 1.219 | |
21 | %if %{with python2} | |
22 | BuildRequires: python-devel | |
23 | BuildRequires: python-distribute | |
24 | %endif | |
25 | %if %{with python3} | |
26 | BuildRequires: python3-devel | |
27 | BuildRequires: python3-distribute | |
28 | BuildRequires: python3-modules | |
29 | %endif | |
30 | Requires: python-modules | |
31 | BuildArch: noarch | |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
35 | A testing library for python with powerful and flexible assertions. | |
36 | Sure is heavily inspired by should.js. | |
37 | ||
38 | %package -n python3-%{module} | |
39 | Summary: Utility belt for automated testing in python for python | |
40 | Group: Libraries/Python | |
41 | Requires: python3-modules | |
42 | ||
43 | %description -n python3-%{module} | |
44 | A testing library for python with powerful and flexible assertions. | |
45 | Sure is heavily inspired by should.js. | |
46 | ||
47 | %prep | |
48 | %setup -q -n %{module}-%{version} | |
e746740d | 49 | %patch0 -p1 |
5d118f35 AM |
50 | |
51 | %build | |
52 | %if %{with python2} | |
53 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
54 | %endif | |
55 | ||
56 | %if %{with python3} | |
5d118f35 AM |
57 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} |
58 | %endif | |
59 | ||
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | ||
63 | %if %{with python2} | |
64 | %{__python} setup.py \ | |
65 | build --build-base build-2 \ | |
66 | install --skip-build \ | |
67 | --optimize=2 \ | |
68 | --root=$RPM_BUILD_ROOT | |
69 | ||
70 | %py_postclean | |
71 | %endif | |
72 | ||
73 | %if %{with python3} | |
74 | %{__python3} setup.py \ | |
75 | build --build-base build-3 \ | |
76 | install --skip-build \ | |
77 | --optimize=2 \ | |
78 | --root=$RPM_BUILD_ROOT | |
79 | %endif | |
80 | ||
81 | %clean | |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | ||
84 | %if %{with python2} | |
85 | %files | |
86 | %defattr(644,root,root,755) | |
66ec76e3 | 87 | %doc README.md |
5d118f35 AM |
88 | %dir %{py_sitescriptdir}/sure |
89 | %{py_sitescriptdir}/sure/*.py[co] | |
90 | %if "%{py_ver}" > "2.4" | |
91 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
92 | %endif | |
93 | %endif | |
94 | ||
95 | %if %{with python3} | |
96 | %files -n python3-%{module} | |
97 | %defattr(644,root,root,755) | |
66ec76e3 | 98 | %doc README.md |
5d118f35 AM |
99 | %{py3_sitescriptdir}/%{module} |
100 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
101 | %endif |