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