blob: b0bccb2dd232649f7b64af0a5f87c270f816012c [file] [log] [blame]
David Reisseaaf45c2009-03-30 22:52:46 +00001#
2# Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18#
19
David Reiss710440f2008-06-11 01:19:12 +000020%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
21%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
David Reiss710440f2008-06-11 01:19:12 +000022
23Name: thrift
Bryan Duxbury5bd71922009-04-01 21:01:56 +000024License: Apache License v2.0
David Reiss710440f2008-06-11 01:19:12 +000025Group: Development
26Summary: RPC and serialization framework
Jake Farrell765bbfb2013-06-08 21:25:48 -040027Version: 0.9.0
28Release: 0
29URL: http://thrift.apache.org
30Packager: Thrift Developers <dev@thrift.apache.org>
David Reiss710440f2008-06-11 01:19:12 +000031Source0: %{name}-%{version}.tar.gz
32
33BuildRequires: gcc >= 3.4.6
34BuildRequires: gcc-c++
35
Jake Farrell765bbfb2013-06-08 21:25:48 -040036%if 0%{!?without_java:1}
David Reiss710440f2008-06-11 01:19:12 +000037BuildRequires: java-devel >= 0:1.5.0
38BuildRequires: ant >= 0:1.6.5
39%endif
40
Jake Farrell765bbfb2013-06-08 21:25:48 -040041%if 0%{!?without_python:1}
David Reiss710440f2008-06-11 01:19:12 +000042BuildRequires: python-devel
43%endif
44
David Reiss710440f2008-06-11 01:19:12 +000045BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
46
47%description
48Thrift is a software framework for scalable cross-language services
49development. It combines a powerful software stack with a code generation
50engine to build services that work efficiently and seamlessly between C++,
51Java, C#, Python, Ruby, Perl, PHP, Objective C/Cocoa, Smalltalk, Erlang,
52Objective Caml, and Haskell.
53
54%files
55%defattr(-,root,root)
56%{_bindir}/thrift
David Reiss710440f2008-06-11 01:19:12 +000057
58
59%package lib-cpp
60Summary: Thrift C++ library
61Group: Libraries
62
63%description lib-cpp
64C++ libraries for Thrift.
65
66%files lib-cpp
67%defattr(-,root,root)
68%{_libdir}/libthrift*.so.*
Jake Farrell765bbfb2013-06-08 21:25:48 -040069%{_libdir}/libthrift*.so
David Reiss710440f2008-06-11 01:19:12 +000070
71
72%package lib-cpp-devel
73Summary: Thrift C++ library development files
74Group: Libraries
75Requires: %{name} = %{version}-%{release}
76Requires: boost-devel
Jake Farrell765bbfb2013-06-08 21:25:48 -040077%if 0%{!?without_libevent:1}
David Reiss710440f2008-06-11 01:19:12 +000078Requires: libevent-devel >= 1.2
79%endif
Jake Farrell765bbfb2013-06-08 21:25:48 -040080%if 0%{!?without_zlib:1}
David Reiss710440f2008-06-11 01:19:12 +000081Requires: zlib-devel
82%endif
83
84%description lib-cpp-devel
85C++ static libraries and headers for Thrift.
86
87%files lib-cpp-devel
88%defattr(-,root,root)
89%{_includedir}/thrift/
90%{_libdir}/libthrift*.*a
David Reiss710440f2008-06-11 01:19:12 +000091%{_libdir}/pkgconfig/thrift*.pc
92
93
Jake Farrell765bbfb2013-06-08 21:25:48 -040094%if 0%{!?without_java:1}
David Reiss710440f2008-06-11 01:19:12 +000095%package lib-java
96Summary: Thrift Java library
97Group: Libraries
98Requires: java >= 0:1.5.0
99
100%description lib-java
101Java libraries for Thrift.
102
103%files lib-java
104%defattr(-,root,root)
105%{_javadir}/*
106%endif
107
108
Jake Farrell765bbfb2013-06-08 21:25:48 -0400109%if 0%{!?without_python:1}
David Reiss710440f2008-06-11 01:19:12 +0000110%package lib-python
111Summary: Thrift Python library
112Group: Libraries
113
114%description lib-python
115Python libraries for Thrift.
116
117%files lib-python
118%defattr(-,root,root)
119%{python_sitearch}/*
120%endif
121
122
David Reiss710440f2008-06-11 01:19:12 +0000123%prep
124%setup -q
125
126%build
David Reiss710440f2008-06-11 01:19:12 +0000127%configure \
128 %{?without_libevent: --without-libevent } \
129 %{?without_zlib: --without-zlib } \
130 --without-java \
131 --without-csharp \
Jake Farrell765bbfb2013-06-08 21:25:48 -0400132 --without-python \
David Reiss710440f2008-06-11 01:19:12 +0000133 --without-erlang \
134
135make
136
Jake Farrell765bbfb2013-06-08 21:25:48 -0400137%if 0%{!?without_java:1}
David Reiss710440f2008-06-11 01:19:12 +0000138cd lib/java
139%ant
140cd ../..
141%endif
142
Jake Farrell765bbfb2013-06-08 21:25:48 -0400143%if 0%{!?without_python:1}
David Reiss710440f2008-06-11 01:19:12 +0000144cd lib/py
145CFLAGS="%{optflags}" %{__python} setup.py build
146cd ../..
147%endif
148
David Reiss710440f2008-06-11 01:19:12 +0000149%install
150%makeinstall
Jake Farrell765bbfb2013-06-08 21:25:48 -0400151ln -s libthrift-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthrift.so.0
152ln -s libthriftnb-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftnb.so.0
153ln -s libthriftz-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftz.so.0
David Reiss710440f2008-06-11 01:19:12 +0000154
Jake Farrell765bbfb2013-06-08 21:25:48 -0400155%if 0%{!?without_java:1}
David Reiss710440f2008-06-11 01:19:12 +0000156mkdir -p $RPM_BUILD_ROOT%{_javadir}
157cp -p lib/java/*.jar $RPM_BUILD_ROOT%{_javadir}
158%endif
159
Jake Farrell765bbfb2013-06-08 21:25:48 -0400160%if 0%{!?without_python:1}
David Reiss710440f2008-06-11 01:19:12 +0000161cd lib/py
162%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
163cd ../..
164%endif
165
David Reiss710440f2008-06-11 01:19:12 +0000166
167%clean
168rm -rf ${RPM_BUILD_ROOT}
169
170
Jake Farrell765bbfb2013-06-08 21:25:48 -0400171%post
172umask 007
173/sbin/ldconfig > /dev/null 2>&1
174
175
176%postun
177umask 007
178/sbin/ldconfig > /dev/null 2>&1
179
David Reiss710440f2008-06-11 01:19:12 +0000180%changelog
Jake Farrell765bbfb2013-06-08 21:25:48 -0400181* Wed Oct 10 2012 Thrift Dev <dev@thrift.apache.org>
182- Thrift 0.9.0 release.