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
24 %bcond_with tests # build with tests
27 %bcond_without cpp # build the C++ library
28 %bcond_without qt4 # build the Qt library
29 %bcond_without c_glib # build the C (GLib) library
30 %bcond_without csharp # build the C# library
31 %bcond_with java # build the Java library
32 %bcond_with erlang # build the Erlang library
33 %bcond_with nodejs # build nodejs library
34 %bcond_with lua # build Lua library
35 %bcond_without python # build the Python library
36 %bcond_without perl # build the Perl library
37 %bcond_without php # build the PHP library
38 %bcond_with php_extension # build the PHP_EXTENSION library
39 %bcond_with ruby # build the Ruby library
40 %bcond_with haskell # build the Haskell library
41 %bcond_without go # build the Go library
42 %bcond_with d # build the D library
49 %define php_name php55
52 %define php_min_version 5.3.0
53 %include /usr/lib/rpm/macros.perl
54 Summary: Framework for scalable cross-language services development
55 Summary(pl.UTF-8): Szkielet budowania skalowalnych usług dla różnych języków programowania
60 Group: Development/Libraries
61 Source0: http://www.apache.org/dist/thrift/%{version}/%{name}-%{version}.tar.gz
62 # Source0-md5: 89f63cc4d0100912f4a1f8a9dee63678
63 Patch0: %{name}-Werror_strlcpy_fix.patch
64 Patch1: %{name}-cpp_link_fix.patch
65 URL: http://thrift.apache.org/
66 BuildRequires: autoconf
67 BuildRequires: automake >= 1:1.13
68 BuildRequires: bison >= 2.5
69 BuildRequires: boost-devel >= 1.54.0
71 BuildRequires: libevent-devel
72 BuildRequires: pkgconfig
73 BuildRequires: python-devel >= 1:2.4
74 BuildRequires: rpm-pythonprov
75 BuildRequires: rpmbuild(macros) >= 1.219
76 BuildRequires: zlib-devel >= 1.2.3
78 BuildRequires: QtNetwork-devel
81 BuildRequires: glib2-devel
84 BuildRequires: mono-csharp
85 BuildRequires: mono-devel
88 BuildRequires: java-gcj-compat-devel
89 BuildRequires: java-ivy
92 BuildRequires: lua51-devel
100 BuildRequires: python-TwistedCore
103 BuildRequires: perl-Bit-Vector
104 BuildRequires: perl-Class-Accessor
105 BuildRequires: perl-base
108 BuildRequires: %{php_name}-cli
109 BuildRequires: %{php_name}-devel
110 BuildRequires: phpunit
113 BuildRequires: erlang
117 BuildRequires: ruby-bundler
121 BuildRequires: ghc-haskell-platform
124 BuildRequires: golang
129 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
131 # library use symbols provided by the glib2 libraries
132 %define skip_post_check_so libthrift_c_glib.so.*
135 The Apache Thrift software framework, for scalable cross-language
136 services development, combines a software stack with a code generation
137 engine to build services that work efficiently and seamlessly between
138 C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa,
139 JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages.
141 %description -l pl.UTF-8
142 Programowy szkielet dla rozwoju skalowanych usług dla różnych języków
143 programowania. Zawiera oprogramowanie wraz silnikiem generowania kodu
144 do tworzenie usług które spawnie działają pomiędzy C++, Javą,
145 Pythonem, PHP, Rybym, Erlangiem, Perlem, Haskellem, C#, Cocoa,
146 Smalltalikiem i Ocamlem.
149 Summary: C++ header files
150 Summary(pl.UTF-8): Pliki nagłówkowe i bibliotek iterfejsu C++ thrift
151 Group: Development/Libraries
152 Requires: %{name}-libs = %{version}-%{release}
155 Header and libarary files for C++ thrift inteface.
157 %description devel -l pl.UTF-8
158 Pliki nagłówkowe i bibliotek iterfejsu C++ thrift.
161 Summary: Thrift C++ static libraries
162 Summary(pl.UTF-8): Biblioteki statyczne iterfejsu C++ thrift
163 Group: Development/Libraries
164 Requires: %{name}-devel = %{version}-%{release}
167 Static libarary files for C++ thrift inteface.
169 %description static -l pl.UTF-8
170 Statyczne biblioteki iterfejsu C++ thrift.
173 Summary: C++ thrift interface libraries
174 Summary(pl.UTF-8): Interfejs thrift dla C++
175 Group: Development/Libraries
176 Requires: %{name} = %{version}-%{release}
179 C++ thrift interface libraries
181 %description libs -l pl.UTF-8
182 Biblioteki interfejsu thrift dla C++.
184 %package -n php-%{name}
185 Summary: PHP Thrift interface
186 Summary(pl.UTF-8): Interfejs Thrift dla PHP
187 Group: Development/Languages/PHP
188 Requires: %{name} = %{version}-%{release}
189 Requires: php(core) >= %{php_min_version}
191 %description -n php-%{name}
192 PHP Thrift interface.
194 %package -n python-%{name}
195 Summary: Python thrift interface
196 Summary(pl.UTF-8): Interfejs thrift dla Pythona
197 Group: Development/Languages/Python
198 Requires: %{name} = %{version}-%{release}
200 %description -n python-%{name}
201 Python thrift interface.
203 %description -n python-%{name} -l pl.UTF-8
204 Interfejs thrift dla Pythona.
206 %package -n perl-Thrift
207 Summary: Perl thrift interface
208 Summary(pl.UTF-8): Interfejs thrift dla Perla
209 Group: Development/Languages/Perl
210 Requires: %{name} = %{version}-%{release}
212 %description -n perl-Thrift
213 Perl thrift interface.
215 %description -n perl-Thrift -l pl.UTF-8
216 Interfejs thrift dla Perla.
224 %{__aclocal} -I aclocal
229 PHP_PREFIX=%{php_data_dir} \
231 PERL_PREFIX=%{perl_vendorlib} \
232 %{__with_without cpp} \
233 %{__with_without qt4} \
234 %{__with_without c_glib} \
235 %{__with_without csharp} \
236 %{__with_without java} \
237 %{__with_without erlang} \
238 %{__with_without python} \
239 %{__with_without bcond_without} \
240 %{__with_without perl} \
241 %{__with_without php} \
242 %{__with_without php_extension} \
243 %{__with_without ruby} \
244 %{__with_without haskell} \
245 %{__with_without go} \
246 %{__with_without d} \
253 %{__with_without tests}
258 rm -rf $RPM_BUILD_ROOT
260 DESTDIR=$RPM_BUILD_ROOT
263 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
264 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
269 %{__mv} $RPM_BUILD_ROOT%{perl_vendorlib}/lib/perl5/Thrift{,.pm} $RPM_BUILD_ROOT%{perl_vendorlib}
273 rm -rf $RPM_BUILD_ROOT
275 %post libs -p /sbin/ldconfig
276 %postun libs -p /sbin/ldconfig
279 %defattr(644,root,root,755)
280 %attr(755,root,root) %{_bindir}/thrift
284 %defattr(644,root,root,755)
285 %{_libdir}/libthrift-%{version}.so
286 %{_libdir}/libthriftnb-%{version}.so
287 %{_libdir}/libthriftz-%{version}.so
289 %{_libdir}/libthriftqt-%{version}.so
292 %{_libdir}/libthrift_c_glib.so.*
296 %defattr(644,root,root,755)
297 %{_libdir}/libthrift.la
298 %{_libdir}/libthriftnb.la
299 %{_libdir}/libthriftz.la
300 %{_libdir}/libthrift.so
301 %{_libdir}/libthriftnb.so
302 %{_libdir}/libthriftz.so
303 %{_includedir}/thrift
304 %{_pkgconfigdir}/thrift-nb.pc
305 %{_pkgconfigdir}/thrift-z.pc
306 %{_pkgconfigdir}/thrift.pc
308 %{_libdir}/libthriftqt.so
309 %{_libdir}/libthriftqt.la
310 %{_pkgconfigdir}/thrift-qt.pc
313 %{_libdir}/libthrift_c_glib.so
314 %{_libdir}/libthrift_c_glib.la
315 %{_pkgconfigdir}/thrift_c_glib.pc
319 %defattr(644,root,root,755)
320 %{_libdir}/libthrift.a
321 %{_libdir}/libthriftnb.a
322 %{_libdir}/libthriftz.a
324 %{_libdir}/libthriftqt.a
327 %{_libdir}/libthrift_c_glib.a
332 %files -n php-%{name}
333 %defattr(644,root,root,755)
334 %{php_data_dir}/Thrift
338 %files -n python-%{name}
339 %defattr(644,root,root,755)
340 %dir %{py_sitedir}/%{name}
341 %dir %{py_sitedir}/%{name}/protocol
342 %{py_sitedir}/%{name}/protocol/*.py[co]
343 %attr(755,root,root) %{py_sitedir}/%{name}/protocol/fastbinary.so
344 %dir %{py_sitedir}/%{name}/server
345 %{py_sitedir}/%{name}/server/*.py[co]
346 %dir %{py_sitedir}/%{name}/transport
347 %{py_sitedir}/%{name}/transport/*.py[co]
348 %{py_sitedir}/%{name}/*.py[co]
349 %if "%{py_ver}" > "2.4"
350 %{py_sitedir}/thrift-%{version}-py*.egg-info
355 %files -n perl-Thrift
356 %defattr(644,root,root,755)
357 %dir %{perl_vendorlib}/Thrift
358 %{perl_vendorlib}/Thrift.pm
359 %{perl_vendorlib}/Thrift/*.pm