]>
Commit | Line | Data |
---|---|---|
4ae334f6 | 1 | # |
bac43acd ER |
2 | # Conditional build: |
3 | %bcond_without tests # build without tests | |
4 | ||
7f59e59c | 5 | %define pkgname ffi |
5d8a12a9 | 6 | Summary: FFI Extensions for Ruby |
4ae334f6 | 7 | Summary(pl.UTF-8): Rozszerzenia FFI dla języka Ruby |
7f59e59c | 8 | Name: ruby-%{pkgname} |
5a192f4b JR |
9 | Version: 1.9.6 |
10 | Release: 1 | |
947bc9d0 | 11 | License: BSD |
5d8a12a9 | 12 | Group: Development/Languages |
7f59e59c | 13 | Source0: http://rubygems.org/gems/%{pkgname}-%{version}.gem |
5a192f4b | 14 | # Source0-md5: 8606c263037322ae957e1959245841be |
4ae334f6 | 15 | Patch0: %{name}-platform.patch |
5d8a12a9 ER |
16 | URL: http://wiki.github.com/ffi/ffi |
17 | BuildRequires: libffi-devel | |
18 | BuildRequires: rpm-rubyprov | |
60db665a | 19 | BuildRequires: rpmbuild(macros) >= 1.665 |
d2209b89 | 20 | BuildRequires: ruby-devel |
5d8a12a9 | 21 | BuildRequires: setup.rb |
bac43acd ER |
22 | %if %{with tests} |
23 | BuildRequires: ruby-rspec | |
ed0d1fdb | 24 | BuildRequires: ruby-rspec-mocks |
bac43acd | 25 | %endif |
4ae334f6 | 26 | ExclusiveArch: %{ix86} %{x8664} arm ia64 mips mipsel ppc s390 s390x sparc sparcv9 |
5d8a12a9 ER |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
28 | ||
29 | %description | |
4ae334f6 | 30 | Ruby-FFI is a Ruby extension for programmatically loading dynamic |
5d8a12a9 ER |
31 | libraries, binding functions within them, and calling those functions |
32 | from Ruby code. Moreover, a Ruby-FFI extension works without changes | |
33 | on Ruby and JRuby. Discover why should you write your next extension | |
34 | using Ruby-FFI here: <http://wiki.github.com/ffi/ffi/why-use-ffi>. | |
35 | ||
4ae334f6 JB |
36 | %description -l pl.UTF-8 |
37 | Ruby-FFI to rozszerzenie języka Ruby do programowego ładowania | |
38 | bibliotek dynamicznych, wiązania obecnych w nich funkcji oraz | |
39 | wywoływania tych funkcji z kodu w języku Ruby. Co więcej, rozszerzenie | |
40 | Ruby-FFI działa bez zmian w implementacji Ruby oraz JRuby. Informacje, | |
41 | dlaczego nowe rozszerzenia powinny używać Ruby-FFI, można znaleźć na | |
42 | stronie <http://wiki.github.com/ffi/ffi/why-use-ffi>. | |
43 | ||
5d8a12a9 | 44 | %prep |
7f59e59c | 45 | %setup -q -n %{pkgname}-%{version} |
4ae334f6 | 46 | %patch0 -p1 |
5d8a12a9 | 47 | |
336d53d2 | 48 | # be sure to use system ffi |
4ae334f6 | 49 | %{__rm} -r ext/ffi_c/libffi |
336d53d2 | 50 | |
a2262c61 | 51 | # drop not our targets |
4ae334f6 JB |
52 | %{__rm} -r lib/ffi/platform/*-{aix,cygwin,darwin,gnu,*bsd,solaris,windows} |
53 | # provide only definitions for package architecture | |
54 | %ifnarch arm | |
55 | %{__rm} -r lib/ffi/platform/arm-* | |
56 | %endif | |
57 | %ifnarch %{ix86} | |
58 | %{__rm} -r lib/ffi/platform/i386-* | |
59 | %endif | |
60 | %ifnarch ia64 | |
61 | %{__rm} -r lib/ffi/platform/ia64-* | |
62 | %endif | |
63 | %ifnarch mips | |
64 | %{__rm} -r lib/ffi/platform/mips-* | |
65 | %endif | |
66 | %ifnarch mipsel | |
67 | %{__rm} -r lib/ffi/platform/mipsel-* | |
68 | %endif | |
69 | %ifnarch powerpc | |
70 | %{__rm} -r lib/ffi/platform/powerpc-* | |
71 | %endif | |
72 | %ifnarch s390 | |
73 | %{__rm} -r lib/ffi/platform/s390-* | |
74 | %endif | |
75 | %ifnarch s390x | |
76 | %{__rm} -r lib/ffi/platform/s390x-* | |
77 | %endif | |
78 | %ifnarch sparc | |
79 | %{__rm} -r lib/ffi/platform/sparc-* | |
80 | %endif | |
81 | %ifnarch %{x8664} | |
82 | %{__rm} -r lib/ffi/platform/x86_64-* | |
83 | %endif | |
a2262c61 | 84 | |
5d8a12a9 ER |
85 | # ext build |
86 | cp -p %{_datadir}/setup.rb . | |
87 | ||
88 | %build | |
60db665a ER |
89 | %__gem_helper spec |
90 | ||
5d8a12a9 ER |
91 | %{__ruby} setup.rb config \ |
92 | --rbdir=%{ruby_rubylibdir} \ | |
0cbc2159 ER |
93 | --sodir=%{ruby_archdir} \ |
94 | --makeprog=true | |
5d8a12a9 ER |
95 | |
96 | %{__ruby} setup.rb setup | |
97 | ||
0cbc2159 ER |
98 | %{__make} -C ext/ffi_c \ |
99 | CC="%{__cc}" | |
100 | ||
5d8a12a9 | 101 | %if %{with tests} |
0cbc2159 ER |
102 | %{__make} -f libtest/GNUmakefile \ |
103 | CCACHE= \ | |
104 | CC="%{__cc}" | |
ed0d1fdb ER |
105 | ruby -Ilib:ext/ffi_c -S \ |
106 | rspec spec | |
5d8a12a9 ER |
107 | %endif |
108 | ||
109 | %install | |
110 | rm -rf $RPM_BUILD_ROOT | |
4ae334f6 | 111 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir}/ffi,%{ruby_specdir}} |
5d8a12a9 ER |
112 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} |
113 | install -p ext/ffi_c/ffi_c.so $RPM_BUILD_ROOT%{ruby_vendorarchdir} | |
4ae334f6 | 114 | %{__mv} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/ffi/platform $RPM_BUILD_ROOT%{ruby_vendorarchdir}/ffi |
60db665a | 115 | cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir} |
5d8a12a9 ER |
116 | |
117 | %clean | |
118 | rm -rf $RPM_BUILD_ROOT | |
119 | ||
120 | %files | |
121 | %defattr(644,root,root,755) | |
947bc9d0 | 122 | %doc README.md LICENSE |
5d8a12a9 ER |
123 | %{ruby_vendorlibdir}/ffi.rb |
124 | %{ruby_vendorlibdir}/ffi | |
125 | %attr(755,root,root) %{ruby_vendorarchdir}/ffi_c.so | |
4ae334f6 JB |
126 | %dir %{ruby_vendorarchdir}/ffi |
127 | %{ruby_vendorarchdir}/ffi/platform | |
7f59e59c | 128 | %{ruby_specdir}/%{pkgname}-%{version}.gemspec |