]> git.pld-linux.org Git - packages/protobuf.git/blob - protobuf.spec
- disable -Werror because of -Werror=type-limits false positive in gcc 10.2
[packages/protobuf.git] / protobuf.spec
1 # TODO:
2 # - add bindings for java (maven build)
3 # - add bindings for javascript
4 # - add bindings for csharp
5 #
6 # Conditional build:
7 %bcond_without  python2 # Python 2.x bindings
8 %bcond_without  python3 # Python 3.x bindings
9 %bcond_without  ruby    # Ruby bindings
10 %bcond_without  tests   # perform "make check"
11
12 Summary:        Protocol Buffers - Google's data interchange format
13 Summary(pl.UTF-8):      Protocol Buffers - format wymiany danych Google
14 Name:           protobuf
15 Version:        3.13.0
16 Release:        3
17 License:        BSD
18 Group:          Libraries
19 #Source0Download: https://github.com/google/protobuf/releases
20 Source0:        https://github.com/google/protobuf/releases/download/v%{version}/%{name}-all-%{version}.tar.gz
21 # Source0-md5:  cafa623d51361228c83c874d95f51992
22 Source1:        ftdetect-proto.vim
23 Patch0:         system-gtest.patch
24 Patch1:         no-wrap-memcpy.patch
25 Patch2:         %{name}-no-wheel.patch
26 URL:            https://github.com/google/protobuf/
27 BuildRequires:  autoconf >= 2.59
28 BuildRequires:  automake >= 1:1.9
29 %{?with_tests:BuildRequires:    gmock-devel >= 1.9.0}
30 %{?with_tests:BuildRequires:    gtest-devel >= 1.9.0}
31 BuildRequires:  libstdc++-devel >= 6:4.7
32 BuildRequires:  libtool
33 BuildRequires:  pkgconfig
34 %if %{with python2}
35 BuildRequires:  python-modules >= 1:2.7
36 BuildRequires:  python-setuptools
37 %endif
38 %if %{with python3}
39 BuildRequires:  python3-modules >= 1:3.3
40 BuildRequires:  python3-setuptools
41 %endif
42 %if %{with python2} || %{with python3}
43 BuildRequires:  rpm-pythonprov
44 %endif
45 BuildRequires:  rpmbuild(macros) >= 1.714
46 %if %{with ruby}
47 BuildRequires:  ruby-devel
48 BuildRequires:  ruby-rake
49 BuildRequires:  ruby-rake-compiler
50 %endif
51 BuildRequires:  sed >= 4.0
52 BuildRequires:  zlib-devel >= 1.2.0.4
53 Requires:       %{name}-libs = %{version}-%{release}
54 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55
56 %define         _vimdatadir     %{_datadir}/vim
57
58 # triggers bogus "overflow in constant expression" errors with gcc 4.9 .. 5.4
59 %define         filterout       -fwrapv
60
61 %description
62 Protocol Buffers are a way of encoding structured data in an efficient
63 yet extensible format. Google uses Protocol Buffers for almost all of
64 its internal RPC protocols and file formats.
65
66 Protocol buffers are a flexible, efficient, automated mechanism for
67 serializing structured data - think XML, but smaller, faster, and
68 simpler. You define how you want your data to be structured once, then
69 you can use special generated source code to easily write and read
70 your structured data to and from a variety of data streams and using a
71 variety of languages. You can even update your data structure without
72 breaking deployed programs that are compiled against the "old" format.
73
74 This package contains Protocol Buffers compiler for all programming
75 languages.
76
77 %description -l pl.UTF-8
78 Bufory protokołowe (Protocol Buffers) to sposób kodowania danych
79 strukturalnych w wydajny i rozszerzalny sposób. Google używa buforów
80 protokołowych do prawie wszystkich wewnętrznych protokołów RPC i
81 formatów plików.
82
83 Bufory protokołowe to elastyczny, wydajny i zautomatyzowany sposób
84 serializacji danych strukturalnych - podobny do XML-a, ale mniejszy,
85 szybszy i prostszy. Definiuje się raz, jaką strukturę mają mieć dane,
86 a następnie używa specjalnie wygenerowanego kodu źródłowego do łatwego
87 zapisu i odczytu danych strukturalnych do i z różnych strumieni
88 danych, z poziomu różnych języków. Można nawet uaktualniać strukturę
89 danych bez psucia programów skompilowanych w oparciu o "stary" format.
90
91 Ten pakiet zawiera kompilator buforów protokołowych dla wszystkich
92 języków programowania. 
93
94 %package libs
95 Summary:        Protocol Buffers library
96 Summary(pl.UTF-8):      Biblioteka buforów protokołowych (Protocol Buffers)
97 Group:          Libraries
98 Requires:       zlib >= 1.2.0.4
99
100 %description libs
101 Protocol Buffers library.
102
103 %description libs -l pl.UTF-8
104 Biblioteka buforów protokołowych (Protocol Buffers).
105
106 %package lite
107 Summary:        Protocol Buffers LITE_RUNTIME library
108 Summary(pl.UTF-8):      Biblioteka LITE_RUNTIME buforów protokołowych (Protocol Buffers)
109 Group:          Libraries
110
111 %description lite
112 Protocol Buffers library for programs built with optimize_for =
113 LITE_RUNTIME.
114
115 The "optimize_for = LITE_RUNTIME" option causes the compiler to
116 generate code which only depends libprotobuf-lite, which is much
117 smaller than libprotobuf but lacks descriptors, reflection, and some
118 other features.
119
120 %description lite -l pl.UTF-8
121 Biblioteka buforów protokołowych (Protocol Buffers) zbudowana dla
122 programów z opcją optimize_for = LITE_RUNTIME.
123
124 Opcja ta powoduje, że kompilator generuje kod, który wymaga tylko
125 biblioteki libprotobuf-lite, która jest mniejsza niż libprotobuf, ale
126 nie ma niektórych elementów, takich jak deskryptory czy refleksje.
127
128 %package devel
129 Summary:        Header files for Protocol Buffers libraries
130 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek buforów protokołowych (Protocol Buffers)
131 Group:          Development/Libraries
132 Requires:       %{name} = %{version}-%{release}
133 Requires:       %{name}-libs = %{version}-%{release}
134 Requires:       %{name}-lite = %{version}-%{release}
135 Requires:       libstdc++-devel >= 6:4.7
136
137 %description devel
138 Header files for Protocol Buffers libraries.
139
140 %description devel -l pl.UTF-8
141 Pliki nagłówkowe bibliotek buforów protokołowych (Protocol Buffers).
142
143 %package static
144 Summary:        Static Protocol Buffers libraries
145 Summary(pl.UTF-8):      Statyczne biblioteki buforów protokołowych (Protocol Buffers)
146 Group:          Development/Libraries
147 Requires:       %{name}-devel = %{version}-%{release}
148
149 %description static
150 Static Protocol Buffers libraries.
151
152 %description static -l pl.UTF-8
153 Statyczne biblioteki buforów protokołowych (Protocol Buffers).
154
155 %package -n python-protobuf
156 Summary:        Python 2 bindings for Protocol Buffers
157 Summary(pl.UTF-8):      Wiązania Pythona 2 do buforów protokołowych (Protocol Buffers)
158 Group:          Development/Languages/Python
159 Requires:       python-modules >= 1:2.7
160 # does not use C++ library at this time
161
162 %description -n python-protobuf
163 Python 2 bindings for Protocol Buffers.
164
165 %description -n python-protobuf -l pl.UTF-8
166 Wiązania Pythona 2 do buforów protokołowych (Protocol Buffers).
167
168 %package -n python3-protobuf
169 Summary:        Python 3 bindings for Protocol Buffers
170 Summary(pl.UTF-8):      Wiązania Pythona 3 do buforów protokołowych (Protocol Buffers)
171 Group:          Development/Languages/Python
172 Requires:       python3-modules >= 1:3.3
173 # does not use C++ library at this time
174
175 %description -n python3-protobuf
176 Python 3 bindings for Protocol Buffers.
177
178 %description -n python3-protobuf -l pl.UTF-8
179 Wiązania Pythona 3 do buforów protokołowych (Protocol Buffers).
180
181 %package -n ruby-google-protobuf
182 Summary:        Ruby bindings for Google Protocol Buffers
183 Summary(pl.UTF-8):      Wiązania języka Ruby do biblioteki Google Protocol Buffers
184 Group:          Development/Languages
185 Requires:       ruby
186
187 %description -n ruby-google-protobuf
188 Ruby bindings for Google Protocol Buffers.
189
190 %description -n ruby-google-protobuf -l pl.UTF-8
191 Wiązania języka Ruby do biblioteki Google Protocol Buffers.
192
193 %package -n vim-syntax-protobuf
194 Summary:        Vim syntax highlighting for Protocol Buffers descriptions
195 Summary(pl.UTF-8):      Podświetlanie składni Vima dla opisów buforów protokołowych (Protocol Buffers)
196 Group:          Development/Libraries
197 Requires:       vim-rt >= 4:7.2.170
198
199 %description -n vim-syntax-protobuf
200 This package contains syntax highlighting for Protocol Buffers
201 descriptions in Vim editor.
202
203 %description -n vim-syntax-protobuf -l pl.UTF-8
204 Ten pakiet zawiera pliki podświetlania składni edytora Vim dla
205 opisów buforów protokołowych (Protocol Buffers).
206
207 %prep
208 %setup -q
209 %patch0 -p1
210 %patch1 -p1
211 %patch2 -p1
212
213 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' \
214       examples/add_person.py \
215       examples/list_people.py
216
217 # gcc 10.2 false positive warning (with tag values >= 128):
218 #
219 #  if (tag < 128) {
220 #    return *ptr == tag;
221 #           ~~~~~^~~~~~ error: comparison is always false due to limited range of data type [-Werror=type-limits]
222 #  } else {
223 #
224 %{__sed} -i -e 's/-Werror //' src/Makefile.am
225
226 %build
227 %{__libtoolize}
228 %{__aclocal} -I m4
229 %{__autoconf}
230 %{__autoheader}
231 %{__automake}
232 # Additional variables defined according to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192821
233 %configure \
234         CFLAGS='%{rpmcflags} -DGOOGLE_PROTOBUF_NO_RTTI' \
235         CPPFLAGS='%{rpmcppflags} -DGOOGLE_PROTOBUF_NO_RTTI' \
236         --disable-silent-rules \
237         --disable-external-gtest
238 %{__make}
239
240 cd python
241 %if %{with python2}
242 %py_build
243 %endif
244 %if %{with python3}
245 %py3_build
246 %endif
247 cd ..
248
249 %if %{with ruby}
250 cd ruby
251 rake
252 #rake clobber_package gem
253 cd ..
254 %endif
255
256 %if %{with tests}
257 %{__make} check
258 %endif
259
260 %install
261 rm -rf $RPM_BUILD_ROOT
262 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
263
264 %{__make} install \
265         STRIPBINARIES=no \
266         INSTALL="install -p"  \
267         CPPROG="cp -p" \
268         DESTDIR=$RPM_BUILD_ROOT
269
270 install -d $RPM_BUILD_ROOT%{_vimdatadir}/{syntax,ftdetect}
271 cp -p editors/proto.vim $RPM_BUILD_ROOT%{_vimdatadir}/syntax/proto.vim
272 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_vimdatadir}/ftdetect/proto.vim
273
274 cd python
275 %if %{with python2}
276 %py_install
277 %py_postclean
278 %endif
279 %if %{with python3}
280 %py3_install
281 %endif
282 cd ..
283
284 %if %{with ruby}
285 install -d $RPM_BUILD_ROOT{%{ruby_vendorarchdir}/google,%{ruby_vendorlibdir}/google,%{ruby_specdir}}
286 install ruby/lib/google/protobuf_c.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}/google
287 cp -pr ruby/lib/google/{protobuf,protobuf.rb} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/google
288 cp -p ruby/google-protobuf.gemspec $RPM_BUILD_ROOT%{ruby_specdir}/google-protobuf-%{version}.gemspec
289 %endif
290 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
291
292 %clean
293 rm -rf $RPM_BUILD_ROOT
294
295 %post   -p /sbin/ldconfig
296 %postun -p /sbin/ldconfig
297
298 %post   libs -p /sbin/ldconfig
299 %postun libs -p /sbin/ldconfig
300
301 %post   lite -p /sbin/ldconfig
302 %postun lite -p /sbin/ldconfig
303
304 %files
305 %defattr(644,root,root,755)
306 %doc CHANGES.txt CONTRIBUTORS.txt LICENSE README.md
307 %attr(755,root,root) %{_bindir}/protoc
308 %attr(755,root,root) %{_libdir}/libprotoc.so.*.*.*
309 %attr(755,root,root) %ghost %{_libdir}/libprotoc.so.24
310
311 %files libs
312 %defattr(644,root,root,755)
313 %attr(755,root,root) %{_libdir}/libprotobuf.so.*.*.*
314 %attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.24
315
316 %files lite
317 %defattr(644,root,root,755)
318 %attr(755,root,root) %{_libdir}/libprotobuf-lite.so.*.*.*
319 %attr(755,root,root) %ghost %{_libdir}/libprotobuf-lite.so.24
320
321 %files devel
322 %defattr(644,root,root,755)
323 %attr(755,root,root) %{_libdir}/libprotobuf-lite.so
324 %attr(755,root,root) %{_libdir}/libprotobuf.so
325 %attr(755,root,root) %{_libdir}/libprotoc.so
326 %{_libdir}/libprotobuf-lite.la
327 %{_libdir}/libprotobuf.la
328 %{_libdir}/libprotoc.la
329 # XXX: dir shared with libtcmalloc
330 %dir %{_includedir}/google
331 %{_includedir}/google/protobuf
332 %{_pkgconfigdir}/protobuf-lite.pc
333 %{_pkgconfigdir}/protobuf.pc
334 %{_examplesdir}/%{name}-%{version}
335
336 %files static
337 %defattr(644,root,root,755)
338 %{_libdir}/libprotobuf-lite.a
339 %{_libdir}/libprotobuf.a
340 %{_libdir}/libprotoc.a
341
342 %if %{with python2}
343 %files -n python-protobuf
344 %defattr(644,root,root,755)
345 %doc python/README.md
346 %dir %{py_sitescriptdir}/google
347 %{py_sitescriptdir}/google/protobuf
348 %{py_sitescriptdir}/protobuf-%{version}-py*.egg-info
349 %{py_sitescriptdir}/protobuf-%{version}-py*-nspkg.pth
350 %endif
351
352 %if %{with python3}
353 %files -n python3-protobuf
354 %defattr(644,root,root,755)
355 %doc python/README.md
356 %dir %{py3_sitescriptdir}/google
357 %{py3_sitescriptdir}/google/protobuf
358 %{py3_sitescriptdir}/protobuf-%{version}-py*.egg-info
359 %{py3_sitescriptdir}/protobuf-%{version}-py*-nspkg.pth
360 %endif
361
362 %if %{with ruby}
363 %files -n ruby-google-protobuf
364 %defattr(644,root,root,755)
365 %doc ruby/README.md
366 %dir %{ruby_vendorarchdir}/google
367 %attr(755,root,root) %{ruby_vendorarchdir}/google/protobuf_c.so
368 %dir %{ruby_vendorlibdir}/google
369 %{ruby_vendorlibdir}/google/protobuf.rb
370 %{ruby_vendorlibdir}/google/protobuf
371 %{ruby_specdir}/google-protobuf-%{version}.gemspec
372 %endif
373
374 %files -n vim-syntax-protobuf
375 %defattr(644,root,root,755)
376 %{_datadir}/vim/ftdetect/proto.vim
377 %{_datadir}/vim/syntax/proto.vim
This page took 0.097066 seconds and 4 git commands to generate.