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