]> git.pld-linux.org Git - packages/ruby-ffi.git/blob - ruby-ffi.spec
fix testing with newly built library
[packages/ruby-ffi.git] / ruby-ffi.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define pkgname ffi
6 Summary:        FFI Extensions for Ruby
7 Name:           ruby-%{pkgname}
8 Version:        1.8.1
9 Release:        2
10 License:        LGPL v3
11 Group:          Development/Languages
12 Source0:        http://rubygems.org/gems/%{pkgname}-%{version}.gem
13 # Source0-md5:  b3b511cfa03083b0ed078e28f9556517
14 URL:            http://wiki.github.com/ffi/ffi
15 BuildRequires:  libffi-devel
16 BuildRequires:  rpm-rubyprov
17 BuildRequires:  rpmbuild(macros) >= 1.665
18 BuildRequires:  setup.rb
19 %if %{with tests}
20 BuildRequires:  ruby-rspec
21 BuildRequires:  ruby-rspec-mocks
22 %endif
23 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25 %description
26 Ruby-FFI is a ruby extension for programmatically loading dynamic
27 libraries, binding functions within them, and calling those functions
28 from Ruby code. Moreover, a Ruby-FFI extension works without changes
29 on Ruby and JRuby. Discover why should you write your next extension
30 using Ruby-FFI here: <http://wiki.github.com/ffi/ffi/why-use-ffi>.
31
32 %prep
33 %setup -q -n %{pkgname}-%{version}
34
35 # ext build
36 cp -p %{_datadir}/setup.rb .
37
38 %build
39 %__gem_helper spec
40
41 %{__ruby} setup.rb config \
42         --rbdir=%{ruby_rubylibdir} \
43         --sodir=%{ruby_archdir}
44
45 %{__ruby} setup.rb setup
46
47 %if %{with tests}
48 %{__make} -f libtest/GNUmakefile
49 ruby -Ilib:ext/ffi_c -S \
50         rspec spec
51 %endif
52
53 %install
54 rm -rf $RPM_BUILD_ROOT
55 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_specdir}}
56 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
57 install -p ext/ffi_c/ffi_c.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
58 cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
59
60 %clean
61 rm -rf $RPM_BUILD_ROOT
62
63 %files
64 %defattr(644,root,root,755)
65 %doc README.md History.txt LICENSE
66 %{ruby_vendorlibdir}/ffi.rb
67 %{ruby_vendorlibdir}/ffi
68 %attr(755,root,root) %{ruby_vendorarchdir}/ffi_c.so
69 %{ruby_specdir}/%{pkgname}-%{version}.gemspec
This page took 0.060089 seconds and 4 git commands to generate.