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