2 # - rename -libs to -cpp, -devel to -cpp-devel, -static to -cpp-static?
3 # - no SONAME ext in -libs, enforce some?
4 # - BR for java, ruby, perl, more general BR
5 # - Separate packages per each language
6 # - fix perl: missing vendordir on install
7 # - fix java: not installing to %{_javadir}
8 # - avoid downloading from net when build building java
11 # - Fix parallel build make.
13 # TODO (2) - fix or disable
14 # - java - br, build, files - icedtea7 ?
15 # - erlang - build, files
16 # - php_extension - br, build
17 # - ruby - build, files, some gems required for build?
18 # - haskell - build, files
19 # - d - needs working dmd or gdm to build
24 %bcond_with tests # build with tests
27 %bcond_without cpp # build the C++ library
28 %bcond_with qt4 # build the Qt4 library
29 %bcond_with qt5 # build the Qt5 library
30 %bcond_without c_glib # build the C (GLib) library
31 %bcond_with csharp # build the C# library
32 %bcond_with java # build the Java library
33 %bcond_with erlang # build the Erlang library
34 %bcond_with nodejs # build nodejs library
35 %bcond_with lua # build Lua library
36 %bcond_without python # build the Python library
37 %bcond_with perl # build the Perl library
38 %bcond_with php # build the PHP library
39 %bcond_with php_extension # build the PHP_EXTENSION library
40 %bcond_with ruby # build the Ruby library
41 %bcond_with haskell # build the Haskell library
42 %bcond_with go # build the Go library
43 %bcond_with d # build the D library
50 %define php_name php55
53 %define php_min_version 5.3.0
54 %include /usr/lib/rpm/macros.perl
55 Summary: Framework for scalable cross-language services development
56 Summary(pl.UTF-8): Szkielet budowania skalowalnych usług dla różnych języków programowania
61 Group: Development/Libraries
62 Source0: http://www.apache.org/dist/thrift/%{version}/%{name}-%{version}.tar.gz
63 # Source0-md5: 88d667a8ae870d5adeca8cb7d6795442
64 Patch0: %{name}-Werror_strlcpy_fix.patch
65 Patch1: %{name}-cpp_link_fix.patch
66 URL: http://thrift.apache.org/
67 BuildRequires: autoconf
68 BuildRequires: automake >= 1:1.13
69 BuildRequires: bison >= 2.5
70 BuildRequires: boost-devel >= 1.54.0
72 BuildRequires: libevent-devel
73 BuildRequires: pkgconfig
74 BuildRequires: python-devel >= 1:2.4
75 BuildRequires: rpm-pythonprov
76 BuildRequires: rpmbuild(macros) >= 1.219
77 BuildRequires: zlib-devel >= 1.2.3
79 BuildRequires: QtNetwork-devel
82 BuildRequires: glib2-devel
85 BuildRequires: mono-csharp
86 BuildRequires: mono-devel
89 BuildRequires: java-gcj-compat-devel
90 BuildRequires: java-ivy
93 BuildRequires: lua51-devel
100 BuildRequires: python
101 BuildRequires: python-TwistedCore
104 BuildRequires: perl-Bit-Vector
105 BuildRequires: perl-Class-Accessor
106 BuildRequires: perl-base
109 BuildRequires: %{php_name}-cli
110 BuildRequires: %{php_name}-devel
111 BuildRequires: phpunit
114 BuildRequires: erlang
118 BuildRequires: ruby-bundler
122 BuildRequires: ghc-haskell-platform
125 BuildRequires: golang
130 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
132 # library use symbols provided by the glib2 libraries
133 %define skip_post_check_so libthrift_c_glib.so.*
136 The Apache Thrift software framework, for scalable cross-language
137 services development, combines a software stack with a code generation
138 engine to build services that work efficiently and seamlessly between
139 C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa,
140 JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages.
142 %description -l pl.UTF-8
143 Programowy szkielet dla rozwoju skalowanych usług dla różnych języków
144 programowania. Zawiera oprogramowanie wraz silnikiem generowania kodu
145 do tworzenie usług które spawnie działają pomiędzy C++, Javą,
146 Pythonem, PHP, Rybym, Erlangiem, Perlem, Haskellem, C#, Cocoa,
147 Smalltalikiem i Ocamlem.
150 Summary: C++ header files
151 Summary(pl.UTF-8): Pliki nagłówkowe i bibliotek iterfejsu C++ thrift
152 Group: Development/Libraries
153 Requires: %{name}-libs = %{version}-%{release}
156 Header and libarary files for C++ thrift inteface.
158 %description devel -l pl.UTF-8
159 Pliki nagłówkowe i bibliotek iterfejsu C++ thrift.
162 Summary: Thrift C++ static libraries
163 Summary(pl.UTF-8): Biblioteki statyczne iterfejsu C++ thrift
164 Group: Development/Libraries
165 Requires: %{name}-devel = %{version}-%{release}
168 Static libarary files for C++ thrift inteface.
170 %description static -l pl.UTF-8
171 Statyczne biblioteki iterfejsu C++ thrift.
174 Summary: C++ thrift interface libraries
175 Summary(pl.UTF-8): Interfejs thrift dla C++
176 Group: Development/Libraries
177 Requires: %{name} = %{version}-%{release}
180 C++ thrift interface libraries
182 %description libs -l pl.UTF-8
183 Biblioteki interfejsu thrift dla C++.
185 %package -n php-%{name}
186 Summary: PHP Thrift interface
187 Summary(pl.UTF-8): Interfejs Thrift dla PHP
188 Group: Development/Languages/PHP
189 Requires: %{name} = %{version}-%{release}
190 Requires: php(core) >= %{php_min_version}
192 %description -n php-%{name}
193 PHP Thrift interface.
195 %package -n python-%{name}
196 Summary: Python thrift interface
197 Summary(pl.UTF-8): Interfejs thrift dla Pythona
198 Group: Development/Languages/Python
199 Requires: %{name} = %{version}-%{release}
201 %description -n python-%{name}
202 Python thrift interface.
204 %description -n python-%{name} -l pl.UTF-8
205 Interfejs thrift dla Pythona.
207 %package -n perl-Thrift
208 Summary: Perl thrift interface
209 Summary(pl.UTF-8): Interfejs thrift dla Perla
210 Group: Development/Languages/Perl
211 Requires: %{name} = %{version}-%{release}
213 %description -n perl-Thrift
214 Perl thrift interface.
216 %description -n perl-Thrift -l pl.UTF-8
217 Interfejs thrift dla Perla.
225 %{__aclocal} -I aclocal
230 PHP_PREFIX=%{php_data_dir} \
232 PERL_PREFIX=%{perl_vendorlib} \
233 %{__with_without cpp} \
234 %{__with_without qt4} \
235 %{__with_without qt5} \
236 %{__with_without c_glib} \
237 %{__with_without csharp} \
238 %{__with_without java} \
239 %{__with_without erlang} \
240 %{__with_without python} \
241 %{__with_without bcond_without} \
242 %{__with_without perl} \
243 %{__with_without php} \
244 %{__with_without php_extension} \
245 %{__with_without ruby} \
246 %{__with_without haskell} \
247 %{__with_without go} \
248 %{__with_without d} \
255 %{__with_without tests}
260 rm -rf $RPM_BUILD_ROOT
262 DESTDIR=$RPM_BUILD_ROOT
265 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
266 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
271 %{__mv} $RPM_BUILD_ROOT%{perl_vendorlib}/lib/perl5/Thrift{,.pm} $RPM_BUILD_ROOT%{perl_vendorlib}
275 rm -rf $RPM_BUILD_ROOT
277 %post libs -p /sbin/ldconfig
278 %postun libs -p /sbin/ldconfig
281 %defattr(644,root,root,755)
282 %attr(755,root,root) %{_bindir}/thrift
286 %defattr(644,root,root,755)
287 %{_libdir}/libthrift-%{version}.so
288 %{_libdir}/libthriftnb-%{version}.so
289 %{_libdir}/libthriftz-%{version}.so
291 %{_libdir}/libthriftqt-%{version}.so
294 %{_libdir}/libthriftqt5-%{version}.so
297 %{_libdir}/libthrift_c_glib.so.*
301 %defattr(644,root,root,755)
302 %{_libdir}/libthrift.la
303 %{_libdir}/libthriftnb.la
304 %{_libdir}/libthriftz.la
305 %{_libdir}/libthrift.so
306 %{_libdir}/libthriftnb.so
307 %{_libdir}/libthriftz.so
308 %{_includedir}/thrift
309 %{_pkgconfigdir}/thrift-nb.pc
310 %{_pkgconfigdir}/thrift-z.pc
311 %{_pkgconfigdir}/thrift.pc
313 %{_libdir}/libthriftqt.so
314 %{_libdir}/libthriftqt.la
315 %{_pkgconfigdir}/thrift-qt.pc
318 %{_libdir}/libthriftqt5.so
319 %{_libdir}/libthriftqt5.la
320 %{_pkgconfigdir}/thrift-qt5.pc
323 %{_libdir}/libthrift_c_glib.so
324 %{_libdir}/libthrift_c_glib.la
325 %{_pkgconfigdir}/thrift_c_glib.pc
329 %defattr(644,root,root,755)
330 %{_libdir}/libthrift.a
331 %{_libdir}/libthriftnb.a
332 %{_libdir}/libthriftz.a
334 %{_libdir}/libthriftqt.a
337 %{_libdir}/libthriftqt5.a
340 %{_libdir}/libthrift_c_glib.a
345 %files -n php-%{name}
346 %defattr(644,root,root,755)
347 %{php_data_dir}/Thrift
351 %files -n python-%{name}
352 %defattr(644,root,root,755)
353 %dir %{py_sitedir}/%{name}
354 %dir %{py_sitedir}/%{name}/protocol
355 %{py_sitedir}/%{name}/protocol/*.py[co]
356 %attr(755,root,root) %{py_sitedir}/%{name}/protocol/fastbinary.so
357 %dir %{py_sitedir}/%{name}/server
358 %{py_sitedir}/%{name}/server/*.py[co]
359 %dir %{py_sitedir}/%{name}/transport
360 %{py_sitedir}/%{name}/transport/*.py[co]
361 %{py_sitedir}/%{name}/*.py[co]
362 %if "%{py_ver}" > "2.4"
363 %{py_sitedir}/thrift-%{version}-py*.egg-info
368 %files -n perl-Thrift
369 %defattr(644,root,root,755)
370 %dir %{perl_vendorlib}/Thrift
371 %{perl_vendorlib}/Thrift.pm
372 %{perl_vendorlib}/Thrift/*.pm