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