]> git.pld-linux.org Git - packages/protobuf.git/blob - protobuf.spec
- updated to 3.3.0 (note: new sonames)
[packages/protobuf.git] / protobuf.spec
1 # TODO:
2 # - add bindings for java (maven build)
3 # - add bindings for javascript
4 # - add bindings for csharp
5 #
6 # Conditional build:
7 %bcond_without  python2 # Python 2.x bindings
8 %bcond_without  python3 # Python 3.x bindings
9 %bcond_without  ruby    # Ruby bindings
10 %bcond_without  tests   # perform "make check"
11
12 %ifarch x32
13 %undefine with_ruby
14 %endif
15
16 Summary:        Protocol Buffers - Google's data interchange format
17 Summary(pl.UTF-8):      Protocol Buffers - format wymiany danych Google
18 Name:           protobuf
19 Version:        3.3.0
20 Release:        1
21 License:        BSD
22 Group:          Libraries
23 #Source0Download: https://github.com/google/protobuf/releases
24 Source0:        https://github.com/google/protobuf/archive/v%{version}/%{name}-%{version}.tar.gz
25 # Source0-md5:  10644296984c7cbdd1e8436e88b069d2
26 Source1:        ftdetect-proto.vim
27 Patch0:         system-gtest.patch
28 URL:            https://github.com/google/protobuf/
29 BuildRequires:  autoconf >= 2.59
30 BuildRequires:  automake >= 1:1.9
31 %{?with_tests:BuildRequires:    gmock-devel}
32 %{?with_tests:BuildRequires:    gtest-devel}
33 BuildRequires:  libstdc++-devel
34 BuildRequires:  libtool
35 BuildRequires:  pkgconfig
36 %if %{with python2}
37 BuildRequires:  python-modules >= 1:2.6
38 BuildRequires:  python-setuptools
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}
45 BuildRequires:  rpm-pythonprov
46 %endif
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
54 Requires:       %{name}-libs = %{version}-%{release}
55 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57 %define         _vimdatadir     %{_datadir}/vim
58
59 # triggers bogus "overflow in constant expression" errors with gcc 4.9 .. 5.4
60 %define         filterout       -fwrapv
61
62 %description
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
68 serializing structured data - think XML, but smaller, faster, and
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
76 languages.
77
78 %description -l pl.UTF-8
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
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
92 Ten pakiet zawiera kompilator buforów protokołowych dla wszystkich
93 języków programowania. 
94
95 %package libs
96 Summary:        Protocol Buffers library
97 Summary(pl.UTF-8):      Biblioteka buforów protokołowych (Protocol Buffers)
98 Group:          Libraries
99 Requires:       zlib >= 1.2.0.4
100
101 %description libs
102 Protocol Buffers library.
103
104 %description libs -l pl.UTF-8
105 Biblioteka buforów protokołowych (Protocol Buffers).
106
107 %package lite
108 Summary:        Protocol Buffers LITE_RUNTIME library
109 Summary(pl.UTF-8):      Biblioteka LITE_RUNTIME buforów protokołowych (Protocol Buffers)
110 Group:          Libraries
111
112 %description lite
113 Protocol Buffers library for programs built with optimize_for =
114 LITE_RUNTIME.
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
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
129 %package devel
130 Summary:        Header files for Protocol Buffers libraries
131 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek buforów protokołowych (Protocol Buffers)
132 Group:          Development/Libraries
133 Requires:       %{name} = %{version}-%{release}
134 Requires:       %{name}-libs = %{version}-%{release}
135 Requires:       %{name}-lite = %{version}-%{release}
136 Requires:       libstdc++-devel
137
138 %description devel
139 Header files for Protocol Buffers libraries.
140
141 %description devel -l pl.UTF-8
142 Pliki nagłówkowe bibliotek buforów protokołowych (Protocol Buffers).
143
144 %package static
145 Summary:        Static Protocol Buffers libraries
146 Summary(pl.UTF-8):      Statyczne biblioteki buforów protokołowych (Protocol Buffers)
147 Group:          Development/Libraries
148 Requires:       %{name}-devel = %{version}-%{release}
149
150 %description static
151 Static Protocol Buffers libraries.
152
153 %description static -l pl.UTF-8
154 Statyczne biblioteki buforów protokołowych (Protocol Buffers).
155
156 %package -n python-protobuf
157 Summary:        Python 2 bindings for Protocol Buffers
158 Summary(pl.UTF-8):      Wiązania Pythona 2 do buforów protokołowych (Protocol Buffers)
159 Group:          Development/Languages/Python
160 Requires:       python-modules >= 1:2.6
161 # does not use C++ library at this time
162
163 %description -n python-protobuf
164 Python 2 bindings for Protocol Buffers.
165
166 %description -n python-protobuf -l pl.UTF-8
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.
193
194 %package -n vim-syntax-protobuf
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)
197 Group:          Development/Libraries
198 Requires:       vim-rt >= 4:7.2.170
199
200 %description -n vim-syntax-protobuf
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).
207
208 %prep
209 %setup -q
210 %patch0 -p1
211
212 ln -s /usr/src/gmock/src/gmock*.cc src
213
214 %build
215 %{__libtoolize}
216 %{__aclocal} -I m4
217 %{__autoconf}
218 %{__autoheader}
219 %{__automake}
220 # Additional variables defined according to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192821
221 %configure \
222         CFLAGS='%{rpmcflags} -DGOOGLE_PROTOBUF_NO_RTTI' \
223         CPPFLAGS='%{rpmcppflags} -DGOOGLE_PROTOBUF_NO_RTTI'
224 %{__make}
225
226 cd python
227 %if %{with python2}
228 %py_build
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
239 cd ..
240 %endif
241
242 %if %{with tests}
243 %{__make} check
244 %endif
245
246 %install
247 rm -rf $RPM_BUILD_ROOT
248 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
249
250 %{__make} install \
251         STRIPBINARIES=no \
252         INSTALL="install -p"  \
253         CPPROG="cp -p" \
254         DESTDIR=$RPM_BUILD_ROOT
255
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
260 cd python
261 %if %{with python2}
262 %py_install
263 %py_postclean
264 %endif
265 %if %{with python3}
266 %py3_install
267 %endif
268 cd ..
269
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
276 cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
277
278 %clean
279 rm -rf $RPM_BUILD_ROOT
280
281 %post   -p /sbin/ldconfig
282 %postun -p /sbin/ldconfig
283
284 %post   libs -p /sbin/ldconfig
285 %postun libs -p /sbin/ldconfig
286
287 %post   lite -p /sbin/ldconfig
288 %postun lite -p /sbin/ldconfig
289
290 %files
291 %defattr(644,root,root,755)
292 %doc CHANGES.txt CONTRIBUTORS.txt LICENSE README.md
293 %attr(755,root,root) %{_bindir}/protoc
294 %attr(755,root,root) %{_libdir}/libprotoc.so.*.*.*
295 %attr(755,root,root) %ghost %{_libdir}/libprotoc.so.13
296
297 %files libs
298 %defattr(644,root,root,755)
299 %attr(755,root,root) %{_libdir}/libprotobuf.so.*.*.*
300 %attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.13
301
302 %files lite
303 %defattr(644,root,root,755)
304 %attr(755,root,root) %{_libdir}/libprotobuf-lite.so.*.*.*
305 %attr(755,root,root) %ghost %{_libdir}/libprotobuf-lite.so.13
306
307 %files devel
308 %defattr(644,root,root,755)
309 %attr(755,root,root) %{_libdir}/libprotobuf-lite.so
310 %attr(755,root,root) %{_libdir}/libprotobuf.so
311 %attr(755,root,root) %{_libdir}/libprotoc.so
312 %{_libdir}/libprotobuf-lite.la
313 %{_libdir}/libprotobuf.la
314 %{_libdir}/libprotoc.la
315 # XXX: dir shared with libtcmalloc
316 %dir %{_includedir}/google
317 %{_includedir}/google/protobuf
318 %{_pkgconfigdir}/protobuf-lite.pc
319 %{_pkgconfigdir}/protobuf.pc
320 %{_examplesdir}/%{name}-%{version}
321
322 %files static
323 %defattr(644,root,root,755)
324 %{_libdir}/libprotobuf-lite.a
325 %{_libdir}/libprotobuf.a
326 %{_libdir}/libprotoc.a
327
328 %if %{with python2}
329 %files -n python-protobuf
330 %defattr(644,root,root,755)
331 %doc python/README.md
332 %dir %{py_sitescriptdir}/google
333 %{py_sitescriptdir}/google/protobuf
334 %{py_sitescriptdir}/protobuf-*-py*.egg-info
335 %{py_sitescriptdir}/protobuf-*-py*-nspkg.pth
336 %endif
337
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
344 %{py3_sitescriptdir}/protobuf-*-py*.egg-info
345 %{py3_sitescriptdir}/protobuf-*-py*-nspkg.pth
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
360 %files -n vim-syntax-protobuf
361 %defattr(644,root,root,755)
362 %{_datadir}/vim/ftdetect/proto.vim
363 %{_datadir}/vim/syntax/proto.vim
This page took 0.083398 seconds and 4 git commands to generate.