# -- python macros for RHEL =< 5 %if 0%{?rhel} <= 5 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif # # -- thrift (Apache License v2.0) - spec file # http://thrift.apache.org # # -- Packaged for Fedora EPEL # Submit bug reports: http://bugzilla.redhat.com # # Nelson Marques # This spec file is served under the license as the main package # # Name: thrift Version: 0.6.1 Release: 3%{?dist} Summary: Framework for scalable cross-language services development Group: Development/Libraries License: ASL 2.0 Url: http://thrift.apache.org/ Source0: http://www.apache.org/dist/%{name}/%{version}/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: bison BuildRequires: boost-devel BuildRequires: flex BuildRequires: gcc-c++ # -- Requires for glib module BuildRequires: glib2-devel # -- Required for TNonblockingServer BuildRequires: libevent-devel # -- Requirements for perl BuildRequires: perl BuildRequires: perl(Bit::Vector) BuildRequires: perl(Class::Accessor) # -- only for RHEL >= 6 %if 0%{?rhel} >= 6 BuildRequires: perl(ExtUtils::MakeMaker) %endif # -- Requirements for php (php >= 5.2) BuildRequires: php53-devel # -- Requirements for python BuildRequires: python-devel # -- Required for TZlibTransport BuildRequires: zlib-devel # -- I want this BuildRequires: redhat-rpm-config # -- for personal debug on chroot cage #BuildRequires: rpmlint %description 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 devel Summary: Development files for thrift Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: %{name}-libs = %{version}-%{release} Requires: perl-%{name} = %{version}-%{release} Requires: php-%{name} = %{version}-%{release} Requires: pkgconfig Requires: python-%{name} = %{version}-%{release} %description devel A software framework for scalable cross-language service development. This package provides the development files. %package doc Summary: Documentation for thrift software framework Group: Documentation %description doc A software framework for scalable cross-language service development. This package provides the documentation files. %package libs Summary: System shared libraries for thrift software framework Group: Development/Libraries %description libs A software framework for scalable cross-language services development. This package provides the system shared libraries used by thirft. %package -n perl-%{name} Summary: Thrift perl software library Group: Development/Libraries Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) %if %{_arch} == x86_64 Requires: perl(Math::BigInt) %endif %description -n perl-%{name} Thrift requires Perl >= 5.6.0. Exceptions are thrown with die so be sure to wrap eval{} statments around any code that contains exceptions. The 64bit Integers work only up to 2^42 on my machine :-? Math::BigInt is probably needed. %package -n php-%{name} Summary: Thrift PHP software library Group: Development/Libraries %description -n php-%{name} Thrift requires PHP >= 5.2. Thrift makes as few assumptions about your PHP environment as possible while trying to make some more advanced PHP features (i.e. APC cacheing using asbolute path URLs) as simple as possible. %package -n python-%{name} Summary: This package provides the python bindings Group: Development/Libraries Requires: python %description -n python-%{name} Thrift is provided as a set of Python packages. The top level package is thrift, and there are subpackages for the protocol, transport, and server code. Each package contains modules using standard Thrift naming conventions (i.e. TProtocol, TTransport) and implementations in corresponding modules (i.e. TSocket). There is also a subpackage reflection, which contains the generated code for the reflection structures. %prep %setup -q %build export PHP_PREFIX=%{_libdir}/php %configure \ --enable-gen-cpp \ --enable-gen-c_glib \ --enable-gen-py \ --enable-gen-perl \ --enable-gen-html \ --enable-gen-js \ --with-libevent \ --with-zlib \ --with-boost \ --with-cpp \ --with-c_glib \ --with-python \ --with-perl \ --without-csharp \ --without-java \ --without-erlang \ --with-php \ --without-ruby \ --without-haskell \ --with-libevent # -- we can do parallel builds make %{?_smp_mflags} %install # -- install c++ stuff pushd compiler/cpp make DESTDIR=%{buildroot} install popd pushd lib/cpp make DESTDIR=%{buildroot} install popd # -- install C glib module pushd lib/c_glib make DESTDIR=%{buildroot} install popd # -- install python bindings pushd lib/py %{__python} setup.py install \ --root=%{buildroot} \ --prefix=%{_prefix} popd # -- install perl stuff pushd lib/perl %{__perl} Makefile.PL INSTALLDIRS=vendor make pure_install PERL_INSTALL_ROOT=%{buildroot} popd # -- install PHP stuff pushd lib/php make DESTDIR=%{buildroot} install popd # -- install tutorials on /usr/share/%%{name}-%%{version}/ mkdir -p %{buildroot}%{_datadir}/%{name}-%{version}/ cp -a tutorial %{buildroot}%{_datadir}/%{name}-%{version}/ # -- fix file end encoding find %{buildroot}%{_datadir}/%{name}-%{version}/ -type f -name "AssemblyInfo.cs" || \ sed -i 's/\r//' {} \; find %{buildroot}%{_datadir}/%{name}-%{version}/ -type f -name "CsharpClient.csproj" || \ sed -i 's/\r//' {} \; find %{buildroot}%{_datadir}/%{name}-%{version}/ -type f -name "tutorial.sln" || \ sed -i 's/\r//' {} \; find %{buildroot}%{_datadir}/%{name}-%{version}/ -type f -name "CsharpServer.cs" || \ sed -i 's/\r//' {} \; # -- remove libtool archives find %{buildroot}%{_libdir} -type f -name "*.la" -delete -print # -- remove static libraries find %{buildroot}%{_libdir} -type f -name "*.a" -delete -print # -- delete auto rm -r %{buildroot}%{perl_vendorarch}/auto %if 0%{?rhel} < 7 %clean rm -rf %{buildroot} %endif %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %files %defattr(-,root,root,-) %{_bindir}/thrift %files libs %defattr(-,root,root,-) %doc CONTRIBUTORS LICENSE %{_libdir}/libthrift.so.* %{_libdir}/libthriftnb.so.* %{_libdir}/libthriftz.so.* %{_libdir}/libthrift_c_glib.so.* %files devel %defattr(-,root,root,-) %doc CHANGES NEWS NOTICE %{_libdir}/libthrift.so %{_libdir}/libthriftnb.so %{_libdir}/libthriftz.so %{_libdir}/libthrift_c_glib.so %{_libdir}/pkgconfig/thrift.pc %{_libdir}/pkgconfig/thrift-nb.pc %{_libdir}/pkgconfig/thrift-z.pc %{_libdir}/pkgconfig/thrift_c_glib.pc %{_includedir}/thrift/ %attr(0755,root,root) %{_datadir}/%{name}-%{version}/tutorial/perl/PerlClient.pl %attr(0755,root,root) %{_datadir}/%{name}-%{version}/tutorial/perl/PerlServer.pl %{_datadir}/%{name}-%{version}/ %files doc %defattr(-,root,root,-) %doc doc/ %files -n perl-%{name} %defattr(-,root,root,-) %doc LICENSE %{perl_vendorlib}/Thrift.pm %{perl_vendorlib}/Thrift/ %files -n php-%{name} %defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/php.d/thrift_protocol.ini %{_libdir}/php/ %{_libdir}/php/modules/thrift_protocol.so %files -n python-%{name} %defattr(-,root,root,-) %doc LICENSE %{python_sitearch}/%{name}/ # -- we only get it on rhel >= 6 (python2.6+ ?) %if 0%{?rhel} >= 6 %{python_sitearch}/*.egg-info %endif %changelog * Mon Dec 02 2011 - Nelson Marques - 0.6.1-3 - Replaced macros %%{__cp}, %%{__make} and others - Merged glib sub-package with libs package - Improved descriptions and groups, added missing %%doc LICENSE to perl and python subpackages - Minor changes, BZ#758166 * Mon Dec 02 2011 - Nelson Marques - 0.6.1-2 - Enable build for PHP and GLIB modules: + Add "BuildRequires: php53-devel" and "BuildRequires: glib2-devel" + Add "php-thrift" and "thrift-glib" sub-packages. - Enable build for GLIB2 Module: - Add %%check section for future RHEL7 (hopefully with RPM >= 4.9) - Add %%define _group to spec file * Mon Nov 28 2011 - Nelson Marques - 0.6.1-1 - Initial package from upstream release 0.6.1