]> git.pld-linux.org Git - packages/protobuf.git/blob - protobuf.spec
4bb6d6dc8367cc1d33f69fb28f29aafbbcbe9a82
[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.1.0
16 Release:        0.1
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:  14a532a7538551d5def317bfca41dace
22 Source1:        ftdetect-proto.vim
23 Patch0:         system-gtest.patch
24 URL:            https://github.com/google/protobuf/
25 BuildRequires:  autoconf >= 2.59
26 BuildRequires:  automake >= 1:1.9
27 %{?with_tests:BuildRequires:    gmock-devel}
28 %{?with_tests:BuildRequires:    gtest-devel}
29 BuildRequires:  libstdc++-devel
30 BuildRequires:  libtool
31 BuildRequires:  pkgconfig
32 %if %{with python2}
33 BuildRequires:  python-modules >= 1:2.6
34 BuildRequires:  python-setuptools
35 %endif
36 %if %{with python3}
37 BuildRequires:  python3-modules >= 1:3.3
38 BuildRequires:  python3-setuptools
39 %endif
40 %if %{with python2} || %{with python3}
41 BuildRequires:  rpm-pythonprov
42 %endif
43 BuildRequires:  rpmbuild(macros) >= 1.714
44 %if %{with ruby}
45 BuildRequires:  ruby-devel
46 BuildRequires:  ruby-rake
47 BuildRequires:  ruby-rake-compiler
48 %endif
49 BuildRequires:  zlib-devel >= 1.2.0.4
50 Requires:       %{name}-libs = %{version}-%{release}
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %define         _vimdatadir     %{_datadir}/vim
54
55 # triggers bogus "overflow in constant expression" errors with gcc 4.9 .. 5.4
56 %define         filterout       -fwrapv
57
58 %description
59 Protocol Buffers are a way of encoding structured data in an efficient
60 yet extensible format. Google uses Protocol Buffers for almost all of
61 its internal RPC protocols and file formats.
62
63 Protocol buffers are a flexible, efficient, automated mechanism for
64 serializing structured data - think XML, but smaller, faster, and
65 simpler. You define how you want your data to be structured once, then
66 you can use special generated source code to easily write and read
67 your structured data to and from a variety of data streams and using a
68 variety of languages. You can even update your data structure without
69 breaking deployed programs that are compiled against the "old" format.
70
71 This package contains Protocol Buffers compiler for all programming
72 languages.
73
74 %description -l pl.UTF-8
75 Bufory protokołowe (Protocol Buffers) to sposób kodowania danych
76 strukturalnych w wydajny i rozszerzalny sposób. Google używa buforów
77 protokołowych do prawie wszystkich wewnętrznych protokołów RPC i
78 formatów plików.
79
80 Bufory protokołowe to elastyczny, wydajny i zautomatyzowany sposób
81 serializacji danych strukturalnych - podobny do XML-a, ale mniejszy,
82 szybszy i prostszy. Definiuje się raz, jaką strukturę mają mieć dane,
83 a następnie używa specjalnie wygenerowanego kodu źródłowego do łatwego
84 zapisu i odczytu danych strukturalnych do i z różnych strumieni
85 danych, z poziomu różnych języków. Można nawet uaktualniać strukturę
86 danych bez psucia programów skompilowanych w oparciu o "stary" format.
87
88 Ten pakiet zawiera kompilator buforów protokołowych dla wszystkich
89 języków programowania. 
90
91 %package libs
92 Summary:        Protocol Buffers library
93 Summary(pl.UTF-8):      Biblioteka buforów protokołowych (Protocol Buffers)
94 Group:          Libraries
95 Requires:       zlib >= 1.2.0.4
96
97 %description libs
98 Protocol Buffers library.
99
100 %description libs -l pl.UTF-8
101 Biblioteka buforów protokołowych (Protocol Buffers).
102
103 %package lite
104 Summary:        Protocol Buffers LITE_RUNTIME library
105 Summary(pl.UTF-8):      Biblioteka LITE_RUNTIME buforów protokołowych (Protocol Buffers)
106 Group:          Libraries
107
108 %description lite
109 Protocol Buffers library for programs built with optimize_for =
110 LITE_RUNTIME.
111
112 The "optimize_for = LITE_RUNTIME" option causes the compiler to
113 generate code which only depends libprotobuf-lite, which is much
114 smaller than libprotobuf but lacks descriptors, reflection, and some
115 other features.
116
117 %description lite -l pl.UTF-8
118 Biblioteka buforów protokołowych (Protocol Buffers) zbudowana dla
119 programów z opcją optimize_for = LITE_RUNTIME.
120
121 Opcja ta powoduje, że kompilator generuje kod, który wymaga tylko
122 biblioteki libprotobuf-lite, która jest mniejsza niż libprotobuf, ale
123 nie ma niektórych elementów, takich jak deskryptory czy refleksje.
124
125 %package devel
126 Summary:        Header files for Protocol Buffers libraries
127 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek buforów protokołowych (Protocol Buffers)
128 Group:          Development/Libraries
129 Requires:       %{name} = %{version}-%{release}
130 Requires:       %{name}-libs = %{version}-%{release}
131 Requires:       %{name}-lite = %{version}-%{release}
132 Requires:       libstdc++-devel
133
134 %description devel
135 Header files for Protocol Buffers libraries.
136
137 %description devel -l pl.UTF-8
138 Pliki nagłówkowe bibliotek buforów protokołowych (Protocol Buffers).
139
140 %package static
141 Summary:        Static Protocol Buffers libraries
142 Summary(pl.UTF-8):      Statyczne biblioteki buforów protokołowych (Protocol Buffers)
143 Group:          Development/Libraries
144 Requires:       %{name}-devel = %{version}-%{release}
145
146 %description static
147 Static Protocol Buffers libraries.
148
149 %description static -l pl.UTF-8
150 Statyczne biblioteki buforów protokołowych (Protocol Buffers).
151
152 %package -n python-protobuf
153 Summary:        Python 2 bindings for Protocol Buffers
154 Summary(pl.UTF-8):      Wiązania Pythona 2 do buforów protokołowych (Protocol Buffers)
155 Group:          Development/Languages/Python
156 Requires:       python-modules >= 1:2.6
157 # does not use C++ library at this time
158
159 %description -n python-protobuf
160 Python 2 bindings for Protocol Buffers.
161
162 %description -n python-protobuf -l pl.UTF-8
163 Wiązania Pythona 2 do buforów protokołowych (Protocol Buffers).
164
165 %package -n python3-protobuf
166 Summary:        Python 3 bindings for Protocol Buffers
167 Summary(pl.UTF-8):      Wiązania Pythona 3 do buforów protokołowych (Protocol Buffers)
168 Group:          Development/Languages/Python
169 Requires:       python3-modules >= 1:3.3
170 # does not use C++ library at this time
171
172 %description -n python3-protobuf
173 Python 3 bindings for Protocol Buffers.
174
175 %description -n python3-protobuf -l pl.UTF-8
176 Wiązania Pythona 3 do buforów protokołowych (Protocol Buffers).
177
178 %package -n ruby-google-protobuf
179 Summary:        Ruby bindings for Google Protocol Buffers
180 Summary(pl.UTF-8):      Wiązania języka Ruby do biblioteki Google Protocol Buffers
181 Group:          Development/Languages
182 Requires:       ruby
183
184 %description -n ruby-google-protobuf
185 Ruby bindings for Google Protocol Buffers.
186
187 %description -n ruby-google-protobuf -l pl.UTF-8
188 Wiązania języka Ruby do biblioteki Google Protocol Buffers.
189
190 %package -n vim-syntax-protobuf
191 Summary:        Vim syntax highlighting for Protocol Buffers descriptions
192 Summary(pl.UTF-8):      Podświetlanie składni Vima dla opisów buforów protokołowych (Protocol Buffers)
193 Group:          Development/Libraries
194 Requires:       vim-rt >= 4:7.2.170
195
196 %description -n vim-syntax-protobuf
197 This package contains syntax highlighting for Protocol Buffers
198 descriptions in Vim editor.
199
200 %description -n vim-syntax-protobuf -l pl.UTF-8
201 Ten pakiet zawiera pliki podświetlania składni edytora Vim dla
202 opisów buforów protokołowych (Protocol Buffers).
203
204 %prep
205 %setup -q
206 %patch0 -p1
207
208 ln -s /usr/src/gmock/src/gmock*.cc src
209
210 %build
211 %{__libtoolize}
212 %{__aclocal} -I m4
213 %{__autoconf}
214 %{__autoheader}
215 %{__automake}
216 # Additional variables defined according to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192821
217 %configure \
218         CFLAGS='%{rpmcflags} -DGOOGLE_PROTOBUF_NO_RTTI' \
219         CPPFLAGS='%{rpmcppflags} -DGOOGLE_PROTOBUF_NO_RTTI'
220 %{__make}
221
222 cd python
223 %if %{with python2}
224 %py_build
225 %endif
226 %if %{with python3}
227 %py3_build
228 %endif
229 cd ..
230
231 %if %{with ruby}
232 cd ruby
233 rake
234 #rake clobber_package gem
235 cd ..
236 %endif
237
238 %if %{with tests}
239 %{__make} check
240 %endif
241
242 %install
243 rm -rf $RPM_BUILD_ROOT
244 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
245
246 %{__make} install \
247         STRIPBINARIES=no \
248         INSTALL="install -p"  \
249         CPPROG="cp -p" \
250         DESTDIR=$RPM_BUILD_ROOT
251
252 install -d $RPM_BUILD_ROOT%{_vimdatadir}/{syntax,ftdetect}
253 cp -p editors/proto.vim $RPM_BUILD_ROOT%{_vimdatadir}/syntax/proto.vim
254 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_vimdatadir}/ftdetect/proto.vim
255
256 cd python
257 %if %{with python2}
258 %py_install
259 %py_postclean
260 %endif
261 %if %{with python3}
262 %py3_install
263 %endif
264 cd ..
265
266 %if %{with ruby}
267 install -d $RPM_BUILD_ROOT{%{ruby_vendorarchdir}/google,%{ruby_vendorlibdir}/google,%{ruby_specdir}}
268 install ruby/lib/google/protobuf_c.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}/google
269 cp -pr ruby/lib/google/{protobuf,protobuf.rb} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/google
270 cp -p ruby/google-protobuf.gemspec $RPM_BUILD_ROOT%{ruby_specdir}/google-protobuf-%{version}.gemspec
271 %endif
272 cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
273
274 %clean
275 rm -rf $RPM_BUILD_ROOT
276
277 %post   -p /sbin/ldconfig
278 %postun -p /sbin/ldconfig
279
280 %post   libs -p /sbin/ldconfig
281 %postun libs -p /sbin/ldconfig
282
283 %post   lite -p /sbin/ldconfig
284 %postun lite -p /sbin/ldconfig
285
286 %files
287 %defattr(644,root,root,755)
288 %doc CHANGES.txt CONTRIBUTORS.txt LICENSE README.md
289 %attr(755,root,root) %{_bindir}/protoc
290 %attr(755,root,root) %{_libdir}/libprotoc.so.*.*.*
291 %attr(755,root,root) %ghost %{_libdir}/libprotoc.so.11
292
293 %files libs
294 %defattr(644,root,root,755)
295 %attr(755,root,root) %{_libdir}/libprotobuf.so.*.*.*
296 %attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.11
297
298 %files lite
299 %defattr(644,root,root,755)
300 %attr(755,root,root) %{_libdir}/libprotobuf-lite.so.*.*.*
301 %attr(755,root,root) %ghost %{_libdir}/libprotobuf-lite.so.11
302
303 %files devel
304 %defattr(644,root,root,755)
305 %attr(755,root,root) %{_libdir}/libprotobuf-lite.so
306 %attr(755,root,root) %{_libdir}/libprotobuf.so
307 %attr(755,root,root) %{_libdir}/libprotoc.so
308 %{_libdir}/libprotobuf-lite.la
309 %{_libdir}/libprotobuf.la
310 %{_libdir}/libprotoc.la
311 # XXX: dir shared with libtcmalloc
312 %dir %{_includedir}/google
313 %{_includedir}/google/protobuf
314 %{_pkgconfigdir}/protobuf-lite.pc
315 %{_pkgconfigdir}/protobuf.pc
316 %{_examplesdir}/%{name}-%{version}
317
318 %files static
319 %defattr(644,root,root,755)
320 %{_libdir}/libprotobuf-lite.a
321 %{_libdir}/libprotobuf.a
322 %{_libdir}/libprotoc.a
323
324 %if %{with python2}
325 %files -n python-protobuf
326 %defattr(644,root,root,755)
327 %doc python/README.md
328 %dir %{py_sitescriptdir}/google
329 %{py_sitescriptdir}/google/protobuf
330 %{py_sitescriptdir}/protobuf-%{version}-py*.egg-info
331 %{py_sitescriptdir}/protobuf-%{version}-py*-nspkg.pth
332 %endif
333
334 %if %{with python3}
335 %files -n python3-protobuf
336 %defattr(644,root,root,755)
337 %doc python/README.md
338 %dir %{py3_sitescriptdir}/google
339 %{py3_sitescriptdir}/google/protobuf
340 %{py3_sitescriptdir}/protobuf-%{version}-py*.egg-info
341 %{py3_sitescriptdir}/protobuf-%{version}-py*-nspkg.pth
342 %endif
343
344 %if %{with ruby}
345 %files -n ruby-google-protobuf
346 %defattr(644,root,root,755)
347 %doc ruby/README.md
348 %dir %{ruby_vendorarchdir}/google
349 %attr(755,root,root) %{ruby_vendorarchdir}/google/protobuf_c.so
350 %dir %{ruby_vendorlibdir}/google
351 %{ruby_vendorlibdir}/google/protobuf.rb
352 %{ruby_vendorlibdir}/google/protobuf
353 %{ruby_specdir}/google-protobuf-%{version}.gemspec
354 %endif
355
356 %files -n vim-syntax-protobuf
357 %defattr(644,root,root,755)
358 %{_datadir}/vim/ftdetect/proto.vim
359 %{_datadir}/vim/syntax/proto.vim
This page took 0.072505 seconds and 2 git commands to generate.