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