]>
Commit | Line | Data |
---|---|---|
5c52e332 ER |
1 | # |
2 | # Conditional build: | |
8fa05030 | 3 | %bcond_without python2 # CPython 2.x module |
5c52e332 | 4 | %bcond_without python3 # CPython 3.x module |
8fa05030 JB |
5 | %bcond_without doc # Sphinx documentation |
6 | %bcond_without tests # unit tests | |
5c52e332 | 7 | |
12cb6b96 MB |
8 | %define module WebOb |
9 | Summary: WSGI request and response object | |
8fa05030 | 10 | Summary(pl.UTF-8): Obiekty żądań i odpowiedzi WSGI |
12cb6b96 | 11 | Name: python-%{module} |
62fa2b72 | 12 | Version: 1.8.5 |
34783247 | 13 | Release: 5 |
12cb6b96 | 14 | License: MIT |
8fa05030 JB |
15 | Group: Libraries/Python |
16 | #Source0Download: https://pypi.org/simple/WebOb/ | |
17 | Source0: https://files.pythonhosted.org/packages/source/W/WebOb/%{module}-%{version}.tar.gz | |
62fa2b72 | 18 | # Source0-md5: 1761f416e8cf53f6fb674149cc223bd1 |
8fa05030 JB |
19 | URL: https://webob.org/ |
20 | %if %{with python2} | |
21 | BuildRequires: python-devel >= 1:2.7 | |
12cb6b96 | 22 | BuildRequires: python-setuptools |
8fa05030 JB |
23 | %if %{with tests} |
24 | BuildRequires: python-pytest >= 3.1.0 | |
25 | %endif | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-devel >= 1:3.4 | |
29 | BuildRequires: python3-setuptools | |
30 | %if %{with tests} | |
31 | BuildRequires: python3-pytest >= 3.1.0 | |
32 | %endif | |
33 | %endif | |
12cb6b96 | 34 | BuildRequires: rpm-pythonprov |
8fa05030 JB |
35 | BuildRequires: rpmbuild(macros) >= 1.714 |
36 | %if %{with doc} | |
62fa2b72 JB |
37 | BuildRequires: python3-pylons-sphinx-themes |
38 | BuildRequires: sphinx-pdg-3 >= 1.7.5 | |
8fa05030 JB |
39 | %endif |
40 | Requires: python-modules >= 1:2.7 | |
12cb6b96 MB |
41 | BuildArch: noarch |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
44 | %description | |
45 | WebOb provides wrappers around the WSGI request environment, and an | |
46 | object to help create WSGI responses. | |
47 | ||
48 | The objects map much of the specified behavior of HTTP, including | |
49 | header parsing and accessors for other standard parts of the | |
50 | environment. | |
51 | ||
8fa05030 JB |
52 | %description -l pl.UTF-8 |
53 | Moduł WebOb udostępnia opakowanie środowiska żądań WSGI oraz | |
54 | obiekty pomagające przy tworzeniu odpowiedzi WSGI. | |
55 | ||
56 | Obiekty odwzorowują większość określonego zachowania HTTP, w tym | |
57 | analizę nagłówków oraz dostęp do innych standardowych elementów | |
58 | środowiska. | |
59 | ||
5c52e332 | 60 | %package -n python3-%{module} |
8fa05030 JB |
61 | Summary: WSGI request and response object |
62 | Summary(pl.UTF-8): Obiekty żądań i odpowiedzi WSGI | |
5c52e332 ER |
63 | Group: Libraries/Python |
64 | ||
65 | %description -n python3-%{module} | |
66 | WebOb provides wrappers around the WSGI request environment, and an | |
67 | object to help create WSGI responses. | |
68 | ||
69 | The objects map much of the specified behavior of HTTP, including | |
70 | header parsing and accessors for other standard parts of the | |
71 | environment. | |
72 | ||
8fa05030 JB |
73 | %description -n python3-%{module} -l pl.UTF-8 |
74 | Moduł WebOb udostępnia opakowanie środowiska żądań WSGI oraz | |
75 | obiekty pomagające przy tworzeniu odpowiedzi WSGI. | |
76 | ||
77 | Obiekty odwzorowują większość określonego zachowania HTTP, w tym | |
78 | analizę nagłówków oraz dostęp do innych standardowych elementów | |
79 | środowiska. | |
80 | ||
81 | %package apidocs | |
82 | Summary: API documentation for Python WebOb module | |
83 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona WebOb | |
84 | Group: Documentation | |
85 | ||
86 | %description apidocs | |
87 | API documentation for Python WebOb module. | |
88 | ||
89 | %description apidocs -l pl.UTF-8 | |
90 | Dokumentacja API modułu Pythona WebOb. | |
91 | ||
12cb6b96 MB |
92 | %prep |
93 | %setup -q -n %{module}-%{version} | |
94 | ||
95 | %build | |
8fa05030 | 96 | %if %{with python2} |
3c9cadf5 | 97 | %py_build |
12cb6b96 | 98 | |
8fa05030 JB |
99 | %if %{with tests} |
100 | PYTHONPATH=$(pwd)/src \ | |
101 | %{__python} -m unittest discover -s tests | |
102 | %endif | |
103 | %endif | |
104 | ||
5c52e332 | 105 | %if %{with python3} |
3c9cadf5 | 106 | %py3_build |
8fa05030 JB |
107 | |
108 | %if %{with tests} | |
109 | PYTHONPATH=$(pwd)/src \ | |
110 | %{__python3} -m unittest discover -s tests | |
111 | %endif | |
112 | %endif | |
113 | ||
114 | %if %{with doc} | |
115 | PYTHONPATH=$(pwd)/src \ | |
62fa2b72 JB |
116 | %{__make} -C docs html \ |
117 | SPHINXBUILD=sphinx-build-3 | |
5c52e332 ER |
118 | %endif |
119 | ||
12cb6b96 MB |
120 | %install |
121 | rm -rf $RPM_BUILD_ROOT | |
8fa05030 JB |
122 | |
123 | %if %{with python2} | |
3c9cadf5 | 124 | %py_install |
12cb6b96 MB |
125 | |
126 | %py_postclean | |
8fa05030 | 127 | %endif |
12cb6b96 | 128 | |
5c52e332 | 129 | %if %{with python3} |
3c9cadf5 | 130 | %py3_install |
5c52e332 ER |
131 | %endif |
132 | ||
12cb6b96 MB |
133 | %clean |
134 | rm -rf $RPM_BUILD_ROOT | |
135 | ||
8fa05030 | 136 | %if %{with python2} |
12cb6b96 MB |
137 | %files |
138 | %defattr(644,root,root,755) | |
8fa05030 JB |
139 | %doc CHANGES.txt HISTORY.txt README.rst docs/license.txt |
140 | %{py_sitescriptdir}/webob | |
5c52e332 ER |
141 | %{py_sitescriptdir}/WebOb-%{version}-py*.egg-info |
142 | %endif | |
143 | ||
144 | %if %{with python3} | |
145 | %files -n python3-%{module} | |
146 | %defattr(644,root,root,755) | |
8fa05030 JB |
147 | %doc CHANGES.txt HISTORY.txt README.rst docs/license.txt |
148 | %{py3_sitescriptdir}/webob | |
5c52e332 | 149 | %{py3_sitescriptdir}/WebOb-%{version}-py*.egg-info |
12cb6b96 | 150 | %endif |
8fa05030 JB |
151 | |
152 | %if %{with doc} | |
153 | %files apidocs | |
154 | %defattr(644,root,root,755) | |
155 | %doc docs/_build/html/{_static,api,experimental,*.html,*.js} | |
156 | %endif |