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