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