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