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