]> git.pld-linux.org Git - packages/ruby-ffi.git/blob - ruby-ffi.spec
- rebuild with ruby 2.4
[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:        4
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} aarch64 arm ia64 mips mips64el mipsel powerpc64 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 aarch64
58 %{__rm} -r lib/ffi/platform/aarch64-*
59 %endif
60 %ifnarch arm
61 %{__rm} -r lib/ffi/platform/arm-*
62 %endif
63 %ifnarch %{ix86}
64 %{__rm} -r lib/ffi/platform/i386-*
65 %endif
66 %ifnarch ia64
67 %{__rm} -r lib/ffi/platform/ia64-*
68 %endif
69 %ifnarch mips
70 %{__rm} -r lib/ffi/platform/mips-*
71 %endif
72 %ifnarch mipsel
73 %{__rm} -r lib/ffi/platform/mipsel-*
74 %endif
75 %ifnarch mips64el
76 %{__rm} -r lib/ffi/platform/mips64el-*
77 %endif
78 %ifnarch powerpc
79 %{__rm} -r lib/ffi/platform/powerpc-*
80 %endif
81 %ifnarch powerpc64
82 %{__rm} -r lib/ffi/platform/powerpc64-*
83 %endif
84 %ifnarch s390
85 %{__rm} -r lib/ffi/platform/s390-*
86 %endif
87 %ifnarch s390x
88 %{__rm} -r lib/ffi/platform/s390x-*
89 %endif
90 %ifnarch sparc
91 %{__rm} -r lib/ffi/platform/sparc-*
92 %endif
93 %ifnarch %{x8664}
94 %{__rm} -r lib/ffi/platform/x86_64-*
95 %endif
96
97 # cleanup backups after patching
98 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
99
100 %build
101 %__gem_helper spec
102
103 cd ext/ffi_c
104 %{__ruby} extconf.rb
105 %{__make} \
106         CC="%{__cc}" \
107         ldflags="%{rpmldflags}" \
108         optflags="%{rpmcflags} -fPIC"
109 cd -
110
111 %if %{with tests}
112 %{__make} -f libtest/GNUmakefile \
113         CCACHE= \
114         OFLAGS='%{rpmcflags} $(JFLAGS)' \
115         CC="%{__cc}"
116
117 %{__make} -C spec/ffi/fixtures \
118         CCACHE= \
119         OFLAGS='%{rpmcflags} $(JFLAGS)' \
120         CC="%{__cc}"
121
122 ruby -Ilib:ext/ffi_c -S \
123         rspec spec
124 %endif
125
126 %install
127 rm -rf $RPM_BUILD_ROOT
128 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir}/ffi,%{ruby_specdir}}
129 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
130 install -p ext/ffi_c/ffi_c.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
131 %{__mv} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/ffi/platform $RPM_BUILD_ROOT%{ruby_vendorarchdir}/ffi
132 cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
133
134 %clean
135 rm -rf $RPM_BUILD_ROOT
136
137 %files
138 %defattr(644,root,root,755)
139 %doc README.md LICENSE
140 %{ruby_vendorlibdir}/ffi.rb
141 %{ruby_vendorlibdir}/ffi
142 %attr(755,root,root) %{ruby_vendorarchdir}/ffi_c.so
143 %dir %{ruby_vendorarchdir}/ffi
144 %{ruby_vendorarchdir}/ffi/platform
145 %{ruby_specdir}/%{pkgname}-%{version}.gemspec
This page took 0.043098 seconds and 4 git commands to generate.