]>
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 | |
a2eaa483 JR |
12 | %ifarch x32 |
13 | %undefine with_ruby | |
14 | %endif | |
15 | ||
f132b5a5 JR |
16 | Summary: Protocol Buffers - Google's data interchange format |
17 | Summary(pl.UTF-8): Protocol Buffers - format wymiany danych Google | |
18 | Name: protobuf | |
38208315 JR |
19 | Version: 3.2.1 |
20 | Release: 1 | |
f132b5a5 JR |
21 | License: BSD |
22 | Group: Libraries | |
8a85b52c | 23 | #Source0Download: https://github.com/google/protobuf/releases |
72bc381c | 24 | Source0: https://github.com/google/protobuf/archive/v%{version}/%{name}-%{version}.tar.gz |
38208315 | 25 | # Source0-md5: 94d3a8148c35cedd2db953245e057a67 |
8e6a7c84 | 26 | Source1: ftdetect-proto.vim |
0759da77 | 27 | Patch0: system-gtest.patch |
38208315 | 28 | Patch1: fix-macro-redefinitions.patch |
72bc381c JB |
29 | URL: https://github.com/google/protobuf/ |
30 | BuildRequires: autoconf >= 2.59 | |
8a85b52c JB |
31 | BuildRequires: automake >= 1:1.9 |
32 | %{?with_tests:BuildRequires: gmock-devel} | |
99dd6ddb | 33 | %{?with_tests:BuildRequires: gtest-devel} |
e2ad8a47 | 34 | BuildRequires: libstdc++-devel |
72bc381c | 35 | BuildRequires: libtool |
b475afd2 | 36 | BuildRequires: pkgconfig |
15d6b3e3 JB |
37 | %if %{with python2} |
38 | BuildRequires: python-modules >= 1:2.6 | |
71f28181 | 39 | BuildRequires: python-setuptools |
15d6b3e3 JB |
40 | %endif |
41 | %if %{with python3} | |
42 | BuildRequires: python3-modules >= 1:3.3 | |
43 | BuildRequires: python3-setuptools | |
44 | %endif | |
45 | %if %{with python2} || %{with python3} | |
d7b23517 ER |
46 | BuildRequires: rpm-pythonprov |
47 | %endif | |
15d6b3e3 JB |
48 | BuildRequires: rpmbuild(macros) >= 1.714 |
49 | %if %{with ruby} | |
50 | BuildRequires: ruby-devel | |
51 | BuildRequires: ruby-rake | |
52 | BuildRequires: ruby-rake-compiler | |
53 | %endif | |
54 | BuildRequires: zlib-devel >= 1.2.0.4 | |
f132b5a5 JR |
55 | Requires: %{name}-libs = %{version}-%{release} |
56 | BuildRoot: %{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 |
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 | |
380182ab | 69 | serializing structured data - think XML, but smaller, faster, and |
b475afd2 ER |
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 | |
380182ab | 77 | languages. |
f132b5a5 | 78 | |
c7c7fabc | 79 | %description -l pl.UTF-8 |
380182ab JB |
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 | ||
c7c7fabc JB |
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 | ||
380182ab JB |
93 | Ten pakiet zawiera kompilator buforów protokołowych dla wszystkich |
94 | języków programowania. | |
f132b5a5 JR |
95 | |
96 | %package libs | |
380182ab JB |
97 | Summary: Protocol Buffers library |
98 | Summary(pl.UTF-8): Biblioteka buforów protokołowych (Protocol Buffers) | |
f132b5a5 | 99 | Group: Libraries |
72bc381c | 100 | Requires: zlib >= 1.2.0.4 |
f132b5a5 JR |
101 | |
102 | %description libs | |
380182ab | 103 | Protocol Buffers library. |
f132b5a5 JR |
104 | |
105 | %description libs -l pl.UTF-8 | |
380182ab | 106 | Biblioteka buforów protokołowych (Protocol Buffers). |
f132b5a5 | 107 | |
b475afd2 | 108 | %package lite |
380182ab JB |
109 | Summary: Protocol Buffers LITE_RUNTIME library |
110 | Summary(pl.UTF-8): Biblioteka LITE_RUNTIME buforów protokołowych (Protocol Buffers) | |
111 | Group: Libraries | |
b475afd2 ER |
112 | |
113 | %description lite | |
380182ab JB |
114 | Protocol Buffers library for programs built with optimize_for = |
115 | LITE_RUNTIME. | |
b475afd2 ER |
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 | ||
380182ab JB |
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 | ||
f132b5a5 | 130 | %package devel |
380182ab JB |
131 | Summary: Header files for Protocol Buffers libraries |
132 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek buforów protokołowych (Protocol Buffers) | |
f132b5a5 | 133 | Group: Development/Libraries |
b475afd2 | 134 | Requires: %{name} = %{version}-%{release} |
f132b5a5 | 135 | Requires: %{name}-libs = %{version}-%{release} |
55d381f3 | 136 | Requires: %{name}-lite = %{version}-%{release} |
e2ad8a47 | 137 | Requires: libstdc++-devel |
f132b5a5 JR |
138 | |
139 | %description devel | |
380182ab | 140 | Header files for Protocol Buffers libraries. |
f132b5a5 JR |
141 | |
142 | %description devel -l pl.UTF-8 | |
380182ab | 143 | Pliki nagłówkowe bibliotek buforów protokołowych (Protocol Buffers). |
f132b5a5 JR |
144 | |
145 | %package static | |
380182ab JB |
146 | Summary: Static Protocol Buffers libraries |
147 | Summary(pl.UTF-8): Statyczne biblioteki buforów protokołowych (Protocol Buffers) | |
f132b5a5 JR |
148 | Group: Development/Libraries |
149 | Requires: %{name}-devel = %{version}-%{release} | |
150 | ||
151 | %description static | |
380182ab | 152 | Static Protocol Buffers libraries. |
f132b5a5 JR |
153 | |
154 | %description static -l pl.UTF-8 | |
380182ab | 155 | Statyczne biblioteki buforów protokołowych (Protocol Buffers). |
f132b5a5 | 156 | |
d7b23517 | 157 | %package -n python-protobuf |
15d6b3e3 JB |
158 | Summary: Python 2 bindings for Protocol Buffers |
159 | Summary(pl.UTF-8): Wiązania Pythona 2 do buforów protokołowych (Protocol Buffers) | |
380182ab | 160 | Group: Development/Languages/Python |
15d6b3e3 | 161 | Requires: python-modules >= 1:2.6 |
d7b23517 | 162 | # does not use C++ library at this time |
d7b23517 ER |
163 | |
164 | %description -n python-protobuf | |
15d6b3e3 | 165 | Python 2 bindings for Protocol Buffers. |
380182ab JB |
166 | |
167 | %description -n python-protobuf -l pl.UTF-8 | |
15d6b3e3 JB |
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. | |
d7b23517 | 194 | |
8e6a7c84 | 195 | %package -n vim-syntax-protobuf |
380182ab JB |
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) | |
8e6a7c84 ER |
198 | Group: Development/Libraries |
199 | Requires: vim-rt >= 4:7.2.170 | |
200 | ||
201 | %description -n vim-syntax-protobuf | |
380182ab JB |
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). | |
8e6a7c84 | 208 | |
f132b5a5 JR |
209 | %prep |
210 | %setup -q | |
8a85b52c | 211 | %patch0 -p1 |
38208315 | 212 | %patch1 -p1 |
8a85b52c JB |
213 | |
214 | ln -s /usr/src/gmock/src/gmock*.cc src | |
f132b5a5 JR |
215 | |
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 AM |
224 | CFLAGS='%{rpmcflags} -DGOOGLE_PROTOBUF_NO_RTTI' \ |
225 | CPPFLAGS='%{rpmcppflags} -DGOOGLE_PROTOBUF_NO_RTTI' | |
f132b5a5 JR |
226 | %{__make} |
227 | ||
d7b23517 | 228 | cd python |
15d6b3e3 | 229 | %if %{with python2} |
81c7e577 | 230 | %py_build |
15d6b3e3 JB |
231 | %endif |
232 | %if %{with python3} | |
233 | %py3_build | |
234 | %endif | |
235 | cd .. | |
236 | ||
237 | %if %{with ruby} | |
238 | cd ruby | |
239 | rake | |
240 | #rake clobber_package gem | |
d7b23517 ER |
241 | cd .. |
242 | %endif | |
243 | ||
99dd6ddb ER |
244 | %if %{with tests} |
245 | %{__make} check | |
246 | %endif | |
247 | ||
f132b5a5 JR |
248 | %install |
249 | rm -rf $RPM_BUILD_ROOT | |
250 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
251 | ||
252 | %{__make} install \ | |
b475afd2 ER |
253 | STRIPBINARIES=no \ |
254 | INSTALL="install -p" \ | |
255 | CPPROG="cp -p" \ | |
f132b5a5 JR |
256 | DESTDIR=$RPM_BUILD_ROOT |
257 | ||
8e6a7c84 ER |
258 | install -d $RPM_BUILD_ROOT%{_vimdatadir}/{syntax,ftdetect} |
259 | cp -p editors/proto.vim $RPM_BUILD_ROOT%{_vimdatadir}/syntax/proto.vim | |
260 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_vimdatadir}/ftdetect/proto.vim | |
261 | ||
d7b23517 | 262 | cd python |
15d6b3e3 | 263 | %if %{with python2} |
81c7e577 | 264 | %py_install |
d7b23517 | 265 | %py_postclean |
d7b23517 | 266 | %endif |
15d6b3e3 JB |
267 | %if %{with python3} |
268 | %py3_install | |
269 | %endif | |
270 | cd .. | |
d7b23517 | 271 | |
15d6b3e3 JB |
272 | %if %{with ruby} |
273 | install -d $RPM_BUILD_ROOT{%{ruby_vendorarchdir}/google,%{ruby_vendorlibdir}/google,%{ruby_specdir}} | |
274 | install ruby/lib/google/protobuf_c.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}/google | |
275 | cp -pr ruby/lib/google/{protobuf,protobuf.rb} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/google | |
276 | cp -p ruby/google-protobuf.gemspec $RPM_BUILD_ROOT%{ruby_specdir}/google-protobuf-%{version}.gemspec | |
277 | %endif | |
b475afd2 | 278 | cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
f132b5a5 JR |
279 | |
280 | %clean | |
281 | rm -rf $RPM_BUILD_ROOT | |
282 | ||
b475afd2 ER |
283 | %post -p /sbin/ldconfig |
284 | %postun -p /sbin/ldconfig | |
285 | ||
f132b5a5 JR |
286 | %post libs -p /sbin/ldconfig |
287 | %postun libs -p /sbin/ldconfig | |
288 | ||
b475afd2 ER |
289 | %post lite -p /sbin/ldconfig |
290 | %postun lite -p /sbin/ldconfig | |
291 | ||
f132b5a5 JR |
292 | %files |
293 | %defattr(644,root,root,755) | |
006c282c | 294 | %doc CHANGES.txt CONTRIBUTORS.txt LICENSE README.md |
f132b5a5 | 295 | %attr(755,root,root) %{_bindir}/protoc |
b475afd2 | 296 | %attr(755,root,root) %{_libdir}/libprotoc.so.*.*.* |
38208315 | 297 | %attr(755,root,root) %ghost %{_libdir}/libprotoc.so.12 |
f132b5a5 JR |
298 | |
299 | %files libs | |
300 | %defattr(644,root,root,755) | |
e5c615f2 | 301 | %attr(755,root,root) %{_libdir}/libprotobuf.so.*.*.* |
38208315 | 302 | %attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.12 |
b475afd2 ER |
303 | |
304 | %files lite | |
305 | %defattr(644,root,root,755) | |
306 | %attr(755,root,root) %{_libdir}/libprotobuf-lite.so.*.*.* | |
38208315 | 307 | %attr(755,root,root) %ghost %{_libdir}/libprotobuf-lite.so.12 |
f132b5a5 JR |
308 | |
309 | %files devel | |
310 | %defattr(644,root,root,755) | |
2d1bc323 | 311 | %attr(755,root,root) %{_libdir}/libprotobuf-lite.so |
e5c615f2 JB |
312 | %attr(755,root,root) %{_libdir}/libprotobuf.so |
313 | %attr(755,root,root) %{_libdir}/libprotoc.so | |
2d1bc323 | 314 | %{_libdir}/libprotobuf-lite.la |
e5c615f2 JB |
315 | %{_libdir}/libprotobuf.la |
316 | %{_libdir}/libprotoc.la | |
079f482d JB |
317 | # XXX: dir shared with libtcmalloc |
318 | %dir %{_includedir}/google | |
319 | %{_includedir}/google/protobuf | |
2d1bc323 | 320 | %{_pkgconfigdir}/protobuf-lite.pc |
321 | %{_pkgconfigdir}/protobuf.pc | |
079f482d | 322 | %{_examplesdir}/%{name}-%{version} |
f132b5a5 JR |
323 | |
324 | %files static | |
325 | %defattr(644,root,root,755) | |
2d1bc323 | 326 | %{_libdir}/libprotobuf-lite.a |
e5c615f2 JB |
327 | %{_libdir}/libprotobuf.a |
328 | %{_libdir}/libprotoc.a | |
8e6a7c84 | 329 | |
15d6b3e3 | 330 | %if %{with python2} |
d7b23517 ER |
331 | %files -n python-protobuf |
332 | %defattr(644,root,root,755) | |
8a85b52c | 333 | %doc python/README.md |
d7b23517 ER |
334 | %dir %{py_sitescriptdir}/google |
335 | %{py_sitescriptdir}/google/protobuf | |
38208315 JR |
336 | %{py_sitescriptdir}/protobuf-*-py*.egg-info |
337 | %{py_sitescriptdir}/protobuf-*-py*-nspkg.pth | |
d7b23517 ER |
338 | %endif |
339 | ||
15d6b3e3 JB |
340 | %if %{with python3} |
341 | %files -n python3-protobuf | |
342 | %defattr(644,root,root,755) | |
343 | %doc python/README.md | |
344 | %dir %{py3_sitescriptdir}/google | |
345 | %{py3_sitescriptdir}/google/protobuf | |
38208315 JR |
346 | %{py3_sitescriptdir}/protobuf-*-py*.egg-info |
347 | %{py3_sitescriptdir}/protobuf-*-py*-nspkg.pth | |
15d6b3e3 JB |
348 | %endif |
349 | ||
350 | %if %{with ruby} | |
351 | %files -n ruby-google-protobuf | |
352 | %defattr(644,root,root,755) | |
353 | %doc ruby/README.md | |
354 | %dir %{ruby_vendorarchdir}/google | |
355 | %attr(755,root,root) %{ruby_vendorarchdir}/google/protobuf_c.so | |
356 | %dir %{ruby_vendorlibdir}/google | |
357 | %{ruby_vendorlibdir}/google/protobuf.rb | |
358 | %{ruby_vendorlibdir}/google/protobuf | |
359 | %{ruby_specdir}/google-protobuf-%{version}.gemspec | |
360 | %endif | |
361 | ||
8e6a7c84 ER |
362 | %files -n vim-syntax-protobuf |
363 | %defattr(644,root,root,755) | |
364 | %{_datadir}/vim/ftdetect/proto.vim | |
365 | %{_datadir}/vim/syntax/proto.vim |