Sophie

Sophie

distrib > Mageia > 1 > i586 > by-pkgid > 8618e63f6875d2b0fbbee8d0531c0030 > files > 3

ruby-ffi-1.0.7-1.mga1.src.rpm

%define oname   ffi

Name:       ruby-%{oname}
Version:    1.0.7
Release:    %mkrel 1
Summary:    A ruby extension for programmatically loading dynamic libraries
License:    BSD
Group:      Development/Ruby
URL:        http://wiki.github.com/ffi/ffi
Source0:    http://rubygems.org/gems/%{oname}-%{version}.gem
# github archive because libtest/ dir is missing in the gem
Source1:    %{oname}-%{version}.tar.gz
BuildRequires: rubygems
BuildRequires: ruby-devel
BuildRequires: ffi5-devel
BuildRequires: rubygem(rspec)
BuildRequires: rubygem(rake)
BuildRequires: rubygem(rake-compiler)
Requires:   ruby(abi) = 1.8

%description
Ruby-FFI is a ruby extension for programmatically loading dynamic
libraries, binding functions within them, and calling those functions
from Ruby code. Moreover, a Ruby-FFI extension works without changes
on Ruby and JRuby. Discover why should you write your next extension
using Ruby-FFI here[http://wiki.github.com/ffi/ffi/why-use-ffi].

%files
%defattr(-, root, root, -)
%dir %{ruby_gemdir}/gems/%{oname}-%{version}/
%{ruby_gemdir}/gems/%{oname}-%{version}/lib
%{ruby_gemdir}/specifications/%{oname}-%{version}.gemspec
%{ruby_sitearchdir}/ffi_c.so

#-------------------------------------------------------------------------------
%package        doc
Summary:    Documentation for %{name}
Group:      Development/Ruby
Requires:   %{name} = %{version}-%{release}

%description    doc
Documents, Rdoc & RI documentation for %{name}.
%files          doc
%defattr(-,root,root,-)
%doc %{ruby_gemdir}/doc/%{oname}-%{version}
%doc %{ruby_gemdir}/gems/%{oname}-%{version}/History.txt
%doc %{ruby_gemdir}/gems/%{oname}-%{version}/README.rdoc
#-------------------------------------------------------------------------------

%prep
%setup -q
tar xmf data.tar.gz
tar xvvf %{SOURCE1} --keep-old-files --strip-components=1

%build
%gem_build

%install
rm -rf %{buildroot}
%gem_install

%check
# remove deprecated opts
echo > spec/spec.opts
# require newer rspec
sed -i "s/require 'spec'/require 'rspec'/" spec/ffi/spec_helper.rb
# compile test lib
gmake -f libtest/GNUmakefile
# run rspec
rspec -I%{buildroot}%{ruby_sitearchdir} --color --format p spec

%clean
rm -rf %{buildroot}



%changelog
* Tue Apr 19 2011 shikamaru <shikamaru> 1.0.7-1.mga1
+ Revision: 88768
- new version 1.0.7

* Sat Feb 19 2011 shikamaru <shikamaru> 0.6.3-1.mga1
+ Revision: 54164
- add sitearchdir in load path so that so file gets found
- Fix compatibility with rspec 2
- fix BuildRequires
- imported package ruby-ffi


* Sun Feb 13 2011 Rémy Clouard <shikamaru@mandriva.org> - 0.6.3-1
- Initial package