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 | |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 20 | %{!?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 Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 22 | |
| 23 | Name: thrift |
Bryan Duxbury | 5bd7192 | 2009-04-01 21:01:56 +0000 | [diff] [blame] | 24 | License: Apache License v2.0 |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 25 | Group: Development |
| 26 | Summary: RPC and serialization framework |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 27 | Version: 0.9.0 |
| 28 | Release: 0 |
| 29 | URL: http://thrift.apache.org |
| 30 | Packager: Thrift Developers <dev@thrift.apache.org> |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 31 | Source0: %{name}-%{version}.tar.gz |
| 32 | |
| 33 | BuildRequires: gcc >= 3.4.6 |
| 34 | BuildRequires: gcc-c++ |
| 35 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 36 | %if 0%{!?without_java:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 37 | BuildRequires: java-devel >= 0:1.5.0 |
| 38 | BuildRequires: ant >= 0:1.6.5 |
| 39 | %endif |
| 40 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 41 | %if 0%{!?without_python:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 42 | BuildRequires: python-devel |
| 43 | %endif |
| 44 | |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 45 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
| 46 | |
| 47 | %description |
| 48 | Thrift is a software framework for scalable cross-language services |
| 49 | development. It combines a powerful software stack with a code generation |
| 50 | engine to build services that work efficiently and seamlessly between C++, |
| 51 | Java, C#, Python, Ruby, Perl, PHP, Objective C/Cocoa, Smalltalk, Erlang, |
| 52 | Objective Caml, and Haskell. |
| 53 | |
| 54 | %files |
| 55 | %defattr(-,root,root) |
| 56 | %{_bindir}/thrift |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 57 | |
| 58 | |
| 59 | %package lib-cpp |
| 60 | Summary: Thrift C++ library |
| 61 | Group: Libraries |
| 62 | |
| 63 | %description lib-cpp |
| 64 | C++ libraries for Thrift. |
| 65 | |
| 66 | %files lib-cpp |
| 67 | %defattr(-,root,root) |
| 68 | %{_libdir}/libthrift*.so.* |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 69 | %{_libdir}/libthrift*.so |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 70 | |
| 71 | |
| 72 | %package lib-cpp-devel |
| 73 | Summary: Thrift C++ library development files |
| 74 | Group: Libraries |
| 75 | Requires: %{name} = %{version}-%{release} |
| 76 | Requires: boost-devel |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 77 | %if 0%{!?without_libevent:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 78 | Requires: libevent-devel >= 1.2 |
| 79 | %endif |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 80 | %if 0%{!?without_zlib:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 81 | Requires: zlib-devel |
| 82 | %endif |
| 83 | |
| 84 | %description lib-cpp-devel |
| 85 | C++ static libraries and headers for Thrift. |
| 86 | |
| 87 | %files lib-cpp-devel |
| 88 | %defattr(-,root,root) |
| 89 | %{_includedir}/thrift/ |
| 90 | %{_libdir}/libthrift*.*a |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 91 | %{_libdir}/pkgconfig/thrift*.pc |
| 92 | |
| 93 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 94 | %if 0%{!?without_java:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 95 | %package lib-java |
| 96 | Summary: Thrift Java library |
| 97 | Group: Libraries |
| 98 | Requires: java >= 0:1.5.0 |
| 99 | |
| 100 | %description lib-java |
| 101 | Java libraries for Thrift. |
| 102 | |
| 103 | %files lib-java |
| 104 | %defattr(-,root,root) |
| 105 | %{_javadir}/* |
| 106 | %endif |
| 107 | |
| 108 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 109 | %if 0%{!?without_python:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 110 | %package lib-python |
| 111 | Summary: Thrift Python library |
| 112 | Group: Libraries |
| 113 | |
| 114 | %description lib-python |
| 115 | Python libraries for Thrift. |
| 116 | |
| 117 | %files lib-python |
| 118 | %defattr(-,root,root) |
| 119 | %{python_sitearch}/* |
| 120 | %endif |
| 121 | |
| 122 | |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 123 | %prep |
| 124 | %setup -q |
| 125 | |
| 126 | %build |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 127 | %configure \ |
| 128 | %{?without_libevent: --without-libevent } \ |
| 129 | %{?without_zlib: --without-zlib } \ |
| 130 | --without-java \ |
| 131 | --without-csharp \ |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 132 | --without-python \ |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 133 | --without-erlang \ |
| 134 | |
| 135 | make |
| 136 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 137 | %if 0%{!?without_java:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 138 | cd lib/java |
| 139 | %ant |
| 140 | cd ../.. |
| 141 | %endif |
| 142 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 143 | %if 0%{!?without_python:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 144 | cd lib/py |
| 145 | CFLAGS="%{optflags}" %{__python} setup.py build |
| 146 | cd ../.. |
| 147 | %endif |
| 148 | |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 149 | %install |
| 150 | %makeinstall |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 151 | ln -s libthrift-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthrift.so.0 |
| 152 | ln -s libthriftnb-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftnb.so.0 |
| 153 | ln -s libthriftz-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftz.so.0 |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 154 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 155 | %if 0%{!?without_java:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 156 | mkdir -p $RPM_BUILD_ROOT%{_javadir} |
| 157 | cp -p lib/java/*.jar $RPM_BUILD_ROOT%{_javadir} |
| 158 | %endif |
| 159 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 160 | %if 0%{!?without_python:1} |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 161 | cd lib/py |
| 162 | %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT |
| 163 | cd ../.. |
| 164 | %endif |
| 165 | |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 166 | |
| 167 | %clean |
| 168 | rm -rf ${RPM_BUILD_ROOT} |
| 169 | |
| 170 | |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 171 | %post |
| 172 | umask 007 |
| 173 | /sbin/ldconfig > /dev/null 2>&1 |
| 174 | |
| 175 | |
| 176 | %postun |
| 177 | umask 007 |
| 178 | /sbin/ldconfig > /dev/null 2>&1 |
| 179 | |
David Reiss | 710440f | 2008-06-11 01:19:12 +0000 | [diff] [blame] | 180 | %changelog |
Jake Farrell | 765bbfb | 2013-06-08 21:25:48 -0400 | [diff] [blame] | 181 | * Wed Oct 10 2012 Thrift Dev <dev@thrift.apache.org> |
| 182 | - Thrift 0.9.0 release. |