# Python %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} # Ruby %{!?ruby_sitelib: %global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")} %{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")} %define snapshot 770888 Name: thrift Version: 0.0 Release: 0%{?dist}.20090505svn%{snapshot} Summary: A multi-language RPC and serialization framework Group: System Environment/Libraries License: ASL 2.0 URL: http://incubator.apache.org/thrift # svn export http://svn.apache.org/repos/asf/incubator/thrift/trunk -r %{snapshot} thrift-0.0 # tar -czf thrift-0.0.tar.gz thrift-0.0/ Source0: %{name}-%{version}.tar.gz Source1: thrift_protocol.ini BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: byacc BuildRequires: boost-devel >= 1.33.1 BuildRequires: flex BuildRequires: libevent-devel BuildRequires: libtool BuildRequires: zlib-devel # Hack instead of patching BuildRequires: mono-devel %description Thrift is a software framework for scalable cross-language services development. It combines a powerful software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, C#, Python, Ruby, Perl, PHP, Objective C/Cocoa, Smalltalk, Erlang, Objective Caml, and Haskell. %package cpp Summary: Libraries for %{name} Group: Development/Libraries %description cpp Libraries bindings for %{name}. %package cpp-devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name}-cpp = %{version}-%{release} %description cpp-devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %package perl Summary: Perl bindings for %{name} Group: Development/Libraries BuildRequires: perl Requires: perl-Bit-Vector %description perl Perl bindings for %{name}. %package python Summary: Python bindings for %{name} Group: Development/Libraries BuildRequires: python-devel %description python Python bindings for %{name}. %package ruby Summary: Ruby bindings for %{name} Group: Development/Libraries BuildRequires: ruby BuildRequires: ruby-devel %description ruby Ruby bindings for %{name}. %prep %setup -q # Fix spurious-executable-perm warning find tutorial/ -type f -exec chmod 0644 {} \; # Haskell setup script won't run with blank or comment lines sed -i '/#/d;/^$/d' lib/hs/Setup.lhs %build ./bootstrap.sh %configure --without-java --without-perl --without-ruby --enable-static=no --without-csharp --enable-gen-csharp=no --enable-gen-cocoa=no --enable-gen-st=no --enable-gen-ocaml=no --enable-gen-hs=no %{__make} %{?_smp_mflags} # Build Perl pushd lib/perl perl Makefile.PL %{__make} %{?_smp_mflags} CFLAGS="%{optflags}" popd # Build Ruby pushd lib/rb ruby setup.rb config ruby setup.rb setup popd %install rm -rf %{buildroot} # Install everything not listed below make DESTDIR=%{buildroot} install # Remove "la" files find %{buildroot} -type f -name "*.la" -exec rm -f {} ';' # Fix non-standard-executable-perm chmod 0755 %{buildroot}%{python_sitearch}/%{name}/protocol/fastbinary.so # Install Perl pushd lib/perl %{__make} DESTDIR=%{buildroot} INSTALLSITELIB=%{perl_vendorlib} install popd # Cleanup Perl install find %{buildroot} -type f -name .packlist -exec rm -f {} \; find %{buildroot} -type f -name perllocal.pod -exec rm -f {} \; find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null \; # Install Ruby pushd lib/rb ruby setup.rb install --prefix=%{buildroot} popd # Fix non-standard-executable-perm error chmod 0755 %{buildroot}%{ruby_sitearch}/thrift_native.so %clean rm -rf %{buildroot} %post cpp -p /sbin/ldconfig %postun cpp -p /sbin/ldconfig %files %defattr(-,root,root,-) %doc CHANGES LICENSE NEWS NOTICE README doc/ tutorial/ %{_bindir}/thrift %files cpp %defattr(-,root,root,-) %doc CONTRIBUTORS %{_libdir}/*.so.* %files cpp-devel %defattr(-,root,root,-) %doc README %{_includedir}/thrift %{_libdir}/*.so %{_libdir}/pkgconfig/thrift* %files perl %defattr(-,root,root,-) %doc lib/perl/README %{perl_vendorlib}/Thrift* %files python %defattr(-,root,root,-) %doc lib/py/README %{python_sitearch}/%{name} %files ruby %defattr(-,root,root,-) %doc lib/rb/CHANGELOG lib/rb/README %{ruby_sitearch}/thrift_native.so %{ruby_sitelib}/thrift* %changelog * Wed May 06 2009 Silas Sewell - 0.0-0.20090505svn770888 - Remove subpackages which don't build on EL5 * Fri May 01 2009 Silas Sewell - 0.0-0.20090501svn770888 - Initial build