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