2 # - add bindings for java (maven build)
3 # - add bindings for javascript
4 # - add bindings for csharp
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"
12 Summary: Protocol Buffers - Google's data interchange format
13 Summary(pl.UTF-8): Protocol Buffers - format wymiany danych Google
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
35 BuildRequires: python-modules >= 1:2.7
36 BuildRequires: python-setuptools
39 BuildRequires: python3-modules >= 1:3.3
40 BuildRequires: python3-setuptools
42 %if %{with python2} || %{with python3}
43 BuildRequires: rpm-pythonprov
45 BuildRequires: rpmbuild(macros) >= 1.714
47 BuildRequires: ruby-devel
48 BuildRequires: ruby-rake
49 BuildRequires: ruby-rake-compiler
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)
56 %define _vimdatadir %{_datadir}/vim
58 # triggers bogus "overflow in constant expression" errors with gcc 4.9 .. 5.4
59 %define filterout -fwrapv
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.
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.
74 This package contains Protocol Buffers compiler for all programming
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
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.
91 Ten pakiet zawiera kompilator buforów protokołowych dla wszystkich
92 języków programowania.
95 Summary: Protocol Buffers library
96 Summary(pl.UTF-8): Biblioteka buforów protokołowych (Protocol Buffers)
98 Requires: zlib >= 1.2.0.4
101 Protocol Buffers library.
103 %description libs -l pl.UTF-8
104 Biblioteka buforów protokołowych (Protocol Buffers).
107 Summary: Protocol Buffers LITE_RUNTIME library
108 Summary(pl.UTF-8): Biblioteka LITE_RUNTIME buforów protokołowych (Protocol Buffers)
112 Protocol Buffers library for programs built with optimize_for =
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
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.
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.
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
138 Header files for Protocol Buffers libraries.
140 %description devel -l pl.UTF-8
141 Pliki nagłówkowe bibliotek buforów protokołowych (Protocol Buffers).
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}
150 Static Protocol Buffers libraries.
152 %description static -l pl.UTF-8
153 Statyczne biblioteki buforów protokołowych (Protocol Buffers).
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
162 %description -n python-protobuf
163 Python 2 bindings for Protocol Buffers.
165 %description -n python-protobuf -l pl.UTF-8
166 Wiązania Pythona 2 do buforów protokołowych (Protocol Buffers).
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
175 %description -n python3-protobuf
176 Python 3 bindings for Protocol Buffers.
178 %description -n python3-protobuf -l pl.UTF-8
179 Wiązania Pythona 3 do buforów protokołowych (Protocol Buffers).
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
187 %description -n ruby-google-protobuf
188 Ruby bindings for Google Protocol Buffers.
190 %description -n ruby-google-protobuf -l pl.UTF-8
191 Wiązania języka Ruby do biblioteki Google Protocol Buffers.
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
199 %description -n vim-syntax-protobuf
200 This package contains syntax highlighting for Protocol Buffers
201 descriptions in Vim editor.
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).
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
217 # gcc 10.2 false positive warning (with tag values >= 128):
220 # return *ptr == tag;
221 # ~~~~~^~~~~~ error: comparison is always false due to limited range of data type [-Werror=type-limits]
224 %{__sed} -i -e 's/-Werror //' src/Makefile.am
232 # Additional variables defined according to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192821
234 CFLAGS='%{rpmcflags} -DGOOGLE_PROTOBUF_NO_RTTI' \
235 CPPFLAGS='%{rpmcppflags} -DGOOGLE_PROTOBUF_NO_RTTI' \
236 --disable-silent-rules \
237 --disable-external-gtest
252 #rake clobber_package gem
261 rm -rf $RPM_BUILD_ROOT
262 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
266 INSTALL="install -p" \
268 DESTDIR=$RPM_BUILD_ROOT
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
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
290 cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
293 rm -rf $RPM_BUILD_ROOT
295 %post -p /sbin/ldconfig
296 %postun -p /sbin/ldconfig
298 %post libs -p /sbin/ldconfig
299 %postun libs -p /sbin/ldconfig
301 %post lite -p /sbin/ldconfig
302 %postun lite -p /sbin/ldconfig
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
312 %defattr(644,root,root,755)
313 %attr(755,root,root) %{_libdir}/libprotobuf.so.*.*.*
314 %attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.24
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
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}
337 %defattr(644,root,root,755)
338 %{_libdir}/libprotobuf-lite.a
339 %{_libdir}/libprotobuf.a
340 %{_libdir}/libprotoc.a
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
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
363 %files -n ruby-google-protobuf
364 %defattr(644,root,root,755)
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
374 %files -n vim-syntax-protobuf
375 %defattr(644,root,root,755)
376 %{_datadir}/vim/ftdetect/proto.vim
377 %{_datadir}/vim/syntax/proto.vim