]>
Commit | Line | Data |
---|---|---|
f132b5a5 | 1 | # TODO: |
d7b23517 | 2 | # - add bindings for java |
99dd6ddb | 3 | # - tests fail: 2 of 5 tests failed |
d7b23517 ER |
4 | # |
5 | # Conditional build: | |
6 | # | |
7 | %bcond_without python # Python bindings | |
99dd6ddb | 8 | %bcond_with tests # build with tests |
b475afd2 | 9 | |
f132b5a5 JR |
10 | Summary: Protocol Buffers - Google's data interchange format |
11 | Summary(pl.UTF-8): Protocol Buffers - format wymiany danych Google | |
12 | Name: protobuf | |
1355660c | 13 | Version: 2.4.1 |
d7b23517 | 14 | Release: 2 |
f132b5a5 JR |
15 | License: BSD |
16 | Group: Libraries | |
17 | Source0: http://protobuf.googlecode.com/files/%{name}-%{version}.tar.bz2 | |
caac0c24 | 18 | # Source0-md5: ed436802019c9e1f40cc750eaf78f318 |
8e6a7c84 | 19 | Source1: ftdetect-proto.vim |
0759da77 | 20 | Patch0: system-gtest.patch |
f132b5a5 | 21 | URL: http://code.google.com/p/protobuf/ |
b475afd2 ER |
22 | BuildRequires: autoconf |
23 | BuildRequires: automake | |
99dd6ddb | 24 | %{?with_tests:BuildRequires: gtest-devel} |
e2ad8a47 | 25 | BuildRequires: libstdc++-devel |
b475afd2 | 26 | BuildRequires: pkgconfig |
0759da77 | 27 | BuildRequires: rpmbuild(macros) >= 1.219 |
b475afd2 | 28 | BuildRequires: zlib-devel |
d7b23517 | 29 | %if %{with python} |
71f28181 | 30 | BuildRequires: python-setuptools |
d7b23517 ER |
31 | BuildRequires: rpm-pythonprov |
32 | %endif | |
f132b5a5 JR |
33 | Requires: %{name}-libs = %{version}-%{release} |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
8e6a7c84 ER |
36 | %define _vimdatadir %{_datadir}/vim |
37 | ||
f132b5a5 | 38 | %description |
b475afd2 ER |
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 | |
f132b5a5 | 53 | |
c7c7fabc JB |
54 | %description -l pl.UTF-8 |
55 | Bufory protokołowe to elastyczny, wydajny i zautomatyzowany sposób | |
56 | serializacji danych strukturalnych - podobny do XML-a, ale mniejszy, | |
57 | szybszy i prostszy. Definiuje się raz, jaką strukturę mają mieć dane, | |
58 | a następnie używa specjalnie wygenerowanego kodu źródłowego do łatwego | |
59 | zapisu i odczytu danych strukturalnych do i z różnych strumieni | |
60 | danych, z poziomu różnych języków. Można nawet uaktualniać strukturę | |
61 | danych bez psucia programów skompilowanych w oparciu o "stary" format. | |
62 | ||
63 | Google używa buforów protokołowych (Protocol Buffers) do prawie | |
64 | wszystkich wewnętrznych protokołów RPC i formatów plików. | |
f132b5a5 JR |
65 | |
66 | %package libs | |
67 | Summary: protobuf libraries | |
68 | Summary(pl.UTF-8): Biblioteki protobuf | |
69 | Group: Libraries | |
70 | ||
71 | %description libs | |
72 | protobuf libraries. | |
73 | ||
74 | %description libs -l pl.UTF-8 | |
75 | Biblioteki protobuf. | |
76 | ||
b475afd2 ER |
77 | %package lite |
78 | Summary: Protocol Buffers LITE_RUNTIME libraries | |
79 | Group: Development/Libraries | |
80 | ||
81 | %description lite | |
82 | Protocol Buffers built with optimize_for = LITE_RUNTIME. | |
83 | ||
84 | The "optimize_for = LITE_RUNTIME" option causes the compiler to | |
85 | generate code which only depends libprotobuf-lite, which is much | |
86 | smaller than libprotobuf but lacks descriptors, reflection, and some | |
87 | other features. | |
88 | ||
f132b5a5 | 89 | %package devel |
b475afd2 | 90 | Summary: Protocol Buffers C++ headers and libraries |
f132b5a5 JR |
91 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek protobuf |
92 | Group: Development/Libraries | |
b475afd2 | 93 | Requires: %{name} = %{version}-%{release} |
f132b5a5 | 94 | Requires: %{name}-libs = %{version}-%{release} |
e2ad8a47 | 95 | Requires: libstdc++-devel |
f132b5a5 JR |
96 | |
97 | %description devel | |
b475afd2 ER |
98 | This package contains Protocol Buffers compiler for all languages and |
99 | C++ headers and libraries | |
f132b5a5 JR |
100 | |
101 | %description devel -l pl.UTF-8 | |
102 | Pliki nagłówkowe bibliotek protobuf. | |
103 | ||
104 | %package static | |
b475afd2 | 105 | Summary: Static development files for protobuf |
f132b5a5 JR |
106 | Summary(pl.UTF-8): Statyczne biblioteki protobuf |
107 | Group: Development/Libraries | |
108 | Requires: %{name}-devel = %{version}-%{release} | |
109 | ||
110 | %description static | |
b475afd2 | 111 | Static libraries for Protocol Buffers |
f132b5a5 JR |
112 | |
113 | %description static -l pl.UTF-8 | |
114 | Statyczne biblioteki protobuf. | |
115 | ||
d7b23517 ER |
116 | %package -n python-protobuf |
117 | Summary: Python bindings for Google Protocol Buffers | |
118 | Group: Development/Languages | |
119 | # does not use C++ library at this time | |
120 | Conflicts: %{name} < %{version} | |
121 | Conflicts: %{name} > %{version} | |
122 | ||
123 | %description -n python-protobuf | |
124 | This package contains Python libraries for Google Protocol Buffers | |
125 | ||
8e6a7c84 ER |
126 | %package -n vim-syntax-protobuf |
127 | Summary: Vim syntax highlighting for Google Protocol Buffers descriptions | |
128 | Group: Development/Libraries | |
129 | Requires: vim-rt >= 4:7.2.170 | |
130 | ||
131 | %description -n vim-syntax-protobuf | |
132 | This package contains syntax highlighting for Google Protocol Buffers | |
133 | descriptions in Vim editor | |
134 | ||
f132b5a5 JR |
135 | %prep |
136 | %setup -q | |
0759da77 ER |
137 | %patch0 -p1 |
138 | %{__rm} -r gtest | |
f132b5a5 JR |
139 | |
140 | %build | |
0759da77 ER |
141 | %{__aclocal} -I m4 |
142 | %{__autoconf} | |
0759da77 | 143 | %{__automake} |
f132b5a5 JR |
144 | %configure |
145 | %{__make} | |
146 | ||
d7b23517 ER |
147 | %if %{with python} |
148 | cd python | |
149 | %{__python} setup.py build | |
150 | %{__sed} -i -e 1d build/lib/google/protobuf/descriptor_pb2.py | |
151 | cd .. | |
152 | %endif | |
153 | ||
99dd6ddb ER |
154 | %if %{with tests} |
155 | %{__make} check | |
156 | %endif | |
157 | ||
f132b5a5 JR |
158 | %install |
159 | rm -rf $RPM_BUILD_ROOT | |
160 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
161 | ||
162 | %{__make} install \ | |
b475afd2 ER |
163 | STRIPBINARIES=no \ |
164 | INSTALL="install -p" \ | |
165 | CPPROG="cp -p" \ | |
f132b5a5 JR |
166 | DESTDIR=$RPM_BUILD_ROOT |
167 | ||
8e6a7c84 ER |
168 | install -d $RPM_BUILD_ROOT%{_vimdatadir}/{syntax,ftdetect} |
169 | cp -p editors/proto.vim $RPM_BUILD_ROOT%{_vimdatadir}/syntax/proto.vim | |
170 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_vimdatadir}/ftdetect/proto.vim | |
171 | ||
d7b23517 ER |
172 | %if %{with python} |
173 | cd python | |
174 | %{__python} setup.py install \ | |
175 | --root=$RPM_BUILD_ROOT \ | |
176 | --single-version-externally-managed \ | |
177 | --optimize=2 | |
178 | %py_postclean | |
179 | cd .. | |
180 | %endif | |
181 | ||
b475afd2 | 182 | cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
f132b5a5 JR |
183 | |
184 | %clean | |
185 | rm -rf $RPM_BUILD_ROOT | |
186 | ||
b475afd2 ER |
187 | %post -p /sbin/ldconfig |
188 | %postun -p /sbin/ldconfig | |
189 | ||
f132b5a5 JR |
190 | %post libs -p /sbin/ldconfig |
191 | %postun libs -p /sbin/ldconfig | |
192 | ||
b475afd2 ER |
193 | %post lite -p /sbin/ldconfig |
194 | %postun lite -p /sbin/ldconfig | |
195 | ||
f132b5a5 JR |
196 | %files |
197 | %defattr(644,root,root,755) | |
198 | %doc CHANGES.txt CONTRIBUTORS.txt README.txt | |
199 | %attr(755,root,root) %{_bindir}/protoc | |
b475afd2 ER |
200 | %attr(755,root,root) %{_libdir}/libprotoc.so.*.*.* |
201 | %attr(755,root,root) %ghost %{_libdir}/libprotoc.so.7 | |
f132b5a5 JR |
202 | |
203 | %files libs | |
204 | %defattr(644,root,root,755) | |
e5c615f2 | 205 | %attr(755,root,root) %{_libdir}/libprotobuf.so.*.*.* |
483143ee | 206 | %attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.7 |
b475afd2 ER |
207 | |
208 | %files lite | |
209 | %defattr(644,root,root,755) | |
210 | %attr(755,root,root) %{_libdir}/libprotobuf-lite.so.*.*.* | |
211 | %attr(755,root,root) %ghost %{_libdir}/libprotobuf-lite.so.7 | |
f132b5a5 JR |
212 | |
213 | %files devel | |
214 | %defattr(644,root,root,755) | |
2d1bc323 | 215 | %attr(755,root,root) %{_libdir}/libprotobuf-lite.so |
e5c615f2 JB |
216 | %attr(755,root,root) %{_libdir}/libprotobuf.so |
217 | %attr(755,root,root) %{_libdir}/libprotoc.so | |
2d1bc323 | 218 | %{_libdir}/libprotobuf-lite.la |
e5c615f2 JB |
219 | %{_libdir}/libprotobuf.la |
220 | %{_libdir}/libprotoc.la | |
f132b5a5 | 221 | %{_includedir}/google |
f132b5a5 | 222 | %{_examplesdir}/%{name}-%{version} |
2d1bc323 | 223 | %{_pkgconfigdir}/protobuf-lite.pc |
224 | %{_pkgconfigdir}/protobuf.pc | |
f132b5a5 JR |
225 | |
226 | %files static | |
227 | %defattr(644,root,root,755) | |
2d1bc323 | 228 | %{_libdir}/libprotobuf-lite.a |
e5c615f2 JB |
229 | %{_libdir}/libprotobuf.a |
230 | %{_libdir}/libprotoc.a | |
8e6a7c84 | 231 | |
d7b23517 ER |
232 | %if %{with python} |
233 | %files -n python-protobuf | |
234 | %defattr(644,root,root,755) | |
235 | %doc python/README.txt | |
236 | %dir %{py_sitescriptdir}/google | |
237 | %{py_sitescriptdir}/google/protobuf | |
238 | %{py_sitescriptdir}/protobuf-%{version}-py*.egg-info | |
239 | %{py_sitescriptdir}/protobuf-%{version}-py*-nspkg.pth | |
240 | %endif | |
241 | ||
8e6a7c84 ER |
242 | %files -n vim-syntax-protobuf |
243 | %defattr(644,root,root,755) | |
244 | %{_datadir}/vim/ftdetect/proto.vim | |
245 | %{_datadir}/vim/syntax/proto.vim |