2 # - rename -libs to -cpp, -devel to -cpp-devel, -static to -cpp-static?
3 # - no SONAME ext in -libs, enforce some?
4 # - BR for java, ruby, perl, more general BR
5 # - Separate packages per each language
6 # - fix perl: missing vendordir on install
7 # - fix java: not installing to %{_javadir}
8 # - avoid downloading from net when build building java
11 # - Fix parallel build make.
13 # TODO (2) - fix or disable
14 # - java - br, build, files - icedtea7 ?
15 # - erlang - build, files
16 # - php_extension - br, build
17 # - ruby - build, files, some gems required for build?
18 # - haskell - build, files
19 # - d - needs working dmd or gdm to build
20 # - bcond_without qt5 # build the Qt5 library
25 %bcond_with tests # build with tests
28 %bcond_without cpp # build the C++ library
29 %bcond_without qt4 # build the Qt4 library
30 # %%bcond_without qt5 # build the Qt5 library
31 %bcond_without c_glib # build the C (GLib) library
32 %bcond_without csharp # build the C# library
33 %bcond_with java # build the Java library
34 %bcond_with erlang # build the Erlang library
35 %bcond_with nodejs # build nodejs library
36 %bcond_without lua # build Lua library
37 %bcond_without python # build the Python library
38 %bcond_without perl # build the Perl library
39 %bcond_without php # build the PHP library
40 %bcond_with php_extension # build the PHP_EXTENSION library
41 %bcond_with ruby # build the Ruby library
42 %bcond_with haskell # build the Haskell library
43 %bcond_without go # build the Go library
44 %bcond_with d # build the D library
51 %define php_name php55
54 %define php_min_version 5.3.0
55 %include /usr/lib/rpm/macros.perl
56 Summary: Framework for scalable cross-language services development
57 Summary(pl.UTF-8): Szkielet budowania skalowalnych usług dla różnych języków programowania
62 Group: Development/Libraries
63 Source0: http://www.apache.org/dist/thrift/%{version}/%{name}-%{version}.tar.gz
64 # Source0-md5: 88d667a8ae870d5adeca8cb7d6795442
65 Patch0: %{name}-Werror_strlcpy_fix.patch
66 Patch1: %{name}-cpp_link_fix.patch
67 URL: http://thrift.apache.org/
68 BuildRequires: autoconf
69 BuildRequires: automake >= 1:1.13
70 BuildRequires: bison >= 2.5
71 BuildRequires: boost-devel >= 1.54.0
73 BuildRequires: libevent-devel
74 BuildRequires: pkgconfig
75 BuildRequires: python-devel >= 1:2.4
76 BuildRequires: rpm-pythonprov
77 BuildRequires: rpmbuild(macros) >= 1.219
78 BuildRequires: zlib-devel >= 1.2.3
80 BuildRequires: QtNetwork-devel
83 BuildRequires: glib2-devel
86 BuildRequires: mono-csharp
87 BuildRequires: mono-devel
90 BuildRequires: java-gcj-compat-devel
91 BuildRequires: java-ivy
94 BuildRequires: lua51-devel
101 BuildRequires: python
102 BuildRequires: python-TwistedCore
105 BuildRequires: perl-Bit-Vector
106 BuildRequires: perl-Class-Accessor
107 BuildRequires: perl-base
110 BuildRequires: %{php_name}-cli
111 BuildRequires: %{php_name}-devel
112 BuildRequires: phpunit
115 BuildRequires: erlang
119 BuildRequires: ruby-bundler
123 BuildRequires: ghc-haskell-platform
126 BuildRequires: golang
131 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
133 # library use symbols provided by the glib2 libraries
134 %define skip_post_check_so libthrift_c_glib.so.*
137 The Apache Thrift software framework, for scalable cross-language
138 services development, combines a software stack with a code generation
139 engine to build services that work efficiently and seamlessly between
140 C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa,
141 JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages.
143 %description -l pl.UTF-8
144 Programowy szkielet dla rozwoju skalowanych usług dla różnych języków
145 programowania. Zawiera oprogramowanie wraz silnikiem generowania kodu
146 do tworzenie usług które spawnie działają pomiędzy C++, Javą,
147 Pythonem, PHP, Rybym, Erlangiem, Perlem, Haskellem, C#, Cocoa,
148 Smalltalikiem i Ocamlem.
151 Summary: C++ header files
152 Summary(pl.UTF-8): Pliki nagłówkowe i bibliotek iterfejsu C++ thrift
153 Group: Development/Libraries
154 Requires: %{name}-libs = %{version}-%{release}
157 Header and libarary files for C++ thrift inteface.
159 %description devel -l pl.UTF-8
160 Pliki nagłówkowe i bibliotek iterfejsu C++ thrift.
163 Summary: Thrift C++ static libraries
164 Summary(pl.UTF-8): Biblioteki statyczne iterfejsu C++ thrift
165 Group: Development/Libraries
166 Requires: %{name}-devel = %{version}-%{release}
169 Static libarary files for C++ thrift inteface.
171 %description static -l pl.UTF-8
172 Statyczne biblioteki iterfejsu C++ thrift.
175 Summary: C++ thrift interface libraries
176 Summary(pl.UTF-8): Interfejs thrift dla C++
177 Group: Development/Libraries
178 Requires: %{name} = %{version}-%{release}
181 C++ thrift interface libraries
183 %description libs -l pl.UTF-8
184 Biblioteki interfejsu thrift dla C++.
186 %package -n php-%{name}
187 Summary: PHP Thrift interface
188 Summary(pl.UTF-8): Interfejs Thrift dla PHP
189 Group: Development/Languages/PHP
190 Requires: %{name} = %{version}-%{release}
191 Requires: php(core) >= %{php_min_version}
193 %description -n php-%{name}
194 PHP Thrift interface.
196 %package -n python-%{name}
197 Summary: Python thrift interface
198 Summary(pl.UTF-8): Interfejs thrift dla Pythona
199 Group: Development/Languages/Python
200 Requires: %{name} = %{version}-%{release}
202 %description -n python-%{name}
203 Python thrift interface.
205 %description -n python-%{name} -l pl.UTF-8
206 Interfejs thrift dla Pythona.
208 %package -n perl-Thrift
209 Summary: Perl thrift interface
210 Summary(pl.UTF-8): Interfejs thrift dla Perla
211 Group: Development/Languages/Perl
212 Requires: %{name} = %{version}-%{release}
214 %description -n perl-Thrift
215 Perl thrift interface.
217 %description -n perl-Thrift -l pl.UTF-8
218 Interfejs thrift dla Perla.
226 %{__aclocal} -I aclocal
231 PHP_PREFIX=%{php_data_dir} \
233 PERL_PREFIX=%{perl_vendorlib} \
234 %{__with_without cpp} \
235 %{__with_without qt4} \
236 %{__with_without c_glib} \
237 %{__with_without csharp} \
238 %{__with_without java} \
239 %{__with_without erlang} \
240 %{__with_without python} \
241 %{__with_without bcond_without} \
242 %{__with_without perl} \
243 %{__with_without php} \
244 %{__with_without php_extension} \
245 %{__with_without ruby} \
246 %{__with_without haskell} \
247 %{__with_without go} \
248 %{__with_without d} \
255 %{__with_without tests}
260 rm -rf $RPM_BUILD_ROOT
262 DESTDIR=$RPM_BUILD_ROOT
265 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
266 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
271 %{__mv} $RPM_BUILD_ROOT%{perl_vendorlib}/lib/perl5/Thrift{,.pm} $RPM_BUILD_ROOT%{perl_vendorlib}
275 rm -rf $RPM_BUILD_ROOT
277 %post libs -p /sbin/ldconfig
278 %postun libs -p /sbin/ldconfig
281 %defattr(644,root,root,755)
282 %attr(755,root,root) %{_bindir}/thrift
286 %defattr(644,root,root,755)
287 %{_libdir}/libthrift-%{version}.so
288 %{_libdir}/libthriftnb-%{version}.so
289 %{_libdir}/libthriftz-%{version}.so
290 %{_libdir}/libthriftqt5-%{version}.so
292 %{_libdir}/libthriftqt-%{version}.so
295 %{_libdir}/libthrift_c_glib.so.*
299 %defattr(644,root,root,755)
300 %{_libdir}/libthrift.la
301 %{_libdir}/libthriftnb.la
302 %{_libdir}/libthriftz.la
303 %{_libdir}/libthrift.so
304 %{_libdir}/libthriftnb.so
305 %{_libdir}/libthriftz.so
306 %{_includedir}/thrift
307 %{_pkgconfigdir}/thrift-nb.pc
308 %{_pkgconfigdir}/thrift-z.pc
309 %{_pkgconfigdir}/thrift.pc
311 %{_libdir}/libthriftqt.so
312 %{_libdir}/libthriftqt.la
313 %{_pkgconfigdir}/thrift-qt.pc
315 %{_libdir}/libthriftqt5.so
316 %{_libdir}/libthriftqt5.la
317 %{_pkgconfigdir}/thrift-qt5.pc
320 %{_libdir}/libthrift_c_glib.so
321 %{_libdir}/libthrift_c_glib.la
322 %{_pkgconfigdir}/thrift_c_glib.pc
326 %defattr(644,root,root,755)
327 %{_libdir}/libthrift.a
328 %{_libdir}/libthriftnb.a
329 %{_libdir}/libthriftz.a
331 %{_libdir}/libthriftqt.a
333 %{_libdir}/libthriftqt5.a
335 %{_libdir}/libthrift_c_glib.a
340 %files -n php-%{name}
341 %defattr(644,root,root,755)
342 %{php_data_dir}/Thrift
346 %files -n python-%{name}
347 %defattr(644,root,root,755)
348 %dir %{py_sitedir}/%{name}
349 %dir %{py_sitedir}/%{name}/protocol
350 %{py_sitedir}/%{name}/protocol/*.py[co]
351 %attr(755,root,root) %{py_sitedir}/%{name}/protocol/fastbinary.so
352 %dir %{py_sitedir}/%{name}/server
353 %{py_sitedir}/%{name}/server/*.py[co]
354 %dir %{py_sitedir}/%{name}/transport
355 %{py_sitedir}/%{name}/transport/*.py[co]
356 %{py_sitedir}/%{name}/*.py[co]
357 %if "%{py_ver}" > "2.4"
358 %{py_sitedir}/thrift-%{version}-py*.egg-info
363 %files -n perl-Thrift
364 %defattr(644,root,root,755)
365 %dir %{perl_vendorlib}/Thrift
366 %{perl_vendorlib}/Thrift.pm
367 %{perl_vendorlib}/Thrift/*.pm