]> git.pld-linux.org Git - packages/protobuf.git/blob - protobuf.spec
- apply no-wrap-memcpy patch only on x32
[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 Summary:        Protocol Buffers - Google's data interchange format
13 Summary(pl.UTF-8):      Protocol Buffers - format wymiany danych Google
14 Name:           protobuf
15 Version:        3.5.1.1
16 Release:        2
17 License:        BSD
18 Group:          Libraries
19 #Source0Download: https://github.com/google/protobuf/releases
20 Source0:        https://github.com/google/protobuf/archive/v%{version}/%{name}-%{version}.tar.gz
21 # Source0-md5:  5005003ae6b94773c4bbca87a644b131
22 Source1:        ftdetect-proto.vim
23 Patch0:         system-gtest.patch
24 Patch1:         no-wrap-memcpy.patch
25 URL:            https://github.com/google/protobuf/
26 BuildRequires:  autoconf >= 2.59
27 BuildRequires:  automake >= 1:1.9
28 %{?with_tests:BuildRequires:    gmock-devel}
29 %{?with_tests:BuildRequires:    gtest-devel}
30 BuildRequires:  libstdc++-devel
31 BuildRequires:  libtool
32 BuildRequires:  pkgconfig
33 %if %{with python2}
34 BuildRequires:  python-modules >= 1:2.6
35 BuildRequires:  python-setuptools
36 %endif
37 %if %{with python3}
38 BuildRequires:  python3-modules >= 1:3.3
39 BuildRequires:  python3-setuptools
40 %endif
41 %if %{with python2} || %{with python3}
42 BuildRequires:  rpm-pythonprov
43 %endif
44 BuildRequires:  rpmbuild(macros) >= 1.714
45 %if %{with ruby}
46 BuildRequires:  ruby-devel
47 BuildRequires:  ruby-rake
48 BuildRequires:  ruby-rake-compiler
49 %endif
50 BuildRequires:  zlib-devel >= 1.2.0.4
51 Requires:       %{name}-libs = %{version}-%{release}
52 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53
54 %define         _vimdatadir     %{_datadir}/vim
55
56 # triggers bogus "overflow in constant expression" errors with gcc 4.9 .. 5.4
57 %define         filterout       -fwrapv
58
59 %description
60 Protocol Buffers are a way of encoding structured data in an efficient
61 yet extensible format. Google uses Protocol Buffers for almost all of
62 its internal RPC protocols and file formats.
63
64 Protocol buffers are a flexible, efficient, automated mechanism for
65 serializing structured data - think XML, but smaller, faster, and
66 simpler. You define how you want your data to be structured once, then
67 you can use special generated source code to easily write and read
68 your structured data to and from a variety of data streams and using a
69 variety of languages. You can even update your data structure without
70 breaking deployed programs that are compiled against the "old" format.
71
72 This package contains Protocol Buffers compiler for all programming
73 languages.
74
75 %description -l pl.UTF-8
76 Bufory protokołowe (Protocol Buffers) to sposób kodowania danych
77 strukturalnych w wydajny i rozszerzalny sposób. Google używa buforów
78 protokołowych do prawie wszystkich wewnętrznych protokołów RPC i
79 formatów plików.
80
81 Bufory protokołowe to elastyczny, wydajny i zautomatyzowany sposób
82 serializacji danych strukturalnych - podobny do XML-a, ale mniejszy,
83 szybszy i prostszy. Definiuje się raz, jaką strukturę mają mieć dane,
84 a następnie używa specjalnie wygenerowanego kodu źródłowego do łatwego
85 zapisu i odczytu danych strukturalnych do i z różnych strumieni
86 danych, z poziomu różnych języków. Można nawet uaktualniać strukturę
87 danych bez psucia programów skompilowanych w oparciu o "stary" format.
88
89 Ten pakiet zawiera kompilator buforów protokołowych dla wszystkich
90 języków programowania. 
91
92 %package libs
93 Summary:        Protocol Buffers library
94 Summary(pl.UTF-8):      Biblioteka buforów protokołowych (Protocol Buffers)
95 Group:          Libraries
96 Requires:       zlib >= 1.2.0.4
97
98 %description libs
99 Protocol Buffers library.
100
101 %description libs -l pl.UTF-8
102 Biblioteka buforów protokołowych (Protocol Buffers).
103
104 %package lite
105 Summary:        Protocol Buffers LITE_RUNTIME library
106 Summary(pl.UTF-8):      Biblioteka LITE_RUNTIME buforów protokołowych (Protocol Buffers)
107 Group:          Libraries
108
109 %description lite
110 Protocol Buffers library for programs built with optimize_for =
111 LITE_RUNTIME.
112
113 The "optimize_for = LITE_RUNTIME" option causes the compiler to
114 generate code which only depends libprotobuf-lite, which is much
115 smaller than libprotobuf but lacks descriptors, reflection, and some
116 other features.
117
118 %description lite -l pl.UTF-8
119 Biblioteka buforów protokołowych (Protocol Buffers) zbudowana dla
120 programów z opcją optimize_for = LITE_RUNTIME.
121
122 Opcja ta powoduje, że kompilator generuje kod, który wymaga tylko
123 biblioteki libprotobuf-lite, która jest mniejsza niż libprotobuf, ale
124 nie ma niektórych elementów, takich jak deskryptory czy refleksje.
125
126 %package devel
127 Summary:        Header files for Protocol Buffers libraries
128 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek buforów protokołowych (Protocol Buffers)
129 Group:          Development/Libraries
130 Requires:       %{name} = %{version}-%{release}
131 Requires:       %{name}-libs = %{version}-%{release}
132 Requires:       %{name}-lite = %{version}-%{release}
133 Requires:       libstdc++-devel
134
135 %description devel
136 Header files for Protocol Buffers libraries.
137
138 %description devel -l pl.UTF-8
139 Pliki nagłówkowe bibliotek buforów protokołowych (Protocol Buffers).
140
141 %package static
142 Summary:        Static Protocol Buffers libraries
143 Summary(pl.UTF-8):      Statyczne biblioteki buforów protokołowych (Protocol Buffers)
144 Group:          Development/Libraries
145 Requires:       %{name}-devel = %{version}-%{release}
146
147 %description static
148 Static Protocol Buffers libraries.
149
150 %description static -l pl.UTF-8
151 Statyczne biblioteki buforów protokołowych (Protocol Buffers).
152
153 %package -n python-protobuf
154 Summary:        Python 2 bindings for Protocol Buffers
155 Summary(pl.UTF-8):      Wiązania Pythona 2 do buforów protokołowych (Protocol Buffers)
156 Group:          Development/Languages/Python
157 Requires:       python-modules >= 1:2.6
158 # does not use C++ library at this time
159
160 %description -n python-protobuf
161 Python 2 bindings for Protocol Buffers.
162
163 %description -n python-protobuf -l pl.UTF-8
164 Wiązania Pythona 2 do buforów protokołowych (Protocol Buffers).
165
166 %package -n python3-protobuf
167 Summary:        Python 3 bindings for Protocol Buffers
168 Summary(pl.UTF-8):      Wiązania Pythona 3 do buforów protokołowych (Protocol Buffers)
169 Group:          Development/Languages/Python
170 Requires:       python3-modules >= 1:3.3
171 # does not use C++ library at this time
172
173 %description -n python3-protobuf
174 Python 3 bindings for Protocol Buffers.
175
176 %description -n python3-protobuf -l pl.UTF-8
177 Wiązania Pythona 3 do buforów protokołowych (Protocol Buffers).
178
179 %package -n ruby-google-protobuf
180 Summary:        Ruby bindings for Google Protocol Buffers
181 Summary(pl.UTF-8):      Wiązania języka Ruby do biblioteki Google Protocol Buffers
182 Group:          Development/Languages
183 Requires:       ruby
184
185 %description -n ruby-google-protobuf
186 Ruby bindings for Google Protocol Buffers.
187
188 %description -n ruby-google-protobuf -l pl.UTF-8
189 Wiązania języka Ruby do biblioteki Google Protocol Buffers.
190
191 %package -n vim-syntax-protobuf
192 Summary:        Vim syntax highlighting for Protocol Buffers descriptions
193 Summary(pl.UTF-8):      Podświetlanie składni Vima dla opisów buforów protokołowych (Protocol Buffers)
194 Group:          Development/Libraries
195 Requires:       vim-rt >= 4:7.2.170
196
197 %description -n vim-syntax-protobuf
198 This package contains syntax highlighting for Protocol Buffers
199 descriptions in Vim editor.
200
201 %description -n vim-syntax-protobuf -l pl.UTF-8
202 Ten pakiet zawiera pliki podświetlania składni edytora Vim dla
203 opisów buforów protokołowych (Protocol Buffers).
204
205 %prep
206 %setup -q
207 %patch0 -p1
208 %ifarch x32
209 %patch1 -p1
210 %endif
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.15
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.15
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.15
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.049542 seconds and 3 git commands to generate.