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