]>
Commit | Line | Data |
---|---|---|
76db1217 | 1 | %define gem_name ffi |
5d8a12a9 ER |
2 | Summary: FFI Extensions for Ruby |
3 | Name: ruby-%{gem_name} | |
4 | Version: 1.4.0 | |
5 | Release: 1 | |
6 | License: LGPL v3 | |
7 | Group: Development/Languages | |
8 | Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem | |
9 | # Source0-md5: 5ce1c04c23267cb550250f6d94e03c12 | |
10 | URL: http://wiki.github.com/ffi/ffi | |
11 | BuildRequires: libffi-devel | |
12 | BuildRequires: rpm-rubyprov | |
13 | BuildRequires: rpmbuild(macros) >= 1.656 | |
14 | BuildRequires: ruby-rspec | |
15 | BuildRequires: setup.rb | |
16 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
17 | ||
18 | %description | |
19 | Ruby-FFI is a ruby extension for programmatically loading dynamic | |
20 | libraries, binding functions within them, and calling those functions | |
21 | from Ruby code. Moreover, a Ruby-FFI extension works without changes | |
22 | on Ruby and JRuby. Discover why should you write your next extension | |
23 | using Ruby-FFI here: <http://wiki.github.com/ffi/ffi/why-use-ffi>. | |
24 | ||
25 | %prep | |
26 | %setup -q -n %{gem_name}-%{version} | |
27 | ||
28 | # ext build | |
29 | cp -p %{_datadir}/setup.rb . | |
30 | ||
31 | %build | |
32 | %{__ruby} setup.rb config \ | |
33 | --rbdir=%{ruby_rubylibdir} \ | |
34 | --sodir=%{ruby_archdir} | |
35 | ||
36 | %{__ruby} setup.rb setup | |
37 | ||
38 | %if %{with tests} | |
39 | %{__make} -f libtest/GNUmakefile | |
40 | rspec spec | |
41 | %endif | |
42 | ||
43 | %install | |
44 | rm -rf $RPM_BUILD_ROOT | |
45 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir}} | |
46 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} | |
47 | install -p ext/ffi_c/ffi_c.so $RPM_BUILD_ROOT%{ruby_vendorarchdir} | |
48 | ||
49 | %clean | |
50 | rm -rf $RPM_BUILD_ROOT | |
51 | ||
52 | %files | |
53 | %defattr(644,root,root,755) | |
54 | %doc README.md History.txt LICENSE | |
55 | %{ruby_vendorlibdir}/ffi.rb | |
56 | %{ruby_vendorlibdir}/ffi | |
57 | %attr(755,root,root) %{ruby_vendorarchdir}/ffi_c.so |