]>
Commit | Line | Data |
---|---|---|
cc645d48 ER |
1 | # TODO |
2 | # - use system libev (0.5.0 bundles libev 4.15) | |
a6c86165 ER |
3 | # |
4 | # Conditional build: | |
5 | %bcond_with tests # build without tests | |
6 | ||
7 | %define pkgname nio4r | |
8 | Summary: NIO provides a high performance selector API for monitoring IO objects | |
9 | Name: ruby-%{pkgname} | |
10 | Version: 0.5.0 | |
8ce7b71a | 11 | Release: 3 |
a6c86165 ER |
12 | License: MIT |
13 | Group: Development/Languages | |
14 | Source0: http://rubygems.org/downloads/%{pkgname}-%{version}.gem | |
15 | # Source0-md5: c00295b39521d713d0eddb0925f4147d | |
16 | URL: https://github.com/celluloid/nio4r | |
17 | BuildRequires: rpm-rubyprov | |
18 | BuildRequires: rpmbuild(macros) >= 1.665 | |
19 | BuildRequires: ruby-devel | |
20 | %if %{with tests} | |
21 | BuildRequires: ruby-rake | |
22 | BuildRequires: ruby-rake-compiler | |
23 | BuildRequires: ruby-rspec | |
24 | %endif | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %description | |
28 | When it comes to managing many IO objects on Ruby, there aren't a | |
29 | whole lot of options. The most powerful API Ruby itself gives you is | |
30 | Kernel.select, and select is hurting when it comes to performance and | |
31 | in terms of having a nice API. | |
32 | ||
33 | Once upon a time Java was a similar mess. They got out of it by adding | |
34 | the Java NIO API. Java NIO provides a high performance selector API | |
35 | for monitoring large numbers of file descriptors. | |
36 | ||
37 | This library aims to incorporate the ideas of Java NIO in Ruby. These | |
38 | are: | |
39 | - Expose high level interfaces for doing high performance IO, but keep | |
40 | the codebase small to encourage multiple implementations on different | |
41 | platforms | |
42 | - Be as portable as possible, in this case across several Ruby VMs | |
43 | - Provide inherently thread-safe facilities for working with IO | |
44 | objects | |
45 | ||
46 | %prep | |
47 | %setup -q -n %{pkgname}-%{version} | |
48 | ||
49 | %build | |
50 | # write .gemspec | |
51 | %__gem_helper spec | |
52 | cd ext/%{pkgname} | |
53 | %{__ruby} extconf.rb | |
54 | %{__make} \ | |
55 | CC="%{__cc}" \ | |
56 | LDFLAGS="%{rpmldflags}" \ | |
57 | CFLAGS="%{rpmcflags} -fPIC" | |
58 | ||
59 | %install | |
60 | rm -rf $RPM_BUILD_ROOT | |
61 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_specdir}} | |
62 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} | |
63 | install -p ext/%{pkgname}/nio4r_ext.so $RPM_BUILD_ROOT%{ruby_vendorarchdir} | |
64 | cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir} | |
65 | ||
66 | %clean | |
67 | rm -rf $RPM_BUILD_ROOT | |
68 | ||
69 | %files | |
70 | %defattr(644,root,root,755) | |
71 | %doc README.md CHANGES.md LICENSE.txt | |
72 | %{ruby_vendorlibdir}/nio.rb | |
73 | %{ruby_vendorlibdir}/nio | |
74 | %attr(755,root,root) %{ruby_vendorarchdir}/nio4r_ext.so | |
75 | %{ruby_specdir}/%{pkgname}-%{version}.gemspec |