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