]> git.pld-linux.org Git - packages/protobuf.git/blob - protobuf.spec
- setuptools is fine too
[packages/protobuf.git] / protobuf.spec
1 # TODO:
2 #       - add bindings for java
3 #
4 # Conditional build:
5 #
6 %bcond_without  python  # Python bindings
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.4.1
12 Release:        2
13 License:        BSD
14 Group:          Libraries
15 Source0:        http://protobuf.googlecode.com/files/%{name}-%{version}.tar.bz2
16 # Source0-md5:  ed436802019c9e1f40cc750eaf78f318
17 Source1:        ftdetect-proto.vim
18 URL:            http://code.google.com/p/protobuf/
19 BuildRequires:  autoconf
20 BuildRequires:  rpmbuild(macros) >= 1.219
21 BuildRequires:  automake
22 BuildRequires:  libstdc++-devel
23 BuildRequires:  libtool
24 BuildRequires:  pkgconfig
25 BuildRequires:  zlib-devel
26 %if %{with python}
27 BuildRequires:  python-devel
28 BuildRequires:  python-setuptools
29 BuildRequires:  rpm-pythonprov
30 %endif
31 Requires:       %{name}-libs = %{version}-%{release}
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %define         _vimdatadir     %{_datadir}/vim
35
36 %description
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
51
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.
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
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
87 %package devel
88 Summary:        Protocol Buffers C++ headers and libraries
89 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek protobuf
90 Group:          Development/Libraries
91 Requires:       %{name} = %{version}-%{release}
92 Requires:       %{name}-libs = %{version}-%{release}
93 Requires:       libstdc++-devel
94
95 %description devel
96 This package contains Protocol Buffers compiler for all languages and
97 C++ headers and libraries
98
99 %description devel -l pl.UTF-8
100 Pliki nagłówkowe bibliotek protobuf.
101
102 %package static
103 Summary:        Static development files for protobuf
104 Summary(pl.UTF-8):      Statyczne biblioteki protobuf
105 Group:          Development/Libraries
106 Requires:       %{name}-devel = %{version}-%{release}
107
108 %description static
109 Static libraries for Protocol Buffers
110
111 %description static -l pl.UTF-8
112 Statyczne biblioteki protobuf.
113
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
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
133 %prep
134 %setup -q
135
136 %build
137 %configure
138 %{__make}
139
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
147 %install
148 rm -rf $RPM_BUILD_ROOT
149 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
150
151 %{__make} install \
152         STRIPBINARIES=no \
153         INSTALL="install -p"  \
154         CPPROG="cp -p" \
155         DESTDIR=$RPM_BUILD_ROOT
156
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
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
171 cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
172
173 %clean
174 rm -rf $RPM_BUILD_ROOT
175
176 %post   -p /sbin/ldconfig
177 %postun -p /sbin/ldconfig
178
179 %post   libs -p /sbin/ldconfig
180 %postun libs -p /sbin/ldconfig
181
182 %post   lite -p /sbin/ldconfig
183 %postun lite -p /sbin/ldconfig
184
185 %files
186 %defattr(644,root,root,755)
187 %doc CHANGES.txt CONTRIBUTORS.txt README.txt
188 %attr(755,root,root) %{_bindir}/protoc
189 %attr(755,root,root) %{_libdir}/libprotoc.so.*.*.*
190 %attr(755,root,root) %ghost %{_libdir}/libprotoc.so.7
191
192 %files libs
193 %defattr(644,root,root,755)
194 %attr(755,root,root) %{_libdir}/libprotobuf.so.*.*.*
195 %attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.7
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
201
202 %files devel
203 %defattr(644,root,root,755)
204 %attr(755,root,root) %{_libdir}/libprotobuf-lite.so
205 %attr(755,root,root) %{_libdir}/libprotobuf.so
206 %attr(755,root,root) %{_libdir}/libprotoc.so
207 %{_libdir}/libprotobuf-lite.la
208 %{_libdir}/libprotobuf.la
209 %{_libdir}/libprotoc.la
210 %{_includedir}/google
211 %{_examplesdir}/%{name}-%{version}
212 %{_pkgconfigdir}/protobuf-lite.pc
213 %{_pkgconfigdir}/protobuf.pc
214
215 %files static
216 %defattr(644,root,root,755)
217 %{_libdir}/libprotobuf-lite.a
218 %{_libdir}/libprotobuf.a
219 %{_libdir}/libprotoc.a
220
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
231 %files -n vim-syntax-protobuf
232 %defattr(644,root,root,755)
233 %{_datadir}/vim/ftdetect/proto.vim
234 %{_datadir}/vim/syntax/proto.vim
This page took 0.080334 seconds and 4 git commands to generate.