]>
Commit | Line | Data |
---|---|---|
90cb2092 AM |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
fb7dbc4d ER |
5 | # Python3 note: |
6 | # Due to big API incompatibility between python 3.3, 3.4 and 3.5, the | |
7 | # author of HTTPretty is **not** supporting python3 officially. You | |
8 | # will notice that the travis build for python 3 might be broken, and | |
9 | # while pull requests fixing py3 support are most welcome, it is still | |
10 | # not official at least *for now*. | |
3ed73992 | 11 | %bcond_without python3 # CPython 3.x module |
90cb2092 AM |
12 | |
13 | %define module httpretty | |
14 | Summary: HTTP client mock for Python | |
15 | Name: python-%{module} | |
fb7dbc4d | 16 | Version: 0.8.14 |
e1f48b17 | 17 | Release: 3 |
90cb2092 AM |
18 | License: MIT |
19 | Group: Libraries/Python | |
20 | Source0: https://pypi.python.org/packages/source/h/httpretty/httpretty-%{version}.tar.gz | |
fb7dbc4d | 21 | # Source0-md5: 2a6bbf270fafc77647b0479d95d0544c |
bb7daafe | 22 | Patch0: test-deps.patch |
fb7dbc4d | 23 | URL: http://httpretty.readthedocs.io/ |
90cb2092 | 24 | BuildRequires: rpm-pythonprov |
d4739aca | 25 | BuildRequires: rpmbuild(macros) >= 1.710 |
90cb2092 AM |
26 | %if %{with python2} |
27 | BuildRequires: python-distribute | |
bb7daafe | 28 | BuildRequires: python-sure >= 1.2.24 |
4ad898a1 ER |
29 | %if %{with tests} |
30 | BuildRequires: python-httplib2 | |
31 | BuildRequires: python-nose | |
32 | BuildRequires: python-requests | |
33 | BuildRequires: python-tornado | |
34 | %endif | |
90cb2092 AM |
35 | %endif |
36 | %if %{with python3} | |
37 | BuildRequires: python3-distribute | |
38 | BuildRequires: python3-modules | |
bb7daafe | 39 | BuildRequires: python3-sure >= 1.2.24 |
4ad898a1 ER |
40 | %if %{with tests} |
41 | BuildRequires: python3-httplib2 | |
42 | BuildRequires: python3-nose | |
43 | BuildRequires: python3-requests | |
44 | BuildRequires: python3-tornado | |
3ed73992 ER |
45 | # AUTO: -- ImportError: No module named 'urllib3' |
46 | BuildRequires: python3-urllib3 | |
4ad898a1 | 47 | %endif |
90cb2092 AM |
48 | %endif |
49 | Requires: python-modules | |
50 | BuildArch: noarch | |
51 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
52 | ||
53 | %description | |
54 | HTTP client mock for Python. | |
55 | ||
56 | %package -n python3-%{module} | |
57 | Summary: HTTP client mock for Python | |
58 | Group: Libraries/Python | |
59 | Requires: python3-modules | |
60 | ||
61 | %description -n python3-%{module} | |
62 | HTTP client mock for Python. | |
63 | ||
64 | %prep | |
65 | %setup -q -n %{module}-%{version} | |
bb7daafe | 66 | %patch0 -p1 |
90cb2092 AM |
67 | |
68 | %build | |
69 | %if %{with python2} | |
840eb0b1 | 70 | %py_build %{?with_tests:test} |
90cb2092 AM |
71 | %endif |
72 | ||
73 | %if %{with python3} | |
840eb0b1 | 74 | %py3_build %{?with_tests:test} |
90cb2092 AM |
75 | %endif |
76 | ||
77 | %install | |
78 | rm -rf $RPM_BUILD_ROOT | |
90cb2092 | 79 | %if %{with python2} |
840eb0b1 | 80 | %py_install |
90cb2092 AM |
81 | %py_postclean |
82 | %endif | |
83 | ||
84 | %if %{with python3} | |
840eb0b1 | 85 | %py3_install |
90cb2092 AM |
86 | %endif |
87 | ||
88 | %clean | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
91 | %if %{with python2} | |
92 | %files | |
93 | %defattr(644,root,root,755) | |
94 | %doc README* | |
95 | %dir %{py_sitescriptdir}/%{module} | |
96 | %{py_sitescriptdir}/%{module}/*.py[co] | |
90cb2092 AM |
97 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
98 | %endif | |
90cb2092 AM |
99 | |
100 | %if %{with python3} | |
101 | %files -n python3-%{module} | |
102 | %defattr(644,root,root,755) | |
103 | %doc README* | |
104 | %{py3_sitescriptdir}/%{module} | |
105 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
106 | %endif |