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