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