From: Jake Farrell Date: Sun, 9 Jun 2013 01:25:48 +0000 (-0400) Subject: Thrift-1733: Fix RPM build issues on RHEL6 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=765bbfb551e72aa0207871ef1b8cfc7769d3578c;p=common%2Fthrift.git Thrift-1733: Fix RPM build issues on RHEL6 Client: contrib Patch: Kirby Files Updating thrift.spec for RHEL6 compatability. --- diff --git a/contrib/thrift.spec b/contrib/thrift.spec index ecee631a..b0bccb2d 100644 --- a/contrib/thrift.spec +++ b/contrib/thrift.spec @@ -17,40 +17,31 @@ # under the License. # -# TODO(dreiss): Have a Python build with and without the extension. %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} -# TODO(dreiss): Where is this supposed to go? -%{!?thrift_erlang_root: %define thrift_erlang_root /opt/thrift-erl} Name: thrift License: Apache License v2.0 Group: Development Summary: RPC and serialization framework -Version: 20080529svn -Epoch: 1 -Release: 1 -URL: http://developers.facebook.com/thrift -Packager: David Reiss +Version: 0.9.0 +Release: 0 +URL: http://thrift.apache.org +Packager: Thrift Developers Source0: %{name}-%{version}.tar.gz BuildRequires: gcc >= 3.4.6 BuildRequires: gcc-c++ -# TODO(dreiss): Can these be moved into the individual packages? -%if %{!?without_java: 1} +%if 0%{!?without_java:1} BuildRequires: java-devel >= 0:1.5.0 BuildRequires: ant >= 0:1.6.5 %endif -%if %{!?without_python: 1} +%if 0%{!?without_python:1} BuildRequires: python-devel %endif -%if %{!?without_erlang: 1} -BuildRequires: erlang -%endif - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description @@ -75,6 +66,7 @@ C++ libraries for Thrift. %files lib-cpp %defattr(-,root,root) %{_libdir}/libthrift*.so.* +%{_libdir}/libthrift*.so %package lib-cpp-devel @@ -82,10 +74,10 @@ Summary: Thrift C++ library development files Group: Libraries Requires: %{name} = %{version}-%{release} Requires: boost-devel -%if %{!?without_libevent: 1} +%if 0%{!?without_libevent:1} Requires: libevent-devel >= 1.2 %endif -%if %{!?without_zlib: 1} +%if 0%{!?without_zlib:1} Requires: zlib-devel %endif @@ -96,11 +88,10 @@ C++ static libraries and headers for Thrift. %defattr(-,root,root) %{_includedir}/thrift/ %{_libdir}/libthrift*.*a -%{_libdir}/libthrift*.so %{_libdir}/pkgconfig/thrift*.pc -%if %{!?without_java: 1} +%if 0%{!?without_java:1} %package lib-java Summary: Thrift Java library Group: Libraries @@ -115,7 +106,7 @@ Java libraries for Thrift. %endif -%if %{!?without_python: 1} +%if 0%{!?without_python:1} %package lib-python Summary: Thrift Python library Group: Libraries @@ -129,78 +120,63 @@ Python libraries for Thrift. %endif -%if %{!?without_erlang: 1} -%package lib-erlang -Summary: Thrift Python library -Group: Libraries -Requires: erlang - -%description lib-erlang -Erlang libraries for Thrift. - -%files lib-erlang -%defattr(-,root,root) -%{thrift_erlang_root} -%endif - - %prep %setup -q %build -# TODO(dreiss): Implement a single --without-build-kludges. %configure \ %{?without_libevent: --without-libevent } \ %{?without_zlib: --without-zlib } \ --without-java \ --without-csharp \ - --without-py \ + --without-python \ --without-erlang \ make -%if %{!?without_java: 1} +%if 0%{!?without_java:1} cd lib/java %ant cd ../.. %endif -%if %{!?without_python: 1} +%if 0%{!?without_python:1} cd lib/py CFLAGS="%{optflags}" %{__python} setup.py build cd ../.. %endif -%if %{!?without_erlang: 1} -cd lib/erl -make -cd ../.. -%endif - %install %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 +ln -s libthriftz-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftz.so.0 -%if %{!?without_java: 1} +%if 0%{!?without_java:1} mkdir -p $RPM_BUILD_ROOT%{_javadir} cp -p lib/java/*.jar $RPM_BUILD_ROOT%{_javadir} %endif -%if %{!?without_python: 1} +%if 0%{!?without_python:1} cd lib/py %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT cd ../.. %endif -%if %{!?without_erlang: 1} -mkdir -p ${RPM_BUILD_ROOT}%{thrift_erlang_root} -cp -r lib/erl/ebin ${RPM_BUILD_ROOT}%{thrift_erlang_root} -%endif - %clean rm -rf ${RPM_BUILD_ROOT} +%post +umask 007 +/sbin/ldconfig > /dev/null 2>&1 + + +%postun +umask 007 +/sbin/ldconfig > /dev/null 2>&1 + %changelog -* Wed May 28 2008 David Reiss - 20080529svn -- Initial build, based on the work of Kevin Smith and Ben Maurer. +* Wed Oct 10 2012 Thrift Dev +- Thrift 0.9.0 release.