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