blob: ecc7fb78ff204e2d20e7bd1f4340bdc4b454af27 [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
Jens Geyerc75646a2022-08-30 22:54:32 +020031Version: 0.18.0
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
jfarrell11c813e2014-01-10 13:12:46 -050049%if 0%{!?without_ruby:1}
50%define gem_name %{name}
51BuildRequires: ruby-devel
52BuildRequires: rubygems-devel
53%endif
54
David Reiss710440f2008-06-11 01:19:12 +000055BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
56
57%description
58Thrift is a software framework for scalable cross-language services
59development. It combines a powerful software stack with a code generation
60engine to build services that work efficiently and seamlessly between C++,
James E. King III234fb472019-01-13 23:19:18 -050061Java, C#, Python, Ruby, Perl, PHP, Smalltalk, Erlang, OCaml, Haskell, and
62other languages.
David Reiss710440f2008-06-11 01:19:12 +000063
64%files
65%defattr(-,root,root)
66%{_bindir}/thrift
David Reiss710440f2008-06-11 01:19:12 +000067
68
69%package lib-cpp
70Summary: Thrift C++ library
71Group: Libraries
72
73%description lib-cpp
74C++ libraries for Thrift.
75
76%files lib-cpp
77%defattr(-,root,root)
78%{_libdir}/libthrift*.so.*
Jake Farrell765bbfb2013-06-08 21:25:48 -040079%{_libdir}/libthrift*.so
David Reiss710440f2008-06-11 01:19:12 +000080
81
82%package lib-cpp-devel
83Summary: Thrift C++ library development files
84Group: Libraries
85Requires: %{name} = %{version}-%{release}
86Requires: boost-devel
Jake Farrell765bbfb2013-06-08 21:25:48 -040087%if 0%{!?without_libevent:1}
David Reiss710440f2008-06-11 01:19:12 +000088Requires: libevent-devel >= 1.2
89%endif
Jake Farrell765bbfb2013-06-08 21:25:48 -040090%if 0%{!?without_zlib:1}
David Reiss710440f2008-06-11 01:19:12 +000091Requires: zlib-devel
92%endif
93
94%description lib-cpp-devel
95C++ static libraries and headers for Thrift.
96
97%files lib-cpp-devel
98%defattr(-,root,root)
99%{_includedir}/thrift/
100%{_libdir}/libthrift*.*a
David Reiss710440f2008-06-11 01:19:12 +0000101%{_libdir}/pkgconfig/thrift*.pc
102
103
Jake Farrell765bbfb2013-06-08 21:25:48 -0400104%if 0%{!?without_java:1}
David Reiss710440f2008-06-11 01:19:12 +0000105%package lib-java
106Summary: Thrift Java library
107Group: Libraries
108Requires: java >= 0:1.5.0
109
110%description lib-java
111Java libraries for Thrift.
112
113%files lib-java
114%defattr(-,root,root)
115%{_javadir}/*
116%endif
117
118
Jake Farrell765bbfb2013-06-08 21:25:48 -0400119%if 0%{!?without_python:1}
David Reiss710440f2008-06-11 01:19:12 +0000120%package lib-python
121Summary: Thrift Python library
122Group: Libraries
123
124%description lib-python
125Python libraries for Thrift.
126
127%files lib-python
128%defattr(-,root,root)
129%{python_sitearch}/*
130%endif
131
132
jfarrell11c813e2014-01-10 13:12:46 -0500133%if 0%{!?without_ruby:1}
134%package -n rubygem-%{gem_name}
135Summary: Thrift Ruby library
136Group: Libraries
137Obsoletes: %{name}-lib-ruby
138
139%description -n rubygem-%{gem_name}
140Ruby libraries for Thrift.
141
142%files -n rubygem-%{gem_name}
143%defattr(-,root,root)
144%{gem_dir}/*
145%endif
146
147
148%if 0%{!?without_php:1}
149%package lib-php
150Summary: Thrift PHP library
151Group: Libraries
152
153%description lib-php
154PHP libraries for Thrift.
155
156%files lib-php
157%defattr(-,root,root)
158/usr/lib/php/*
159%endif
160
161
David Reiss710440f2008-06-11 01:19:12 +0000162%prep
163%setup -q
164
165%build
Roger Meierf9d16b12014-01-26 00:26:16 +0100166[[ -e Makefile.in ]] || ./bootstrap.sh
jfarrell11c813e2014-01-10 13:12:46 -0500167export GEM_HOME=${PWD}/.gem-home
168export RUBYLIB=${PWD}/lib/rb/lib
David Reiss710440f2008-06-11 01:19:12 +0000169%configure \
170 %{?without_libevent: --without-libevent } \
171 %{?without_zlib: --without-zlib } \
jfarrell4b4f42b2013-11-27 12:45:49 -0500172 %{?without_tests: --without-tests } \
173 %{?without_java: --without-java } \
174 %{?without_python: --without-python } \
jfarrell11c813e2014-01-10 13:12:46 -0500175 %{?without_ruby: --without-ruby } \
176 %{?without_php: --without-php } \
177 %{!?without_php: PHP_PREFIX=${RPM_BUILD_ROOT}/usr/lib/php } \
David Reiss710440f2008-06-11 01:19:12 +0000178 --without-erlang \
179
James E. King III7ac9e432018-12-19 22:12:32 -0500180%if 0%{!?without_ruby:1}
181eval $(grep "^WITH_RUBY_TRUE" config.log)
182if [[ "${WITH_RUBY_TRUE}" != "" ]]; then
183 set +x
184 echo ""
185 echo "configure determined that ruby requirements are missing (bundler gem?), either install missing components" >&2
186 echo "or disable the ruby sub-packages as follows:" >&2
187 echo " rpmbuild -D'%without_ruby 1' ..." >&2
188 echo ""
189 exit 1
190fi
191%endif
192
jfarrell4b4f42b2013-11-27 12:45:49 -0500193make %{?_smp_mflags}
David Reiss710440f2008-06-11 01:19:12 +0000194
Jake Farrell765bbfb2013-06-08 21:25:48 -0400195%if 0%{!?without_java:1}
David Reiss710440f2008-06-11 01:19:12 +0000196cd lib/java
197%ant
198cd ../..
199%endif
200
Jake Farrell765bbfb2013-06-08 21:25:48 -0400201%if 0%{!?without_python:1}
David Reiss710440f2008-06-11 01:19:12 +0000202cd lib/py
203CFLAGS="%{optflags}" %{__python} setup.py build
204cd ../..
205%endif
206
jfarrell11c813e2014-01-10 13:12:46 -0500207%if 0%{!?without_ruby:1}
208%gem_install -n lib/rb/thrift*.gem
209%endif
210
David Reiss710440f2008-06-11 01:19:12 +0000211%install
jfarrell11c813e2014-01-10 13:12:46 -0500212export GEM_HOME=${PWD}/.gem-home
213export RUBYLIB=${PWD}/lib/rb/lib
David Reiss710440f2008-06-11 01:19:12 +0000214%makeinstall
Jake Farrell765bbfb2013-06-08 21:25:48 -0400215ln -s libthrift-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthrift.so.0
216ln -s libthriftnb-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftnb.so.0
217ln -s libthriftz-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftz.so.0
David Reiss710440f2008-06-11 01:19:12 +0000218
Jake Farrell765bbfb2013-06-08 21:25:48 -0400219%if 0%{!?without_java:1}
David Reiss710440f2008-06-11 01:19:12 +0000220mkdir -p $RPM_BUILD_ROOT%{_javadir}
jfarrell380a45d2013-10-04 22:50:21 -0400221cp -p lib/java/build/*.jar $RPM_BUILD_ROOT%{_javadir}
David Reiss710440f2008-06-11 01:19:12 +0000222%endif
223
Jake Farrell765bbfb2013-06-08 21:25:48 -0400224%if 0%{!?without_python:1}
David Reiss710440f2008-06-11 01:19:12 +0000225cd lib/py
226%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
227cd ../..
228%endif
229
jfarrell11c813e2014-01-10 13:12:46 -0500230%if 0%{!?without_ruby:1}
231mkdir -p %{buildroot}%{gem_dir}
232cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
233%endif
David Reiss710440f2008-06-11 01:19:12 +0000234
235%clean
236rm -rf ${RPM_BUILD_ROOT}
237
238
Jake Farrell765bbfb2013-06-08 21:25:48 -0400239%post
240umask 007
241/sbin/ldconfig > /dev/null 2>&1
242
243
244%postun
245umask 007
246/sbin/ldconfig > /dev/null 2>&1
247
David Reiss710440f2008-06-11 01:19:12 +0000248%changelog
jfarrellff980c12013-08-18 19:54:39 -0400249* Wed Aug 21 2013 Thrift Dev <dev@thrift.apache.org>
250- Thrift 0.9.1 release.
Jake Farrell765bbfb2013-06-08 21:25:48 -0400251* Wed Oct 10 2012 Thrift Dev <dev@thrift.apache.org>
252- Thrift 0.9.0 release.