Updated Branches: refs/heads/master f41d79d14 -> 11c813ea3
Thrift-2309: Ruby and PHP added to RPM subpackages Client: build Patch: Nevo Hed Adds ruby and php libs to the rpm. Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/11c813ea Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/11c813ea Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/11c813ea Branch: refs/heads/master Commit: 11c813ea3c36b6211991c01e6c24055ea682f7bf Parents: f41d79d Author: jfarrell <[email protected]> Authored: Fri Jan 10 13:12:46 2014 -0500 Committer: jfarrell <[email protected]> Committed: Fri Jan 10 13:12:46 2014 -0500 ---------------------------------------------------------------------- contrib/thrift.spec | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/11c813ea/contrib/thrift.spec ---------------------------------------------------------------------- diff --git a/contrib/thrift.spec b/contrib/thrift.spec index 7aa7a16..4197390 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}
