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