]>
Commit | Line | Data |
---|---|---|
3e7da56f JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # unit tests | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | Summary: hyper-h2 - HTTP/2 protocol stack | |
9 | Summary(pl.UTF-8): hyper-h2 - stos protokołu HTTP/2 | |
10 | Name: python-h2 | |
b8591bbb | 11 | # keep 3.x here for python2 support |
3e7da56f | 12 | Version: 3.2.0 |
bfaf0f4d | 13 | Release: 5 |
3e7da56f JB |
14 | License: MIT |
15 | Group: Libraries/Python | |
16 | #Source0Download: https://pypi.org/simple/h2/ | |
17 | Source0: https://files.pythonhosted.org/packages/source/h/h2/h2-%{version}.tar.gz | |
18 | # Source0-md5: 197a99c09f344a0dd987fab9801dc8d0 | |
19 | URL: https://pypi.org/project/h2/ | |
20 | %if %{with python2} | |
21 | BuildRequires: python-modules >= 1:2.7 | |
22 | BuildRequires: python-setuptools | |
23 | %if %{with tests} | |
24 | BuildRequires: python-enum34 >= 1.1.6 | |
25 | BuildRequires: python-enum34 < 2 | |
26 | BuildRequires: python-hpack >= 3.0 | |
27 | BuildRequires: python-hpack < 4 | |
28 | BuildRequires: python-hyperframe >= 5.2.0 | |
29 | BuildRequires: python-hyperframe < 6 | |
30 | BuildRequires: python-hypothesis | |
b8591bbb | 31 | BuildRequires: python-pytest >= 4.6.5 |
3e7da56f JB |
32 | %endif |
33 | %endif | |
34 | %if %{with python3} | |
35 | BuildRequires: python3-modules >= 1:3.4 | |
36 | BuildRequires: python3-setuptools | |
37 | %if %{with tests} | |
38 | BuildRequires: python3-hpack >= 3.0 | |
39 | BuildRequires: python3-hpack < 4 | |
40 | BuildRequires: python3-hyperframe >= 5.2.0 | |
41 | BuildRequires: python3-hyperframe < 6 | |
42 | BuildRequires: python3-hypothesis | |
b8591bbb | 43 | BuildRequires: python3-pytest >= 4.6.5 |
3e7da56f JB |
44 | %endif |
45 | %endif | |
46 | BuildRequires: rpm-pythonprov | |
47 | BuildRequires: rpmbuild(macros) >= 1.714 | |
48 | %if %{with doc} | |
49 | BuildRequires: sphinx-pdg | |
50 | %endif | |
51 | Requires: python-modules >= 1:2.7 | |
52 | BuildArch: noarch | |
53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
54 | ||
55 | %description | |
56 | This package is a pure-Python implementation of a HTTP/2 protocol | |
57 | stack. It's written from the ground up to be embeddable in whatever | |
58 | program you choose to use, ensuring that you can speak HTTP/2 | |
59 | regardless of your programming paradigm. | |
60 | ||
61 | %description -l pl.UTF-8 | |
62 | Ten pakiet to czysto pythonowa implementacja stosu protokołu HTTP/2. | |
63 | Jest napisana od podstaw tak, aby była osadzalna w dowolnym programie, | |
64 | zapewniając obsługę HTTP/2 niezależnie od paradygmatu programowania. | |
65 | ||
66 | %package -n python3-h2 | |
67 | Summary: hyper-h2 - HTTP/2 protocol stack | |
68 | Summary(pl.UTF-8): hyper-h2 - stos protokołu HTTP/2 | |
69 | Group: Libraries/Python | |
70 | Requires: python3-modules >= 1:3.4 | |
71 | ||
72 | %description -n python3-h2 | |
73 | This package is a pure-Python implementation of a HTTP/2 protocol | |
74 | stack. It's written from the ground up to be embeddable in whatever | |
75 | program you choose to use, ensuring that you can speak HTTP/2 | |
76 | regardless of your programming paradigm. | |
77 | ||
78 | %description -n python3-h2 -l pl.UTF-8 | |
79 | Ten pakiet to czysto pythonowa implementacja stosu protokołu HTTP/2. | |
80 | Jest napisana od podstaw tak, aby była osadzalna w dowolnym programie, | |
81 | zapewniając obsługę HTTP/2 niezależnie od paradygmatu programowania. | |
82 | ||
83 | %package apidocs | |
84 | Summary: API documentation for Python h2 module | |
85 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona h2 | |
86 | Group: Documentation | |
87 | ||
88 | %description apidocs | |
89 | API documentation for Python h2 module. | |
90 | ||
91 | %description apidocs -l pl.UTF-8 | |
92 | Dokumentacja API modułu Pythona h2. | |
93 | ||
94 | %prep | |
95 | %setup -q -n h2-%{version} | |
96 | ||
97 | %build | |
98 | %if %{with python2} | |
99 | %py_build | |
100 | ||
101 | %if %{with tests} | |
b8591bbb | 102 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
3e7da56f JB |
103 | %{__python} -m pytest test |
104 | %endif | |
105 | %endif | |
106 | ||
107 | %if %{with python3} | |
108 | %py3_build | |
109 | ||
110 | %if %{with tests} | |
b8591bbb | 111 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
3e7da56f JB |
112 | %{__python3} -m pytest test |
113 | %endif | |
114 | %endif | |
115 | ||
116 | %if %{with doc} | |
117 | %{__make} -C docs html | |
118 | %endif | |
119 | ||
120 | %install | |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
123 | %if %{with python2} | |
124 | %py_install | |
125 | ||
126 | %py_postclean | |
127 | %endif | |
128 | ||
129 | %if %{with python3} | |
130 | %py3_install | |
131 | %endif | |
132 | ||
133 | %clean | |
134 | rm -rf $RPM_BUILD_ROOT | |
135 | ||
136 | %if %{with python2} | |
137 | %files | |
138 | %defattr(644,root,root,755) | |
139 | %doc CONTRIBUTORS.rst HISTORY.rst LICENSE README.rst | |
140 | %{py_sitescriptdir}/h2 | |
141 | %{py_sitescriptdir}/h2-%{version}-py*.egg-info | |
142 | %endif | |
143 | ||
144 | %if %{with python3} | |
145 | %files -n python3-h2 | |
146 | %defattr(644,root,root,755) | |
147 | %doc CONTRIBUTORS.rst HISTORY.rst LICENSE README.rst | |
148 | %{py3_sitescriptdir}/h2 | |
149 | %{py3_sitescriptdir}/h2-%{version}-py*.egg-info | |
150 | %endif | |
151 | ||
152 | %if %{with doc} | |
153 | %files apidocs | |
154 | %defattr(644,root,root,755) | |
155 | %doc docs/build/html/{_images,_modules,_static,*.html,*.js} | |
156 | %endif |