David Reiss | eaaf45c | 2009-03-30 22:52:46 +0000 | [diff] [blame] | 1 | # |
| 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 | |
jfarrell | 4b4f42b | 2013-11-27 12:45:49 -0500 | [diff] [blame] | 20 | %define without_java 1 |
| 21 | %define without_python 1 |
| 22 | %define without_tests 1 |
| 23 | |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 24 | %{!?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 Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 26 | |
| 27 | Name: thrift |
Bryan Duxbury | 5bd7192 | 2009-04-01 21:01:56 +0000 | [diff] [blame] | 28 | License: Apache License v2.0 |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 29 | Group: Development |
| 30 | Summary: RPC and serialization framework |
jfarrell | 384647d | 2018-10-16 22:36:46 -0400 | [diff] [blame] | 31 | Version: 0.12.0 |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 32 | Release: 0 |
| 33 | URL: http://thrift.apache.org |
| 34 | Packager: Thrift Developers <dev@thrift.apache.org> |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 35 | Source0: %{name}-%{version}.tar.gz |
| 36 | |
| 37 | BuildRequires: gcc >= 3.4.6 |
| 38 | BuildRequires: gcc-c++ |
| 39 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 40 | %if 0%{!?without_java:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 41 | BuildRequires: java-devel >= 0:1.5.0 |
| 42 | BuildRequires: ant >= 0:1.6.5 |
| 43 | %endif |
| 44 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 45 | %if 0%{!?without_python:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 46 | BuildRequires: python-devel |
| 47 | %endif |
| 48 | |
jfarrell | 11c813e | 2014-01-10 13:12:46 -0500 | [diff] [blame] | 49 | %if 0%{!?without_ruby:1} |
| 50 | %define gem_name %{name} |
| 51 | BuildRequires: ruby-devel |
| 52 | BuildRequires: rubygems-devel |
| 53 | %endif |
| 54 | |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 55 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
| 56 | |
| 57 | %description |
| 58 | Thrift is a software framework for scalable cross-language services |
| 59 | development. It combines a powerful software stack with a code generation |
| 60 | engine to build services that work efficiently and seamlessly between C++, |
| 61 | Java, C#, Python, Ruby, Perl, PHP, Objective C/Cocoa, Smalltalk, Erlang, |
| 62 | Objective Caml, and Haskell. |
| 63 | |
| 64 | %files |
| 65 | %defattr(-,root,root) |
| 66 | %{_bindir}/thrift |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 67 | |
| 68 | |
| 69 | %package lib-cpp |
| 70 | Summary: Thrift C++ library |
| 71 | Group: Libraries |
| 72 | |
| 73 | %description lib-cpp |
| 74 | C++ libraries for Thrift. |
| 75 | |
| 76 | %files lib-cpp |
| 77 | %defattr(-,root,root) |
| 78 | %{_libdir}/libthrift*.so.* |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 79 | %{_libdir}/libthrift*.so |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 80 | |
| 81 | |
| 82 | %package lib-cpp-devel |
| 83 | Summary: Thrift C++ library development files |
| 84 | Group: Libraries |
| 85 | Requires: %{name} = %{version}-%{release} |
| 86 | Requires: boost-devel |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 87 | %if 0%{!?without_libevent:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 88 | Requires: libevent-devel >= 1.2 |
| 89 | %endif |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 90 | %if 0%{!?without_zlib:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 91 | Requires: zlib-devel |
| 92 | %endif |
| 93 | |
| 94 | %description lib-cpp-devel |
| 95 | C++ static libraries and headers for Thrift. |
| 96 | |
| 97 | %files lib-cpp-devel |
| 98 | %defattr(-,root,root) |
| 99 | %{_includedir}/thrift/ |
| 100 | %{_libdir}/libthrift*.*a |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 101 | %{_libdir}/pkgconfig/thrift*.pc |
| 102 | |
| 103 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 104 | %if 0%{!?without_java:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 105 | %package lib-java |
| 106 | Summary: Thrift Java library |
| 107 | Group: Libraries |
| 108 | Requires: java >= 0:1.5.0 |
| 109 | |
| 110 | %description lib-java |
| 111 | Java libraries for Thrift. |
| 112 | |
| 113 | %files lib-java |
| 114 | %defattr(-,root,root) |
| 115 | %{_javadir}/* |
| 116 | %endif |
| 117 | |
| 118 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 119 | %if 0%{!?without_python:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 120 | %package lib-python |
| 121 | Summary: Thrift Python library |
| 122 | Group: Libraries |
| 123 | |
| 124 | %description lib-python |
| 125 | Python libraries for Thrift. |
| 126 | |
| 127 | %files lib-python |
| 128 | %defattr(-,root,root) |
| 129 | %{python_sitearch}/* |
| 130 | %endif |
| 131 | |
| 132 | |
jfarrell | 11c813e | 2014-01-10 13:12:46 -0500 | [diff] [blame] | 133 | %if 0%{!?without_ruby:1} |
| 134 | %package -n rubygem-%{gem_name} |
| 135 | Summary: Thrift Ruby library |
| 136 | Group: Libraries |
| 137 | Obsoletes: %{name}-lib-ruby |
| 138 | |
| 139 | %description -n rubygem-%{gem_name} |
| 140 | Ruby 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 |
| 150 | Summary: Thrift PHP library |
| 151 | Group: Libraries |
| 152 | |
| 153 | %description lib-php |
| 154 | PHP libraries for Thrift. |
| 155 | |
| 156 | %files lib-php |
| 157 | %defattr(-,root,root) |
| 158 | /usr/lib/php/* |
| 159 | %endif |
| 160 | |
| 161 | |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 162 | %prep |
| 163 | %setup -q |
| 164 | |
| 165 | %build |
Roger Meier | f9d16b1 | 2014-01-26 00:26:16 +0100 | [diff] [blame] | 166 | [[ -e Makefile.in ]] || ./bootstrap.sh |
jfarrell | 11c813e | 2014-01-10 13:12:46 -0500 | [diff] [blame] | 167 | export GEM_HOME=${PWD}/.gem-home |
| 168 | export RUBYLIB=${PWD}/lib/rb/lib |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 169 | %configure \ |
| 170 | %{?without_libevent: --without-libevent } \ |
| 171 | %{?without_zlib: --without-zlib } \ |
jfarrell | 4b4f42b | 2013-11-27 12:45:49 -0500 | [diff] [blame] | 172 | %{?without_tests: --without-tests } \ |
| 173 | %{?without_java: --without-java } \ |
| 174 | %{?without_python: --without-python } \ |
jfarrell | 11c813e | 2014-01-10 13:12:46 -0500 | [diff] [blame] | 175 | %{?without_ruby: --without-ruby } \ |
| 176 | %{?without_php: --without-php } \ |
| 177 | %{!?without_php: PHP_PREFIX=${RPM_BUILD_ROOT}/usr/lib/php } \ |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 178 | --without-csharp \ |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 179 | --without-erlang \ |
| 180 | |
jfarrell | 4b4f42b | 2013-11-27 12:45:49 -0500 | [diff] [blame] | 181 | make %{?_smp_mflags} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 182 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 183 | %if 0%{!?without_java:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 184 | cd lib/java |
| 185 | %ant |
| 186 | cd ../.. |
| 187 | %endif |
| 188 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 189 | %if 0%{!?without_python:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 190 | cd lib/py |
| 191 | CFLAGS="%{optflags}" %{__python} setup.py build |
| 192 | cd ../.. |
| 193 | %endif |
| 194 | |
jfarrell | 11c813e | 2014-01-10 13:12:46 -0500 | [diff] [blame] | 195 | %if 0%{!?without_ruby:1} |
| 196 | %gem_install -n lib/rb/thrift*.gem |
| 197 | %endif |
| 198 | |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 199 | %install |
jfarrell | 11c813e | 2014-01-10 13:12:46 -0500 | [diff] [blame] | 200 | export GEM_HOME=${PWD}/.gem-home |
| 201 | export RUBYLIB=${PWD}/lib/rb/lib |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 202 | %makeinstall |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 203 | ln -s libthrift-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthrift.so.0 |
| 204 | ln -s libthriftnb-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftnb.so.0 |
| 205 | ln -s libthriftz-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftz.so.0 |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 206 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 207 | %if 0%{!?without_java:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 208 | mkdir -p $RPM_BUILD_ROOT%{_javadir} |
jfarrell | 380a45d | 2013-10-04 22:50:21 -0400 | [diff] [blame] | 209 | cp -p lib/java/build/*.jar $RPM_BUILD_ROOT%{_javadir} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 210 | %endif |
| 211 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 212 | %if 0%{!?without_python:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 213 | cd lib/py |
| 214 | %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT |
| 215 | cd ../.. |
| 216 | %endif |
| 217 | |
jfarrell | 11c813e | 2014-01-10 13:12:46 -0500 | [diff] [blame] | 218 | %if 0%{!?without_ruby:1} |
| 219 | mkdir -p %{buildroot}%{gem_dir} |
| 220 | cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/ |
| 221 | %endif |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 222 | |
| 223 | %clean |
| 224 | rm -rf ${RPM_BUILD_ROOT} |
| 225 | |
| 226 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 227 | %post |
| 228 | umask 007 |
| 229 | /sbin/ldconfig > /dev/null 2>&1 |
| 230 | |
| 231 | |
| 232 | %postun |
| 233 | umask 007 |
| 234 | /sbin/ldconfig > /dev/null 2>&1 |
| 235 | |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 236 | %changelog |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 237 | * Wed Oct 10 2012 Thrift Dev <dev@thrift.apache.org> |
| 238 | - Thrift 0.9.0 release. |