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