#
# language options
%bcond_without cpp # build the C++ library
-%bcond_without qt4 # build the Qt library
+%bcond_with qt4 # build the Qt4 library
+%bcond_with qt5 # build the Qt5 library
%bcond_without c_glib # build the C (GLib) library
-%bcond_without csharp # build the C# library
+%bcond_with csharp # build the C# library
%bcond_with java # build the Java library
%bcond_with erlang # build the Erlang library
+%bcond_with nodejs # build nodejs library
+%bcond_with lua # build Lua library
%bcond_without python # build the Python library
-%bcond_without perl # build the Perl library
-%bcond_without php # build the PHP library
+%bcond_with perl # build the Perl library
+%bcond_with php # build the PHP library
%bcond_with php_extension # build the PHP_EXTENSION library
%bcond_with ruby # build the Ruby library
%bcond_with haskell # build the Haskell library
-%bcond_without go # build the Go library
+%bcond_with go # build the Go library
%bcond_with d # build the D library
-%include /usr/lib/rpm/macros.perl
+%if %{with perl}
+%define pdir Thrift
+%endif
+
+%if 0%{!?php_name:1}
+%define php_name php55
+%endif
%define php_min_version 5.3.0
+%include /usr/lib/rpm/macros.perl
Summary: Framework for scalable cross-language services development
Summary(pl.UTF-8): Szkielet budowania skalowalnych usług dla różnych języków programowania
Name: thrift
-Version: 0.9.1
-Release: 0.4
+Version: 0.9.3
+Release: 2.2
License: Apache v2.0
Group: Development/Libraries
Source0: http://www.apache.org/dist/thrift/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: d2e46148f6e800a9492dbd848c66ab6e
+# Source0-md5: 88d667a8ae870d5adeca8cb7d6795442
Patch0: %{name}-Werror_strlcpy_fix.patch
Patch1: %{name}-cpp_link_fix.patch
URL: http://thrift.apache.org/
BuildRequires: autoconf
-BuildRequires: automake
-BuildRequires: bison
-BuildRequires: boost-devel >= 1.33.1
+BuildRequires: automake >= 1:1.13
+BuildRequires: bison >= 2.5
+BuildRequires: boost-devel >= 1.54.0
BuildRequires: flex
BuildRequires: libevent-devel
BuildRequires: pkgconfig
BuildRequires: glib2-devel
%endif
%if %{with csharp}
-BuildRequires: mono-devel
BuildRequires: mono-csharp
+BuildRequires: mono-devel
%endif
%if %{with java}
BuildRequires: java-gcj-compat-devel
BuildRequires: java-ivy
%endif
+%if %{with lua}
+BuildRequires: lua51-devel
+%endif
+%if %{with nodejs}
+BuildRequires: nodejs
+BuildRequires: npm
+%endif
%if %{with python}
BuildRequires: python
BuildRequires: python-TwistedCore
%endif
%if %{with perl}
-BuildRequires: perl-base
BuildRequires: perl-Bit-Vector
+BuildRequires: perl-Class-Accessor
+BuildRequires: perl-base
%endif
%if %{with php}
-BuildRequires: php-devel
-BuildRequires: php-program
-BuildRequires: php-phpunit-PHPUnit
+BuildRequires: %{php_name}-cli
+BuildRequires: %{php_name}-devel
+BuildRequires: phpunit
%endif
%if %{with erlang}
BuildRequires: erlang
%endif
%if %{with ruby}
BuildRequires: ruby
-BuildRequires: ruby-rake
BuildRequires: ruby-bundler
%endif
%if %{with haskell}
%{__automake}
%configure \
PHP_PREFIX=%{php_data_dir} \
+ PHP=%{__php} \
PERL_PREFIX=%{perl_vendorlib} \
%{__with_without cpp} \
%{__with_without qt4} \
+ %{__with_without qt5} \
%{__with_without c_glib} \
%{__with_without csharp} \
%{__with_without java} \
%{__with_without erlang} \
+ %{__with_without nodejs} \
%{__with_without python} \
- %{__with_without bcond_without} \
+ %{__with_without lua} \
%{__with_without perl} \
%{__with_without php} \
%{__with_without php_extension} \
%{__with_without haskell} \
%{__with_without go} \
%{__with_without d} \
+ --enable-libs \
--with-boost \
--with-libevent \
--with-zlib \
+ --disable-tutorial \
+ --disable-tests \
%{__with_without tests}
-%{__make} -j1
+%{__make} -j1
%install
rm -rf $RPM_BUILD_ROOT
-
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+%if %{with python}
%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
%py_comp $RPM_BUILD_ROOT%{py_sitedir}
%py_postclean
+%endif
%if %{with perl}
%{__mv} $RPM_BUILD_ROOT%{perl_vendorlib}/lib/perl5/Thrift{,.pm} $RPM_BUILD_ROOT%{perl_vendorlib}
%files
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/thrift
+
%if %{with cpp}
%files libs
%defattr(644,root,root,755)
%if %{with qt4}
%{_libdir}/libthriftqt-%{version}.so
%endif
+%if %{with qt5}
+%{_libdir}/libthriftqt5-%{version}.so
+%endif
%if %{with c_glib}
%{_libdir}/libthrift_c_glib.so.*
%endif
%{_libdir}/libthriftqt.la
%{_pkgconfigdir}/thrift-qt.pc
%endif
+%if %{with qt5}
+%{_libdir}/libthriftqt5.so
+%{_libdir}/libthriftqt5.la
+%{_pkgconfigdir}/thrift-qt5.pc
+%endif
%if %{with c_glib}
%{_libdir}/libthrift_c_glib.so
%{_libdir}/libthrift_c_glib.la
%if %{with qt4}
%{_libdir}/libthriftqt.a
%endif
+%if %{with qt5}
+%{_libdir}/libthriftqt5.a
+%endif
%if %{with c_glib}
%{_libdir}/libthrift_c_glib.a
%endif