]>
Commit | Line | Data |
---|---|---|
90cb2092 AM |
1 | # |
2 | # Conditional build: | |
8ea9bff8 | 3 | %bcond_without tests # unit/functional tests |
336016a4 | 4 | %bcond_with doc # build Sphinx documentation (already built docs included in dist as of 0.9.7) |
90cb2092 | 5 | %bcond_without python2 # CPython 2.x module |
3ed73992 | 6 | %bcond_without python3 # CPython 3.x module |
90cb2092 AM |
7 | |
8 | %define module httpretty | |
9 | Summary: HTTP client mock for Python | |
336016a4 | 10 | Summary(pl.UTF-8): Atrapa klienta HTTP dla Pythona |
90cb2092 | 11 | Name: python-%{module} |
336016a4 JB |
12 | # note: keep 0.9.x here for python2 support |
13 | Version: 0.9.7 | |
99458259 | 14 | Release: 5 |
90cb2092 AM |
15 | License: MIT |
16 | Group: Libraries/Python | |
336016a4 JB |
17 | #Source0Download: https://pypi.org/simple/httpretty/ |
18 | Source0: https://files.pythonhosted.org/packages/source/h/httpretty/httpretty-%{version}.tar.gz | |
19 | # Source0-md5: 2fc3d0dc986200be95ce8ad3ef56bc04 | |
8ea9bff8 | 20 | Patch0: %{name}-mock.patch |
336016a4 | 21 | URL: https://httpretty.readthedocs.io/ |
90cb2092 | 22 | %if %{with python2} |
336016a4 JB |
23 | BuildRequires: python-modules >= 1:2.7 |
24 | BuildRequires: python-setuptools | |
4ad898a1 | 25 | %if %{with tests} |
336016a4 | 26 | BuildRequires: python-coverage |
4ad898a1 | 27 | BuildRequires: python-httplib2 |
336016a4 | 28 | BuildRequires: python-mock |
4ad898a1 | 29 | BuildRequires: python-nose |
336016a4 JB |
30 | BuildRequires: python-nose_randomly |
31 | BuildRequires: python-rednose | |
4ad898a1 | 32 | BuildRequires: python-requests |
336016a4 JB |
33 | BuildRequires: python-six >= 1.11.0 |
34 | BuildRequires: python-sure >= 1.2.24 | |
4ad898a1 | 35 | BuildRequires: python-tornado |
336016a4 | 36 | BuildRequires: python3-urllib3 |
4ad898a1 | 37 | %endif |
90cb2092 AM |
38 | %endif |
39 | %if %{with python3} | |
336016a4 JB |
40 | BuildRequires: python3-modules >= 1:3.6 |
41 | BuildRequires: python3-setuptools | |
4ad898a1 | 42 | %if %{with tests} |
336016a4 | 43 | BuildRequires: python3-coverage |
4ad898a1 ER |
44 | BuildRequires: python3-httplib2 |
45 | BuildRequires: python3-nose | |
336016a4 JB |
46 | BuildRequires: python3-nose_randomly |
47 | BuildRequires: python3-rednose | |
4ad898a1 | 48 | BuildRequires: python3-requests |
336016a4 JB |
49 | BuildRequires: python3-six >= 1.11.0 |
50 | BuildRequires: python3-sure >= 1.2.24 | |
4ad898a1 | 51 | BuildRequires: python3-tornado |
3ed73992 | 52 | BuildRequires: python3-urllib3 |
4ad898a1 | 53 | %endif |
90cb2092 | 54 | %endif |
336016a4 JB |
55 | BuildRequires: rpm-pythonprov |
56 | BuildRequires: rpmbuild(macros) >= 1.714 | |
57 | %if %{with doc} | |
58 | BuildRequires: python3-sphinx_rtd_theme | |
59 | BuildRequires: sphinx-pdg-3 | |
60 | %endif | |
61 | Requires: python-modules >= 1:2.7 | |
90cb2092 AM |
62 | BuildArch: noarch |
63 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
64 | ||
65 | %description | |
66 | HTTP client mock for Python. | |
67 | ||
336016a4 JB |
68 | %description -l pl.UTF-8 |
69 | Atrapa klienta HTTP dla Pythona. | |
70 | ||
90cb2092 AM |
71 | %package -n python3-%{module} |
72 | Summary: HTTP client mock for Python | |
336016a4 | 73 | Summary(pl.UTF-8): Atrapa klienta HTTP dla Pythona |
90cb2092 | 74 | Group: Libraries/Python |
336016a4 | 75 | Requires: python3-modules >= 1:3.6 |
90cb2092 AM |
76 | |
77 | %description -n python3-%{module} | |
78 | HTTP client mock for Python. | |
79 | ||
336016a4 JB |
80 | %description -n python3-%{module} -l pl.UTF-8 |
81 | Atrapa klienta HTTP dla Pythona. | |
82 | ||
83 | %package apidocs | |
84 | Summary: API documentation for Python httpretty module | |
85 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona httpretty | |
86 | Group: Documentation | |
87 | ||
88 | %description apidocs | |
89 | API documentation for Python httpretty module. | |
90 | ||
91 | %description apidocs -l pl.UTF-8 | |
92 | Dokumentacja API modułu Pythona httpretty. | |
93 | ||
90cb2092 AM |
94 | %prep |
95 | %setup -q -n %{module}-%{version} | |
8ea9bff8 | 96 | %patch0 -p1 |
90cb2092 AM |
97 | |
98 | %build | |
99 | %if %{with python2} | |
840eb0b1 | 100 | %py_build %{?with_tests:test} |
90cb2092 AM |
101 | %endif |
102 | ||
103 | %if %{with python3} | |
840eb0b1 | 104 | %py3_build %{?with_tests:test} |
90cb2092 AM |
105 | %endif |
106 | ||
336016a4 JB |
107 | %if %{with doc} |
108 | sphinx-build-3 -b html -d docs/build/doctrees docs/source docs/build/html | |
109 | %endif | |
110 | ||
90cb2092 AM |
111 | %install |
112 | rm -rf $RPM_BUILD_ROOT | |
336016a4 | 113 | |
90cb2092 | 114 | %if %{with python2} |
840eb0b1 | 115 | %py_install |
336016a4 | 116 | |
90cb2092 AM |
117 | %py_postclean |
118 | %endif | |
119 | ||
120 | %if %{with python3} | |
840eb0b1 | 121 | %py3_install |
90cb2092 AM |
122 | %endif |
123 | ||
124 | %clean | |
125 | rm -rf $RPM_BUILD_ROOT | |
126 | ||
127 | %if %{with python2} | |
128 | %files | |
129 | %defattr(644,root,root,755) | |
336016a4 JB |
130 | %doc COPYING README.rst |
131 | %{py_sitescriptdir}/httpretty | |
132 | %{py_sitescriptdir}/httpretty-%{version}-py*.egg-info | |
90cb2092 | 133 | %endif |
90cb2092 AM |
134 | |
135 | %if %{with python3} | |
136 | %files -n python3-%{module} | |
137 | %defattr(644,root,root,755) | |
336016a4 JB |
138 | %doc COPYING README.rst |
139 | %{py3_sitescriptdir}/httpretty | |
140 | %{py3_sitescriptdir}/httpretty-%{version}-py*.egg-info | |
90cb2092 | 141 | %endif |
336016a4 JB |
142 | |
143 | %files apidocs | |
144 | %defattr(644,root,root,755) | |
145 | %doc docs/build/html/{_modules,_static,*.html,*.js} |