summaryrefslogtreecommitdiff
path: root/contrib/thrift.spec
diff options
context:
space:
mode:
authorjfarrell <jfarrell@apache.org>2014-01-10 13:12:46 -0500
committerjfarrell <jfarrell@apache.org>2014-01-10 13:12:46 -0500
commit11c813ea3c36b6211991c01e6c24055ea682f7bf (patch)
tree6e025070ac3c6df8535e028f3f41a395c72ed82e /contrib/thrift.spec
parentf41d79d1448a495e27a84ffe6625de20ec69e642 (diff)
downloadthrift-11c813ea3c36b6211991c01e6c24055ea682f7bf.tar.gz
Thrift-2309: Ruby and PHP added to RPM subpackages
Client: build Patch: Nevo Hed Adds ruby and php libs to the rpm.
Diffstat (limited to 'contrib/thrift.spec')
-rw-r--r--contrib/thrift.spec50
1 files changed, 50 insertions, 0 deletions
diff --git a/contrib/thrift.spec b/contrib/thrift.spec
index 7aa7a16c8..4197390c8 100644
--- a/contrib/thrift.spec
+++ b/contrib/thrift.spec
@@ -46,6 +46,12 @@ BuildRequires: ant >= 0:1.6.5
BuildRequires: python-devel
%endif
+%if 0%{!?without_ruby:1}
+%define gem_name %{name}
+BuildRequires: ruby-devel
+BuildRequires: rubygems-devel
+%endif
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
@@ -124,16 +130,50 @@ Python libraries for Thrift.
%endif
+%if 0%{!?without_ruby:1}
+%package -n rubygem-%{gem_name}
+Summary: Thrift Ruby library
+Group: Libraries
+Obsoletes: %{name}-lib-ruby
+
+%description -n rubygem-%{gem_name}
+Ruby libraries for Thrift.
+
+%files -n rubygem-%{gem_name}
+%defattr(-,root,root)
+%{gem_dir}/*
+%endif
+
+
+%if 0%{!?without_php:1}
+%package lib-php
+Summary: Thrift PHP library
+Group: Libraries
+
+%description lib-php
+PHP libraries for Thrift.
+
+%files lib-php
+%defattr(-,root,root)
+/usr/lib/php/*
+%endif
+
+
%prep
%setup -q
%build
+export GEM_HOME=${PWD}/.gem-home
+export RUBYLIB=${PWD}/lib/rb/lib
%configure \
%{?without_libevent: --without-libevent } \
%{?without_zlib: --without-zlib } \
%{?without_tests: --without-tests } \
%{?without_java: --without-java } \
%{?without_python: --without-python } \
+ %{?without_ruby: --without-ruby } \
+ %{?without_php: --without-php } \
+ %{!?without_php: PHP_PREFIX=${RPM_BUILD_ROOT}/usr/lib/php } \
--without-csharp \
--without-erlang \
@@ -151,7 +191,13 @@ CFLAGS="%{optflags}" %{__python} setup.py build
cd ../..
%endif
+%if 0%{!?without_ruby:1}
+%gem_install -n lib/rb/thrift*.gem
+%endif
+
%install
+export GEM_HOME=${PWD}/.gem-home
+export RUBYLIB=${PWD}/lib/rb/lib
%makeinstall
ln -s libthrift-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthrift.so.0
ln -s libthriftnb-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftnb.so.0
@@ -168,6 +214,10 @@ cd lib/py
cd ../..
%endif
+%if 0%{!?without_ruby:1}
+mkdir -p %{buildroot}%{gem_dir}
+cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
+%endif
%clean
rm -rf ${RPM_BUILD_ROOT}