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