]> git.pld-linux.org Git - packages/protobuf.git/blob - protobuf.spec
- no need to regenerate libtool
[packages/protobuf.git] / protobuf.spec
1 # TODO:
2 #       - add bindings for java
3 #       - tests fail: 2 of 5 tests failed
4 #
5 # Conditional build:
6 #
7 %bcond_without  python  # Python bindings
8 %bcond_with             tests   # build with tests
9
10 Summary:        Protocol Buffers - Google's data interchange format
11 Summary(pl.UTF-8):      Protocol Buffers - format wymiany danych Google
12 Name:           protobuf
13 Version:        2.4.1
14 Release:        2
15 License:        BSD
16 Group:          Libraries
17 Source0:        http://protobuf.googlecode.com/files/%{name}-%{version}.tar.bz2
18 # Source0-md5:  ed436802019c9e1f40cc750eaf78f318
19 Source1:        ftdetect-proto.vim
20 Patch0:         system-gtest.patch
21 URL:            http://code.google.com/p/protobuf/
22 BuildRequires:  autoconf
23 BuildRequires:  automake
24 %{?with_tests:BuildRequires:    gtest-devel}
25 BuildRequires:  libstdc++-devel
26 BuildRequires:  pkgconfig
27 BuildRequires:  rpmbuild(macros) >= 1.219
28 BuildRequires:  zlib-devel
29 %if %{with python}
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 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.
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
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
89 %package devel
90 Summary:        Protocol Buffers C++ headers and libraries
91 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek protobuf
92 Group:          Development/Libraries
93 Requires:       %{name} = %{version}-%{release}
94 Requires:       %{name}-libs = %{version}-%{release}
95 Requires:       libstdc++-devel
96
97 %description devel
98 This package contains Protocol Buffers compiler for all languages and
99 C++ headers and libraries
100
101 %description devel -l pl.UTF-8
102 Pliki nagłówkowe bibliotek protobuf.
103
104 %package static
105 Summary:        Static development files for protobuf
106 Summary(pl.UTF-8):      Statyczne biblioteki protobuf
107 Group:          Development/Libraries
108 Requires:       %{name}-devel = %{version}-%{release}
109
110 %description static
111 Static libraries for Protocol Buffers
112
113 %description static -l pl.UTF-8
114 Statyczne biblioteki protobuf.
115
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
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
135 %prep
136 %setup -q
137 %patch0 -p1
138 %{__rm} -r gtest
139
140 %build
141 %{__aclocal} -I m4
142 %{__autoconf}
143 %{__automake}
144 %configure
145 %{__make}
146
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
154 %if %{with tests}
155 %{__make} check
156 %endif
157
158 %install
159 rm -rf $RPM_BUILD_ROOT
160 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
161
162 %{__make} install \
163         STRIPBINARIES=no \
164         INSTALL="install -p"  \
165         CPPROG="cp -p" \
166         DESTDIR=$RPM_BUILD_ROOT
167
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
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
182 cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
183
184 %clean
185 rm -rf $RPM_BUILD_ROOT
186
187 %post   -p /sbin/ldconfig
188 %postun -p /sbin/ldconfig
189
190 %post   libs -p /sbin/ldconfig
191 %postun libs -p /sbin/ldconfig
192
193 %post   lite -p /sbin/ldconfig
194 %postun lite -p /sbin/ldconfig
195
196 %files
197 %defattr(644,root,root,755)
198 %doc CHANGES.txt CONTRIBUTORS.txt README.txt
199 %attr(755,root,root) %{_bindir}/protoc
200 %attr(755,root,root) %{_libdir}/libprotoc.so.*.*.*
201 %attr(755,root,root) %ghost %{_libdir}/libprotoc.so.7
202
203 %files libs
204 %defattr(644,root,root,755)
205 %attr(755,root,root) %{_libdir}/libprotobuf.so.*.*.*
206 %attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.7
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
212
213 %files devel
214 %defattr(644,root,root,755)
215 %attr(755,root,root) %{_libdir}/libprotobuf-lite.so
216 %attr(755,root,root) %{_libdir}/libprotobuf.so
217 %attr(755,root,root) %{_libdir}/libprotoc.so
218 %{_libdir}/libprotobuf-lite.la
219 %{_libdir}/libprotobuf.la
220 %{_libdir}/libprotoc.la
221 %{_includedir}/google
222 %{_examplesdir}/%{name}-%{version}
223 %{_pkgconfigdir}/protobuf-lite.pc
224 %{_pkgconfigdir}/protobuf.pc
225
226 %files static
227 %defattr(644,root,root,755)
228 %{_libdir}/libprotobuf-lite.a
229 %{_libdir}/libprotobuf.a
230 %{_libdir}/libprotoc.a
231
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
242 %files -n vim-syntax-protobuf
243 %defattr(644,root,root,755)
244 %{_datadir}/vim/ftdetect/proto.vim
245 %{_datadir}/vim/syntax/proto.vim
This page took 0.04606 seconds and 4 git commands to generate.