]>
Commit | Line | Data |
---|---|---|
b0744631 | 1 | # TODO: mruby, neverbleed? |
7e68a898 JB |
2 | # |
3 | # Conditional build: | |
5ebd5855 | 4 | %bcond_without asio # libnghttp2_asio C++ library |
35859362 JB |
5 | %bcond_with http3 # experimental HTTP/3 support |
6 | %bcond_with libbpf # BPF support (requires CC=clang) | |
5ebd5855 JB |
7 | %bcond_without static_libs # static libraries |
8 | %bcond_without tests # "make check" call | |
7e68a898 JB |
9 | |
10 | Summary: HTTP/2.0 C library | |
11 | Summary(pl.UTF-8): Biblioteka C HTTP/2.0 | |
12 | Name: nghttp2 | |
b8ceb2d3 | 13 | Version: 1.47.0 |
b20f53ed | 14 | Release: 1 |
7e68a898 JB |
15 | License: MIT |
16 | Group: Libraries | |
27bc50c7 JB |
17 | #Source0Download: https://github.com/nghttp2/nghttp2/releases |
18 | Source0: https://github.com/nghttp2/nghttp2/releases/download/v%{version}/%{name}-%{version}.tar.xz | |
b8ceb2d3 | 19 | # Source0-md5: 6c8c35dd14a36673a9b86a7892b800f8 |
5ebd5855 | 20 | Patch0: %{name}-link.patch |
7a45bd4f | 21 | Patch1: %{name}-python.patch |
27bc50c7 | 22 | URL: https://nghttp2.org/ |
7e68a898 JB |
23 | %{?with_tests:BuildRequires: CUnit >= 2.1} |
24 | BuildRequires: autoconf >= 2.61 | |
25 | BuildRequires: automake | |
5ebd5855 | 26 | %{?with_asio:BuildRequires: boost-devel >= 1.54.0} |
9f92d897 | 27 | BuildRequires: c-ares-devel >= 1.7.5 |
c02473f3 | 28 | BuildRequires: jansson-devel >= 2.5 |
35859362 | 29 | %{?with_libbpf:BuildRequires: libbpf-devel >= 0.7.0} |
5ebd5855 | 30 | BuildRequires: libev-devel |
9f92d897 | 31 | # for examples |
7e68a898 | 32 | BuildRequires: libevent-devel >= 2.0.8 |
35859362 | 33 | BuildRequires: libstdc++-devel >= 6:5 |
7e68a898 | 34 | BuildRequires: libtool >= 2:2.2.6 |
b0744631 | 35 | BuildRequires: libxml2-devel >= 1:2.6.26 |
35859362 JB |
36 | %{?with_http3:BuildRequires: nghttp3-devel >= 0.2.0} |
37 | %{?with_http3:BuildRequires: ngtcp2-devel >= 0.2.0} | |
7e68a898 | 38 | BuildRequires: openssl-devel >= 1.0.1 |
35859362 | 39 | %{?with_http3:BuildRequires: openssl-devel(quic)} |
7e68a898 | 40 | BuildRequires: pkgconfig >= 1:0.20 |
f04ce4b6 JP |
41 | BuildRequires: python3 >= 1:3.8 |
42 | BuildRequires: python3-Cython >= 0.19 | |
43 | BuildRequires: python3-devel >= 1:3.8 | |
44 | BuildRequires: python3-setuptools | |
7e35cf68 | 45 | BuildRequires: rpm-pythonprov |
26b1a5cb | 46 | BuildRequires: rpmbuild(macros) >= 1.734 |
55ef14c3 | 47 | BuildRequires: sed >= 4.0 |
9f92d897 | 48 | BuildRequires: systemd-devel >= 1:209 |
7e68a898 JB |
49 | BuildRequires: tar >= 1:1.22 |
50 | BuildRequires: xz | |
51 | BuildRequires: zlib-devel >= 1.2.3 | |
218ea8da | 52 | Requires: %{name}-libs = %{version}-%{release} |
9f92d897 JB |
53 | Requires: c-ares >= 1.7.5 |
54 | Requires: jansson >= 2.5 | |
55 | # noinst examples only | |
56 | #Requires: libevent >= 2.0.8 | |
b0744631 | 57 | Requires: libxml2 >= 1:2.6.26 |
9f92d897 | 58 | Requires: openssl >= 1.0.1 |
9f92d897 | 59 | Requires: zlib >= 1.2.3 |
7e68a898 JB |
60 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
61 | ||
62 | %description | |
63 | This is an experimental implementation of Hypertext Transfer Protocol | |
64 | version 2.0. | |
65 | ||
66 | %description -l pl.UTF-8 | |
67 | Ta biblioteka jest eksperymentalną implementacją protokołu HTTP | |
68 | (Hypertext Transfer Protocol) w wersji 2.0. | |
69 | ||
218ea8da ER |
70 | %package libs |
71 | Summary: A library implementing the HTTP/2 protocol | |
27bc50c7 | 72 | Summary(pl.UTF-8): Biblioteka implementująca protokół HTTP/2 |
218ea8da | 73 | Group: Libraries |
218ea8da ER |
74 | Conflicts: nghttp2 < 1.11.1-2 |
75 | ||
76 | %description libs | |
77 | libnghttp2 is a library implementing the Hypertext Transfer Protocol | |
78 | version 2 (HTTP/2) protocol in C. | |
79 | ||
27bc50c7 JB |
80 | %description libs -l pl.UTF-8 |
81 | libnghttp2 to napisana w C biblioteka implementująca protokół HTTP/2 | |
82 | (Hypertext Transfer Protocol w wersji 2). | |
83 | ||
7e68a898 JB |
84 | %package devel |
85 | Summary: Files needed for developing with libnghttp2 | |
86 | Summary(pl.UTF-8): Pliki niezbędne do tworzenia aplikacji z użyciem libnghttp2 | |
87 | Group: Development/Libraries | |
218ea8da | 88 | Requires: %{name}-libs = %{version}-%{release} |
7e68a898 JB |
89 | |
90 | %description devel | |
91 | Files needed for building applications with libnghttp2. | |
92 | ||
93 | %description devel -l pl.UTF-8 | |
94 | Pliki niezbędne do tworzenia aplikacji z użyciem libnghttp2. | |
95 | ||
96 | %package static | |
97 | Summary: Static libnghttp2 library | |
98 | Summary(pl.UTF-8): Statyczna biblioteka libnghttp2 | |
99 | Group: Development/Libraries | |
100 | Requires: %{name}-devel = %{version}-%{release} | |
101 | ||
102 | %description static | |
103 | Static libnghttp2 library. | |
104 | ||
105 | %description static -l pl.UTF-8 | |
106 | Statyczna biblioteka libnghttp2. | |
107 | ||
f04ce4b6 | 108 | %package -n python3-nghttp2 |
90ff5ae9 JB |
109 | Summary: Python binding to nghttp2 library |
110 | Summary(pl.UTF-8): Wiązanie Pythona do biblioteki nghttp2 | |
111 | Group: Libraries/Python | |
112 | Requires: %{name} = %{version}-%{release} | |
f04ce4b6 JP |
113 | Requires: python3-libs >= 1:3.8 |
114 | Obsoletes: python-nghttp2 < 1.43.0 | |
90ff5ae9 | 115 | |
f04ce4b6 | 116 | %description -n python3-nghttp2 |
90ff5ae9 JB |
117 | Python binding to nghttp2 library. |
118 | ||
f04ce4b6 | 119 | %description -n python3-nghttp2 -l pl.UTF-8 |
90ff5ae9 JB |
120 | Wiązanie Pythona do biblioteki nghttp2. |
121 | ||
5ebd5855 JB |
122 | %package asio |
123 | Summary: HTTP/2.0 C++ library | |
124 | Summary(pl.UTF-8): Biblioteka C++ HTTP/2.0 | |
125 | Group: Libraries | |
218ea8da | 126 | Requires: %{name}-libs = %{version}-%{release} |
5ebd5855 JB |
127 | Requires: openssl >= 1.0.1 |
128 | ||
129 | %description asio | |
130 | HTTP/2.0 C++ library. | |
131 | ||
132 | %description asio -l pl.UTF-8 | |
133 | Biblioteka C++ HTTP/2.0. | |
134 | ||
135 | %package asio-devel | |
136 | Summary: Header file for nghttp2_asio library | |
137 | Summary(pl.UTF-8): Plik nagłówkowy biblioteki nghttp2_asio | |
138 | Group: Development/Libraries | |
139 | Requires: %{name}-asio = %{version}-%{release} | |
140 | Requires: %{name}-devel = %{version}-%{release} | |
35859362 | 141 | Requires: libstdc++-devel >= 6:5 |
5ebd5855 JB |
142 | |
143 | %description asio-devel | |
144 | Header file for nghttp2_asio library. | |
145 | ||
146 | %description asio-devel -l pl.UTF-8 | |
147 | Plik nagłówkowy biblioteki nghttp2_asio. | |
148 | ||
149 | %package asio-static | |
150 | Summary: Static libnghttp2_asio library | |
151 | Summary(pl.UTF-8): Statyczna biblioteka libnghttp2_asio | |
152 | Group: Development/Libraries | |
153 | Requires: %{name}-asio-devel = %{version}-%{release} | |
154 | ||
155 | %description asio-static | |
156 | Static libnghttp2_asio library. | |
157 | ||
158 | %description asio-static -l pl.UTF-8 | |
159 | Statyczna biblioteka libnghttp2_asio. | |
160 | ||
7e68a898 | 161 | %prep |
90ff5ae9 | 162 | %setup -q |
5ebd5855 | 163 | %patch0 -p1 |
7a45bd4f | 164 | %patch1 -p1 |
7e68a898 | 165 | |
2a3e23c4 | 166 | %{__sed} -i -e '1s,/usr/bin/env python,%{__python3},' script/fetch-ocsp-response |
55ef14c3 | 167 | |
7e68a898 JB |
168 | %build |
169 | %{__libtoolize} | |
170 | %{__aclocal} -I m4 | |
171 | %{__autoconf} | |
172 | %{__autoheader} | |
173 | %{__automake} | |
174 | %configure \ | |
5ebd5855 JB |
175 | --enable-app \ |
176 | %{?with_asio:--enable-asio-lib} \ | |
177 | --enable-hpack-tools \ | |
35859362 | 178 | %{?with_http3:--enable-http3} \ |
5ebd5855 | 179 | --enable-python-bindings \ |
2fcd3974 | 180 | --disable-silent-rules \ |
5ebd5855 | 181 | %{!?with_static_libs:--disable-static} \ |
76a36a9f | 182 | --with-cython=/usr/bin/cython3 \ |
35859362 JB |
183 | --without-jemalloc \ |
184 | %{?with_libbpf:--with-libbpf} | |
7e68a898 JB |
185 | |
186 | %{__make} | |
187 | ||
188 | %if %{with tests} | |
189 | %{__make} check | |
190 | %endif | |
191 | ||
192 | %install | |
193 | rm -rf $RPM_BUILD_ROOT | |
194 | ||
195 | %{__make} install \ | |
196 | DESTDIR=$RPM_BUILD_ROOT | |
197 | ||
198 | # obsoleted by pkg-config | |
5ebd5855 | 199 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libnghttp2*.la |
7e68a898 JB |
200 | # packaged as %doc |
201 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/nghttp2 | |
202 | ||
203 | %clean | |
204 | rm -rf $RPM_BUILD_ROOT | |
205 | ||
218ea8da ER |
206 | %post libs -p /sbin/ldconfig |
207 | %postun libs -p /sbin/ldconfig | |
7e68a898 | 208 | |
5ebd5855 JB |
209 | %post asio -p /sbin/ldconfig |
210 | %postun asio -p /sbin/ldconfig | |
211 | ||
7e68a898 JB |
212 | %files |
213 | %defattr(644,root,root,755) | |
b375e37d | 214 | %doc AUTHORS COPYING ChangeLog README.rst |
90ff5ae9 | 215 | %attr(755,root,root) %{_bindir}/deflatehd |
2fcd3974 | 216 | %attr(755,root,root) %{_bindir}/h2load |
90ff5ae9 | 217 | %attr(755,root,root) %{_bindir}/inflatehd |
7e68a898 JB |
218 | %attr(755,root,root) %{_bindir}/nghttp |
219 | %attr(755,root,root) %{_bindir}/nghttpd | |
220 | %attr(755,root,root) %{_bindir}/nghttpx | |
55ef14c3 JB |
221 | %dir %{_datadir}/nghttp2 |
222 | %attr(755,root,root) %{_datadir}/nghttp2/fetch-ocsp-response | |
2fcd3974 | 223 | %{_mandir}/man1/h2load.1* |
90ff5ae9 JB |
224 | %{_mandir}/man1/nghttp.1* |
225 | %{_mandir}/man1/nghttpd.1* | |
226 | %{_mandir}/man1/nghttpx.1* | |
7e68a898 | 227 | |
218ea8da ER |
228 | %files libs |
229 | %defattr(644,root,root,755) | |
230 | %attr(755,root,root) %{_libdir}/libnghttp2.so.*.*.* | |
231 | %attr(755,root,root) %ghost %{_libdir}/libnghttp2.so.14 | |
232 | ||
7e68a898 JB |
233 | %files devel |
234 | %defattr(644,root,root,755) | |
235 | %attr(755,root,root) %{_libdir}/libnghttp2.so | |
5ebd5855 JB |
236 | %dir %{_includedir}/nghttp2 |
237 | %{_includedir}/nghttp2/nghttp2*.h | |
7e68a898 JB |
238 | %{_pkgconfigdir}/libnghttp2.pc |
239 | ||
240 | %if %{with static_libs} | |
241 | %files static | |
242 | %defattr(644,root,root,755) | |
243 | %{_libdir}/libnghttp2.a | |
244 | %endif | |
90ff5ae9 | 245 | |
f04ce4b6 | 246 | %files -n python3-nghttp2 |
90ff5ae9 | 247 | %defattr(644,root,root,755) |
f04ce4b6 JP |
248 | %attr(755,root,root) %{py3_sitedir}/nghttp2.cpython-*.so |
249 | %{py3_sitedir}/python_nghttp2-%{version}-py*.egg-info | |
5ebd5855 JB |
250 | |
251 | %if %{with asio} | |
252 | %files asio | |
253 | %defattr(644,root,root,755) | |
254 | %attr(755,root,root) %{_libdir}/libnghttp2_asio.so.*.*.* | |
4a039389 | 255 | %attr(755,root,root) %ghost %{_libdir}/libnghttp2_asio.so.1 |
5ebd5855 JB |
256 | |
257 | %files asio-devel | |
258 | %defattr(644,root,root,755) | |
259 | %attr(755,root,root) %{_libdir}/libnghttp2_asio.so | |
260 | %{_includedir}/nghttp2/asio_http2.h | |
4a039389 AM |
261 | %{_includedir}/nghttp2/asio_http2_client.h |
262 | %{_includedir}/nghttp2/asio_http2_server.h | |
5ebd5855 JB |
263 | %{_pkgconfigdir}/libnghttp2_asio.pc |
264 | ||
265 | %if %{with static_libs} | |
266 | %files asio-static | |
267 | %defattr(644,root,root,755) | |
268 | %{_libdir}/libnghttp2_asio.a | |
269 | %endif | |
270 | %endif |