]>
Commit | Line | Data |
---|---|---|
466f7706 | 1 | # TODO |
ba0896eb ER |
2 | # - rename -libs to -cpp, -devel to -cpp-devel, -static to -cpp-static? |
3 | # - no SONAME ext in -libs, enforce some? | |
466f7706 | 4 | # - BR for java, ruby, perl, more general BR |
0fa812fd | 5 | # - Separate packages per each language |
dac4dddf ER |
6 | # - fix perl: missing vendordir on install |
7 | # - fix java: not installing to %{_javadir} | |
0fa812fd | 8 | # - avoid downloading from net when build building java |
466f7706 | 9 | # - Fix ruby install |
dac4dddf | 10 | # - Add Mono |
22ccc465 | 11 | # - Fix parallel build make. |
ba0896eb | 12 | # |
c5ce9bf5 MGB |
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 | # | |
ba0896eb ER |
21 | # Conditional build: |
22 | # | |
23 | # generic options | |
24 | %bcond_with tests # build with tests | |
25 | # | |
26 | # language options | |
27 | %bcond_without cpp # build the C++ library | |
f33ea347 MK |
28 | %bcond_with qt4 # build the Qt4 library |
29 | %bcond_with qt5 # build the Qt5 library | |
c5ce9bf5 | 30 | %bcond_without c_glib # build the C (GLib) library |
f33ea347 | 31 | %bcond_with csharp # build the C# library |
ba0896eb ER |
32 | %bcond_with java # build the Java library |
33 | %bcond_with erlang # build the Erlang library | |
9efeafcc | 34 | %bcond_with nodejs # build nodejs library |
f33ea347 | 35 | %bcond_with lua # build Lua library |
ba0896eb | 36 | %bcond_without python # build the Python library |
f33ea347 MK |
37 | %bcond_with perl # build the Perl library |
38 | %bcond_with php # build the PHP library | |
ba0896eb ER |
39 | %bcond_with php_extension # build the PHP_EXTENSION library |
40 | %bcond_with ruby # build the Ruby library | |
41 | %bcond_with haskell # build the Haskell library | |
f33ea347 | 42 | %bcond_with go # build the Go library |
ba0896eb | 43 | %bcond_with d # build the D library |
202172b4 | 44 | |
6a7ec041 ER |
45 | %if %{with perl} |
46 | %define pdir Thrift | |
47 | %endif | |
48 | ||
72a57785 ER |
49 | %if 0%{!?php_name:1} |
50 | %define php_name php55 | |
51 | %endif | |
c5ce9bf5 | 52 | |
1fbdddd8 | 53 | %define php_min_version 5.3.0 |
72a57785 | 54 | %include /usr/lib/rpm/macros.perl |
7f1934de | 55 | Summary: Framework for scalable cross-language services development |
5e6bb28c | 56 | Summary(pl.UTF-8): Szkielet budowania skalowalnych usług dla różnych języków programowania |
7f1934de | 57 | Name: thrift |
43a116e0 | 58 | Version: 0.9.3 |
31846ec6 | 59 | Release: 3 |
dac4dddf | 60 | License: Apache v2.0 |
5e6bb28c | 61 | Group: Development/Libraries |
ba0896eb | 62 | Source0: http://www.apache.org/dist/thrift/%{version}/%{name}-%{version}.tar.gz |
43a116e0 | 63 | # Source0-md5: 88d667a8ae870d5adeca8cb7d6795442 |
5e6bb28c | 64 | Patch0: %{name}-Werror_strlcpy_fix.patch |
22ccc465 | 65 | Patch1: %{name}-cpp_link_fix.patch |
ba0896eb | 66 | URL: http://thrift.apache.org/ |
22ccc465 | 67 | BuildRequires: autoconf |
9efeafcc ER |
68 | BuildRequires: automake >= 1:1.13 |
69 | BuildRequires: bison >= 2.5 | |
70 | BuildRequires: boost-devel >= 1.54.0 | |
cfcf9423 | 71 | BuildRequires: flex |
72 | BuildRequires: libevent-devel | |
73 | BuildRequires: pkgconfig | |
466f7706 | 74 | BuildRequires: python-devel >= 1:2.4 |
dac4dddf ER |
75 | BuildRequires: rpm-pythonprov |
76 | BuildRequires: rpmbuild(macros) >= 1.219 | |
92ebbd7d | 77 | BuildRequires: zlib-devel >= 1.2.3 |
c5ce9bf5 MGB |
78 | %if %{with qt4} |
79 | BuildRequires: QtNetwork-devel | |
80 | %endif | |
81 | %if %{with c_glib} | |
82 | BuildRequires: glib2-devel | |
83 | %endif | |
84 | %if %{with csharp} | |
c5ce9bf5 | 85 | BuildRequires: mono-csharp |
72a57785 | 86 | BuildRequires: mono-devel |
c5ce9bf5 MGB |
87 | %endif |
88 | %if %{with java} | |
89 | BuildRequires: java-gcj-compat-devel | |
90 | BuildRequires: java-ivy | |
91 | %endif | |
9efeafcc ER |
92 | %if %{with lua} |
93 | BuildRequires: lua51-devel | |
94 | %endif | |
95 | %if %{with nodejs} | |
96 | BuildRequires: nodejs | |
97 | BuildRequires: npm | |
98 | %endif | |
c5ce9bf5 MGB |
99 | %if %{with python} |
100 | BuildRequires: python | |
101 | BuildRequires: python-TwistedCore | |
102 | %endif | |
103 | %if %{with perl} | |
c5ce9bf5 | 104 | BuildRequires: perl-Bit-Vector |
9efeafcc | 105 | BuildRequires: perl-Class-Accessor |
72a57785 | 106 | BuildRequires: perl-base |
c5ce9bf5 MGB |
107 | %endif |
108 | %if %{with php} | |
72a57785 ER |
109 | BuildRequires: %{php_name}-cli |
110 | BuildRequires: %{php_name}-devel | |
111 | BuildRequires: phpunit | |
c5ce9bf5 MGB |
112 | %endif |
113 | %if %{with erlang} | |
114 | BuildRequires: erlang | |
115 | %endif | |
116 | %if %{with ruby} | |
117 | BuildRequires: ruby | |
c5ce9bf5 MGB |
118 | BuildRequires: ruby-bundler |
119 | %endif | |
120 | %if %{with haskell} | |
121 | BuildRequires: ghc | |
122 | BuildRequires: ghc-haskell-platform | |
123 | %endif | |
124 | %if %{with go} | |
125 | BuildRequires: golang | |
126 | %endif | |
127 | %if %{with d} | |
128 | BuildRequires: dmd | |
129 | %endif | |
7f1934de MK |
130 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
131 | ||
c5ce9bf5 MGB |
132 | # library use symbols provided by the glib2 libraries |
133 | %define skip_post_check_so libthrift_c_glib.so.* | |
134 | ||
7f1934de | 135 | %description |
ba0896eb ER |
136 | The Apache Thrift software framework, for scalable cross-language |
137 | services development, combines a software stack with a code generation | |
138 | engine to build services that work efficiently and seamlessly between | |
139 | C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, | |
140 | JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages. | |
7f1934de MK |
141 | |
142 | %description -l pl.UTF-8 | |
5e6bb28c MK |
143 | Programowy szkielet dla rozwoju skalowanych usług dla różnych języków |
144 | programowania. Zawiera oprogramowanie wraz silnikiem generowania kodu | |
145 | do tworzenie usług które spawnie działają pomiędzy C++, Javą, | |
f1f9dec1 | 146 | Pythonem, PHP, Rybym, Erlangiem, Perlem, Haskellem, C#, Cocoa, |
5e6bb28c | 147 | Smalltalikiem i Ocamlem. |
7f1934de | 148 | |
22ccc465 MK |
149 | %package devel |
150 | Summary: C++ header files | |
151 | Summary(pl.UTF-8): Pliki nagłówkowe i bibliotek iterfejsu C++ thrift | |
152 | Group: Development/Libraries | |
783da2ed | 153 | Requires: %{name}-libs = %{version}-%{release} |
22ccc465 MK |
154 | |
155 | %description devel | |
156 | Header and libarary files for C++ thrift inteface. | |
157 | ||
158 | %description devel -l pl.UTF-8 | |
159 | Pliki nagłówkowe i bibliotek iterfejsu C++ thrift. | |
160 | ||
22ccc465 MK |
161 | %package static |
162 | Summary: Thrift C++ static libraries | |
163 | Summary(pl.UTF-8): Biblioteki statyczne iterfejsu C++ thrift | |
164 | Group: Development/Libraries | |
165 | Requires: %{name}-devel = %{version}-%{release} | |
166 | ||
167 | %description static | |
168 | Static libarary files for C++ thrift inteface. | |
169 | ||
170 | %description static -l pl.UTF-8 | |
171 | Statyczne biblioteki iterfejsu C++ thrift. | |
172 | ||
ba0896eb | 173 | %package libs |
22ccc465 MK |
174 | Summary: C++ thrift interface libraries |
175 | Summary(pl.UTF-8): Interfejs thrift dla C++ | |
176 | Group: Development/Libraries | |
177 | Requires: %{name} = %{version}-%{release} | |
178 | ||
ba0896eb | 179 | %description libs |
22ccc465 MK |
180 | C++ thrift interface libraries |
181 | ||
ba0896eb | 182 | %description libs -l pl.UTF-8 |
22ccc465 | 183 | Biblioteki interfejsu thrift dla C++. |
368a393e | 184 | |
a46efa23 ER |
185 | %package -n php-%{name} |
186 | Summary: PHP Thrift interface | |
187 | Summary(pl.UTF-8): Interfejs Thrift dla PHP | |
188 | Group: Development/Languages/PHP | |
189 | Requires: %{name} = %{version}-%{release} | |
1fbdddd8 | 190 | Requires: php(core) >= %{php_min_version} |
a46efa23 ER |
191 | |
192 | %description -n php-%{name} | |
193 | PHP Thrift interface. | |
194 | ||
dac4dddf | 195 | %package -n python-%{name} |
368a393e MK |
196 | Summary: Python thrift interface |
197 | Summary(pl.UTF-8): Interfejs thrift dla Pythona | |
5e6bb28c | 198 | Group: Development/Languages/Python |
368a393e MK |
199 | Requires: %{name} = %{version}-%{release} |
200 | ||
dac4dddf | 201 | %description -n python-%{name} |
368a393e MK |
202 | Python thrift interface. |
203 | ||
dac4dddf | 204 | %description -n python-%{name} -l pl.UTF-8 |
368a393e MK |
205 | Interfejs thrift dla Pythona. |
206 | ||
c5ce9bf5 MGB |
207 | %package -n perl-Thrift |
208 | Summary: Perl thrift interface | |
209 | Summary(pl.UTF-8): Interfejs thrift dla Perla | |
210 | Group: Development/Languages/Perl | |
211 | Requires: %{name} = %{version}-%{release} | |
212 | ||
213 | %description -n perl-Thrift | |
214 | Perl thrift interface. | |
215 | ||
216 | %description -n perl-Thrift -l pl.UTF-8 | |
217 | Interfejs thrift dla Perla. | |
218 | ||
7f1934de MK |
219 | %prep |
220 | %setup -q | |
ba0896eb ER |
221 | #%patch0 -p1 |
222 | #%patch1 -p1 | |
7f1934de MK |
223 | |
224 | %build | |
ba0896eb ER |
225 | %{__aclocal} -I aclocal |
226 | %{__autoconf} | |
22ccc465 MK |
227 | %{__autoheader} |
228 | %{__automake} | |
92ebbd7d | 229 | %configure \ |
a46efa23 | 230 | PHP_PREFIX=%{php_data_dir} \ |
72a57785 | 231 | PHP=%{__php} \ |
c5ce9bf5 | 232 | PERL_PREFIX=%{perl_vendorlib} \ |
ba0896eb ER |
233 | %{__with_without cpp} \ |
234 | %{__with_without qt4} \ | |
f33ea347 | 235 | %{__with_without qt5} \ |
ba0896eb ER |
236 | %{__with_without c_glib} \ |
237 | %{__with_without csharp} \ | |
238 | %{__with_without java} \ | |
239 | %{__with_without erlang} \ | |
e0d63ae7 | 240 | %{__with_without nodejs} \ |
ba0896eb | 241 | %{__with_without python} \ |
e0d63ae7 | 242 | %{__with_without lua} \ |
ba0896eb ER |
243 | %{__with_without perl} \ |
244 | %{__with_without php} \ | |
245 | %{__with_without php_extension} \ | |
246 | %{__with_without ruby} \ | |
247 | %{__with_without haskell} \ | |
248 | %{__with_without go} \ | |
249 | %{__with_without d} \ | |
9efeafcc | 250 | --enable-libs \ |
ba0896eb ER |
251 | --with-boost \ |
252 | --with-libevent \ | |
253 | --with-zlib \ | |
9efeafcc ER |
254 | --disable-tutorial \ |
255 | --disable-tests \ | |
ba0896eb | 256 | %{__with_without tests} |
f13e5a53 | 257 | |
72a57785 | 258 | %{__make} -j1 |
7f1934de MK |
259 | |
260 | %install | |
261 | rm -rf $RPM_BUILD_ROOT | |
7f1934de MK |
262 | %{__make} install \ |
263 | DESTDIR=$RPM_BUILD_ROOT | |
264 | ||
72a57785 | 265 | %if %{with python} |
dac4dddf ER |
266 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} |
267 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
268 | %py_postclean | |
72a57785 | 269 | %endif |
dac4dddf | 270 | |
c5ce9bf5 MGB |
271 | %if %{with perl} |
272 | %{__mv} $RPM_BUILD_ROOT%{perl_vendorlib}/lib/perl5/Thrift{,.pm} $RPM_BUILD_ROOT%{perl_vendorlib} | |
273 | %endif | |
274 | ||
7f1934de MK |
275 | %clean |
276 | rm -rf $RPM_BUILD_ROOT | |
277 | ||
22ccc465 MK |
278 | %post libs -p /sbin/ldconfig |
279 | %postun libs -p /sbin/ldconfig | |
280 | ||
7f1934de MK |
281 | %files |
282 | %defattr(644,root,root,755) | |
dac4dddf | 283 | %attr(755,root,root) %{_bindir}/thrift |
72a57785 | 284 | |
ba0896eb ER |
285 | %if %{with cpp} |
286 | %files libs | |
287 | %defattr(644,root,root,755) | |
288 | %{_libdir}/libthrift-%{version}.so | |
289 | %{_libdir}/libthriftnb-%{version}.so | |
290 | %{_libdir}/libthriftz-%{version}.so | |
c5ce9bf5 MGB |
291 | %if %{with qt4} |
292 | %{_libdir}/libthriftqt-%{version}.so | |
293 | %endif | |
f33ea347 MK |
294 | %if %{with qt5} |
295 | %{_libdir}/libthriftqt5-%{version}.so | |
296 | %endif | |
c5ce9bf5 MGB |
297 | %if %{with c_glib} |
298 | %{_libdir}/libthrift_c_glib.so.* | |
299 | %endif | |
ba0896eb | 300 | |
22ccc465 MK |
301 | %files devel |
302 | %defattr(644,root,root,755) | |
303 | %{_libdir}/libthrift.la | |
22ccc465 | 304 | %{_libdir}/libthriftnb.la |
ba0896eb ER |
305 | %{_libdir}/libthriftz.la |
306 | %{_libdir}/libthrift.so | |
307 | %{_libdir}/libthriftnb.so | |
308 | %{_libdir}/libthriftz.so | |
309 | %{_includedir}/thrift | |
22ccc465 MK |
310 | %{_pkgconfigdir}/thrift-nb.pc |
311 | %{_pkgconfigdir}/thrift-z.pc | |
312 | %{_pkgconfigdir}/thrift.pc | |
c5ce9bf5 MGB |
313 | %if %{with qt4} |
314 | %{_libdir}/libthriftqt.so | |
315 | %{_libdir}/libthriftqt.la | |
316 | %{_pkgconfigdir}/thrift-qt.pc | |
317 | %endif | |
f33ea347 | 318 | %if %{with qt5} |
43a116e0 MK |
319 | %{_libdir}/libthriftqt5.so |
320 | %{_libdir}/libthriftqt5.la | |
321 | %{_pkgconfigdir}/thrift-qt5.pc | |
f33ea347 | 322 | %endif |
c5ce9bf5 MGB |
323 | %if %{with c_glib} |
324 | %{_libdir}/libthrift_c_glib.so | |
325 | %{_libdir}/libthrift_c_glib.la | |
326 | %{_pkgconfigdir}/thrift_c_glib.pc | |
327 | %endif | |
22ccc465 MK |
328 | |
329 | %files static | |
330 | %defattr(644,root,root,755) | |
331 | %{_libdir}/libthrift.a | |
22ccc465 | 332 | %{_libdir}/libthriftnb.a |
ba0896eb | 333 | %{_libdir}/libthriftz.a |
c5ce9bf5 MGB |
334 | %if %{with qt4} |
335 | %{_libdir}/libthriftqt.a | |
336 | %endif | |
f33ea347 | 337 | %if %{with qt5} |
43a116e0 | 338 | %{_libdir}/libthriftqt5.a |
f33ea347 | 339 | %endif |
c5ce9bf5 MGB |
340 | %if %{with c_glib} |
341 | %{_libdir}/libthrift_c_glib.a | |
342 | %endif | |
ba0896eb | 343 | %endif |
22ccc465 | 344 | |
a46efa23 ER |
345 | %if %{with php} |
346 | %files -n php-%{name} | |
347 | %defattr(644,root,root,755) | |
348 | %{php_data_dir}/Thrift | |
349 | %endif | |
350 | ||
ba0896eb | 351 | %if %{with python} |
dac4dddf | 352 | %files -n python-%{name} |
368a393e | 353 | %defattr(644,root,root,755) |
dac4dddf ER |
354 | %dir %{py_sitedir}/%{name} |
355 | %dir %{py_sitedir}/%{name}/protocol | |
356 | %{py_sitedir}/%{name}/protocol/*.py[co] | |
357 | %attr(755,root,root) %{py_sitedir}/%{name}/protocol/fastbinary.so | |
358 | %dir %{py_sitedir}/%{name}/server | |
359 | %{py_sitedir}/%{name}/server/*.py[co] | |
360 | %dir %{py_sitedir}/%{name}/transport | |
361 | %{py_sitedir}/%{name}/transport/*.py[co] | |
362 | %{py_sitedir}/%{name}/*.py[co] | |
368a393e | 363 | %if "%{py_ver}" > "2.4" |
ba0896eb ER |
364 | %{py_sitedir}/thrift-%{version}-py*.egg-info |
365 | %endif | |
368a393e | 366 | %endif |
c5ce9bf5 MGB |
367 | |
368 | %if %{with perl} | |
369 | %files -n perl-Thrift | |
370 | %defattr(644,root,root,755) | |
371 | %dir %{perl_vendorlib}/Thrift | |
372 | %{perl_vendorlib}/Thrift.pm | |
373 | %{perl_vendorlib}/Thrift/*.pm | |
374 | %endif |