blob: 7aa7a16c85687ce812d6c5bae5b614665527e767 [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
jfarrell4b4f42b2013-11-27 12:45:49 -050020%define without_java 1
21%define without_python 1
22%define without_tests 1
23
David Reiss710440f2008-06-11 01:19:12 +000024%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
25%{!?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 +000026
27Name: thrift
Bryan Duxbury5bd71922009-04-01 21:01:56 +000028License: Apache License v2.0
David Reiss710440f2008-06-11 01:19:12 +000029Group: Development
30Summary: RPC and serialization framework
jfarrell4b4f42b2013-11-27 12:45:49 -050031Version: 0.9.1
Jake Farrell765bbfb2013-06-08 21:25:48 -040032Release: 0
33URL: http://thrift.apache.org
34Packager: Thrift Developers <dev@thrift.apache.org>
David Reiss710440f2008-06-11 01:19:12 +000035Source0: %{name}-%{version}.tar.gz
36
37BuildRequires: gcc >= 3.4.6
38BuildRequires: gcc-c++
39
Jake Farrell765bbfb2013-06-08 21:25:48 -040040%if 0%{!?without_java:1}
David Reiss710440f2008-06-11 01:19:12 +000041BuildRequires: java-devel >= 0:1.5.0
42BuildRequires: ant >= 0:1.6.5
43%endif
44
Jake Farrell765bbfb2013-06-08 21:25:48 -040045%if 0%{!?without_python:1}
David Reiss710440f2008-06-11 01:19:12 +000046BuildRequires: python-devel
47%endif
48
David Reiss710440f2008-06-11 01:19:12 +000049BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
50
51%description
52Thrift is a software framework for scalable cross-language services
53development. It combines a powerful software stack with a code generation
54engine to build services that work efficiently and seamlessly between C++,
55Java, C#, Python, Ruby, Perl, PHP, Objective C/Cocoa, Smalltalk, Erlang,
56Objective Caml, and Haskell.
57
58%files
59%defattr(-,root,root)
60%{_bindir}/thrift
David Reiss710440f2008-06-11 01:19:12 +000061
62
63%package lib-cpp
64Summary: Thrift C++ library
65Group: Libraries
66
67%description lib-cpp
68C++ libraries for Thrift.
69
70%files lib-cpp
71%defattr(-,root,root)
72%{_libdir}/libthrift*.so.*
Jake Farrell765bbfb2013-06-08 21:25:48 -040073%{_libdir}/libthrift*.so
David Reiss710440f2008-06-11 01:19:12 +000074
75
76%package lib-cpp-devel
77Summary: Thrift C++ library development files
78Group: Libraries
79Requires: %{name} = %{version}-%{release}
80Requires: boost-devel
Jake Farrell765bbfb2013-06-08 21:25:48 -040081%if 0%{!?without_libevent:1}
David Reiss710440f2008-06-11 01:19:12 +000082Requires: libevent-devel >= 1.2
83%endif
Jake Farrell765bbfb2013-06-08 21:25:48 -040084%if 0%{!?without_zlib:1}
David Reiss710440f2008-06-11 01:19:12 +000085Requires: zlib-devel
86%endif
87
88%description lib-cpp-devel
89C++ static libraries and headers for Thrift.
90
91%files lib-cpp-devel
92%defattr(-,root,root)
93%{_includedir}/thrift/
94%{_libdir}/libthrift*.*a
David Reiss710440f2008-06-11 01:19:12 +000095%{_libdir}/pkgconfig/thrift*.pc
96
97
Jake Farrell765bbfb2013-06-08 21:25:48 -040098%if 0%{!?without_java:1}
David Reiss710440f2008-06-11 01:19:12 +000099%package lib-java
100Summary: Thrift Java library
101Group: Libraries
102Requires: java >= 0:1.5.0
103
104%description lib-java
105Java libraries for Thrift.
106
107%files lib-java
108%defattr(-,root,root)
109%{_javadir}/*
110%endif
111
112
Jake Farrell765bbfb2013-06-08 21:25:48 -0400113%if 0%{!?without_python:1}
David Reiss710440f2008-06-11 01:19:12 +0000114%package lib-python
115Summary: Thrift Python library
116Group: Libraries
117
118%description lib-python
119Python libraries for Thrift.
120
121%files lib-python
122%defattr(-,root,root)
123%{python_sitearch}/*
124%endif
125
126
David Reiss710440f2008-06-11 01:19:12 +0000127%prep
128%setup -q
129
130%build
David Reiss710440f2008-06-11 01:19:12 +0000131%configure \
132 %{?without_libevent: --without-libevent } \
133 %{?without_zlib: --without-zlib } \
jfarrell4b4f42b2013-11-27 12:45:49 -0500134 %{?without_tests: --without-tests } \
135 %{?without_java: --without-java } \
136 %{?without_python: --without-python } \
David Reiss710440f2008-06-11 01:19:12 +0000137 --without-csharp \
David Reiss710440f2008-06-11 01:19:12 +0000138 --without-erlang \
139
jfarrell4b4f42b2013-11-27 12:45:49 -0500140make %{?_smp_mflags}
David Reiss710440f2008-06-11 01:19:12 +0000141
Jake Farrell765bbfb2013-06-08 21:25:48 -0400142%if 0%{!?without_java:1}
David Reiss710440f2008-06-11 01:19:12 +0000143cd lib/java
144%ant
145cd ../..
146%endif
147
Jake Farrell765bbfb2013-06-08 21:25:48 -0400148%if 0%{!?without_python:1}
David Reiss710440f2008-06-11 01:19:12 +0000149cd lib/py
150CFLAGS="%{optflags}" %{__python} setup.py build
151cd ../..
152%endif
153
David Reiss710440f2008-06-11 01:19:12 +0000154%install
155%makeinstall
Jake Farrell765bbfb2013-06-08 21:25:48 -0400156ln -s libthrift-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthrift.so.0
157ln -s libthriftnb-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftnb.so.0
158ln -s libthriftz-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftz.so.0
David Reiss710440f2008-06-11 01:19:12 +0000159
Jake Farrell765bbfb2013-06-08 21:25:48 -0400160%if 0%{!?without_java:1}
David Reiss710440f2008-06-11 01:19:12 +0000161mkdir -p $RPM_BUILD_ROOT%{_javadir}
jfarrell380a45d2013-10-04 22:50:21 -0400162cp -p lib/java/build/*.jar $RPM_BUILD_ROOT%{_javadir}
David Reiss710440f2008-06-11 01:19:12 +0000163%endif
164
Jake Farrell765bbfb2013-06-08 21:25:48 -0400165%if 0%{!?without_python:1}
David Reiss710440f2008-06-11 01:19:12 +0000166cd lib/py
167%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
168cd ../..
169%endif
170
David Reiss710440f2008-06-11 01:19:12 +0000171
172%clean
173rm -rf ${RPM_BUILD_ROOT}
174
175
Jake Farrell765bbfb2013-06-08 21:25:48 -0400176%post
177umask 007
178/sbin/ldconfig > /dev/null 2>&1
179
180
181%postun
182umask 007
183/sbin/ldconfig > /dev/null 2>&1
184
David Reiss710440f2008-06-11 01:19:12 +0000185%changelog
Jake Farrell765bbfb2013-06-08 21:25:48 -0400186* Wed Oct 10 2012 Thrift Dev <dev@thrift.apache.org>
187- Thrift 0.9.0 release.