]> git.pld-linux.org Git - packages/protobuf.git/blame - protobuf.spec
- added x32 patch (disable test specific to LP64 archs)
[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
d2d20125 15Version: 3.13.0
76c3a6f6 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
d2d20125 21# Source0-md5: cafa623d51361228c83c874d95f51992
8e6a7c84 22Source1: ftdetect-proto.vim
0759da77 23Patch0: system-gtest.patch
d8ccba75 24Patch1: no-wrap-memcpy.patch
bb7e48c9 25Patch2: %{name}-no-wheel.patch
6085fc97 26Patch3: %{name}-x32.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
d7b23517
ER
163
164%description -n python-protobuf
15d6b3e3 165Python 2 bindings for Protocol Buffers.
380182ab
JB
166
167%description -n python-protobuf -l pl.UTF-8
15d6b3e3
JB
168Wiązania Pythona 2 do buforów protokołowych (Protocol Buffers).
169
170%package -n python3-protobuf
171Summary: Python 3 bindings for Protocol Buffers
172Summary(pl.UTF-8): Wiązania Pythona 3 do buforów protokołowych (Protocol Buffers)
173Group: Development/Languages/Python
174Requires: python3-modules >= 1:3.3
175# does not use C++ library at this time
176
177%description -n python3-protobuf
178Python 3 bindings for Protocol Buffers.
179
180%description -n python3-protobuf -l pl.UTF-8
181Wiązania Pythona 3 do buforów protokołowych (Protocol Buffers).
182
183%package -n ruby-google-protobuf
184Summary: Ruby bindings for Google Protocol Buffers
185Summary(pl.UTF-8): Wiązania języka Ruby do biblioteki Google Protocol Buffers
186Group: Development/Languages
187Requires: ruby
188
189%description -n ruby-google-protobuf
190Ruby bindings for Google Protocol Buffers.
191
192%description -n ruby-google-protobuf -l pl.UTF-8
193Wiązania języka Ruby do biblioteki Google Protocol Buffers.
d7b23517 194
8e6a7c84 195%package -n vim-syntax-protobuf
380182ab
JB
196Summary: Vim syntax highlighting for Protocol Buffers descriptions
197Summary(pl.UTF-8): Podświetlanie składni Vima dla opisów buforów protokołowych (Protocol Buffers)
8e6a7c84
ER
198Group: Development/Libraries
199Requires: vim-rt >= 4:7.2.170
200
201%description -n vim-syntax-protobuf
380182ab
JB
202This package contains syntax highlighting for Protocol Buffers
203descriptions in Vim editor.
204
205%description -n vim-syntax-protobuf -l pl.UTF-8
206Ten pakiet zawiera pliki podświetlania składni edytora Vim dla
207opisów buforów protokołowych (Protocol Buffers).
8e6a7c84 208
f132b5a5
JR
209%prep
210%setup -q
d2d20125 211%patch0 -p1
d8ccba75 212%patch1 -p1
bb7e48c9 213%patch2 -p1
6085fc97 214%patch3 -p1
8a85b52c 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
76c3a6f6
JB
220# gcc 10.2 false positive warning (with tag values >= 128):
221#
222# if (tag < 128) {
223# return *ptr == tag;
224# ~~~~~^~~~~~ error: comparison is always false due to limited range of data type [-Werror=type-limits]
225# } else {
226#
227%{__sed} -i -e 's/-Werror //' src/Makefile.am
228
f132b5a5 229%build
72bc381c 230%{__libtoolize}
0759da77
ER
231%{__aclocal} -I m4
232%{__autoconf}
72bc381c 233%{__autoheader}
0759da77 234%{__automake}
18e73e19
LM
235# Additional variables defined according to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192821
236%configure \
36397081 237 CFLAGS='%{rpmcflags} -DGOOGLE_PROTOBUF_NO_RTTI' \
eab21f86
JB
238 CPPFLAGS='%{rpmcppflags} -DGOOGLE_PROTOBUF_NO_RTTI' \
239 --disable-silent-rules \
240 --disable-external-gtest
f132b5a5
JR
241%{__make}
242
d7b23517 243cd python
15d6b3e3 244%if %{with python2}
81c7e577 245%py_build
15d6b3e3
JB
246%endif
247%if %{with python3}
248%py3_build
249%endif
250cd ..
251
252%if %{with ruby}
253cd ruby
254rake
255#rake clobber_package gem
d7b23517
ER
256cd ..
257%endif
258
99dd6ddb
ER
259%if %{with tests}
260%{__make} check
261%endif
262
f132b5a5
JR
263%install
264rm -rf $RPM_BUILD_ROOT
265install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
266
267%{__make} install \
b475afd2
ER
268 STRIPBINARIES=no \
269 INSTALL="install -p" \
270 CPPROG="cp -p" \
f132b5a5
JR
271 DESTDIR=$RPM_BUILD_ROOT
272
8e6a7c84
ER
273install -d $RPM_BUILD_ROOT%{_vimdatadir}/{syntax,ftdetect}
274cp -p editors/proto.vim $RPM_BUILD_ROOT%{_vimdatadir}/syntax/proto.vim
275cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_vimdatadir}/ftdetect/proto.vim
276
d7b23517 277cd python
15d6b3e3 278%if %{with python2}
81c7e577 279%py_install
d7b23517 280%py_postclean
d7b23517 281%endif
15d6b3e3
JB
282%if %{with python3}
283%py3_install
284%endif
285cd ..
d7b23517 286
15d6b3e3
JB
287%if %{with ruby}
288install -d $RPM_BUILD_ROOT{%{ruby_vendorarchdir}/google,%{ruby_vendorlibdir}/google,%{ruby_specdir}}
289install ruby/lib/google/protobuf_c.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}/google
290cp -pr ruby/lib/google/{protobuf,protobuf.rb} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/google
291cp -p ruby/google-protobuf.gemspec $RPM_BUILD_ROOT%{ruby_specdir}/google-protobuf-%{version}.gemspec
292%endif
abcf9984 293cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
f132b5a5
JR
294
295%clean
296rm -rf $RPM_BUILD_ROOT
297
b475afd2
ER
298%post -p /sbin/ldconfig
299%postun -p /sbin/ldconfig
300
f132b5a5
JR
301%post libs -p /sbin/ldconfig
302%postun libs -p /sbin/ldconfig
303
b475afd2
ER
304%post lite -p /sbin/ldconfig
305%postun lite -p /sbin/ldconfig
306
f132b5a5
JR
307%files
308%defattr(644,root,root,755)
006c282c 309%doc CHANGES.txt CONTRIBUTORS.txt LICENSE README.md
f132b5a5 310%attr(755,root,root) %{_bindir}/protoc
b475afd2 311%attr(755,root,root) %{_libdir}/libprotoc.so.*.*.*
d2d20125 312%attr(755,root,root) %ghost %{_libdir}/libprotoc.so.24
f132b5a5
JR
313
314%files libs
315%defattr(644,root,root,755)
e5c615f2 316%attr(755,root,root) %{_libdir}/libprotobuf.so.*.*.*
d2d20125 317%attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.24
b475afd2
ER
318
319%files lite
320%defattr(644,root,root,755)
321%attr(755,root,root) %{_libdir}/libprotobuf-lite.so.*.*.*
d2d20125 322%attr(755,root,root) %ghost %{_libdir}/libprotobuf-lite.so.24
f132b5a5
JR
323
324%files devel
325%defattr(644,root,root,755)
2d1bc323 326%attr(755,root,root) %{_libdir}/libprotobuf-lite.so
e5c615f2
JB
327%attr(755,root,root) %{_libdir}/libprotobuf.so
328%attr(755,root,root) %{_libdir}/libprotoc.so
2d1bc323 329%{_libdir}/libprotobuf-lite.la
e5c615f2
JB
330%{_libdir}/libprotobuf.la
331%{_libdir}/libprotoc.la
079f482d
JB
332# XXX: dir shared with libtcmalloc
333%dir %{_includedir}/google
334%{_includedir}/google/protobuf
2d1bc323 335%{_pkgconfigdir}/protobuf-lite.pc
336%{_pkgconfigdir}/protobuf.pc
079f482d 337%{_examplesdir}/%{name}-%{version}
f132b5a5
JR
338
339%files static
340%defattr(644,root,root,755)
2d1bc323 341%{_libdir}/libprotobuf-lite.a
e5c615f2
JB
342%{_libdir}/libprotobuf.a
343%{_libdir}/libprotoc.a
8e6a7c84 344
15d6b3e3 345%if %{with python2}
d7b23517
ER
346%files -n python-protobuf
347%defattr(644,root,root,755)
8a85b52c 348%doc python/README.md
d7b23517
ER
349%dir %{py_sitescriptdir}/google
350%{py_sitescriptdir}/google/protobuf
c19d590f
JB
351%{py_sitescriptdir}/protobuf-%{version}-py*.egg-info
352%{py_sitescriptdir}/protobuf-%{version}-py*-nspkg.pth
d7b23517
ER
353%endif
354
15d6b3e3
JB
355%if %{with python3}
356%files -n python3-protobuf
357%defattr(644,root,root,755)
358%doc python/README.md
359%dir %{py3_sitescriptdir}/google
360%{py3_sitescriptdir}/google/protobuf
c19d590f
JB
361%{py3_sitescriptdir}/protobuf-%{version}-py*.egg-info
362%{py3_sitescriptdir}/protobuf-%{version}-py*-nspkg.pth
15d6b3e3
JB
363%endif
364
365%if %{with ruby}
366%files -n ruby-google-protobuf
367%defattr(644,root,root,755)
368%doc ruby/README.md
369%dir %{ruby_vendorarchdir}/google
370%attr(755,root,root) %{ruby_vendorarchdir}/google/protobuf_c.so
371%dir %{ruby_vendorlibdir}/google
372%{ruby_vendorlibdir}/google/protobuf.rb
373%{ruby_vendorlibdir}/google/protobuf
374%{ruby_specdir}/google-protobuf-%{version}.gemspec
375%endif
376
8e6a7c84
ER
377%files -n vim-syntax-protobuf
378%defattr(644,root,root,755)
379%{_datadir}/vim/ftdetect/proto.vim
380%{_datadir}/vim/syntax/proto.vim
This page took 0.158503 seconds and 4 git commands to generate.