2020-08-28 14:49:59 +08:00
|
|
|
%global gem_name ffi
|
|
|
|
|
Name: rubygem-%{gem_name}
|
|
|
|
|
Version: 1.10.0
|
2024-12-02 15:47:16 +08:00
|
|
|
Release: 6
|
2020-08-28 14:49:59 +08:00
|
|
|
Summary: FFI Extensions for Ruby
|
2022-05-10 17:26:57 +08:00
|
|
|
License: BSD-3-Clause and MIT
|
2020-08-28 14:49:59 +08:00
|
|
|
URL: https://www.github.com/ffi/ffi
|
|
|
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
|
|
|
|
Source1: https://www.github.com/ffi/%{gem_name}/archive/%{version}.tar.gz
|
2022-01-26 17:13:02 +08:00
|
|
|
Patch0: Remove-taint-support.patch
|
2023-05-19 11:18:22 +08:00
|
|
|
Patch1: 0001-add-loongarch64-support-for-ffi.patch
|
2023-07-10 16:49:36 +08:00
|
|
|
Patch2: 0002-Add-types.conf-for-riscv64-linux.patch
|
2020-08-28 14:49:59 +08:00
|
|
|
BuildRequires: ruby(release) rubygems-devel ruby-devel gcc libffi-devel rubygem(rspec)
|
|
|
|
|
%description
|
|
|
|
|
Ruby-FFI is a ruby extension for programmatically loading dynamic
|
|
|
|
|
libraries, binding functions within them, and calling those functions
|
|
|
|
|
from Ruby code. Moreover, a Ruby-FFI extension works without changes
|
|
|
|
|
on Ruby and JRuby. Discover why should you write your next extension
|
|
|
|
|
using Ruby-FFI here[http://wiki.github.com/ffi/ffi/why-use-ffi].
|
|
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
|
Summary: Documentation for %{name}
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
%description doc
|
|
|
|
|
Documentation for %{name}.
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n %{gem_name}-%{version} -b 1
|
|
|
|
|
ln -s %{gem_name}-%{version}/test test
|
|
|
|
|
ln -s %{gem_name}-%{version}/spec spec
|
2022-01-26 17:13:02 +08:00
|
|
|
%patch0 -p1
|
2023-05-19 11:18:22 +08:00
|
|
|
%patch1 -p1
|
2023-07-10 16:49:36 +08:00
|
|
|
%patch2 -p1
|
2020-08-28 14:49:59 +08:00
|
|
|
|
|
|
|
|
%build
|
2024-12-02 15:47:16 +08:00
|
|
|
gem build ffi.gemspec
|
2020-08-28 14:49:59 +08:00
|
|
|
%gem_install
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
mkdir -p %{buildroot}%{gem_dir}
|
2023-07-10 16:49:36 +08:00
|
|
|
%ifarch riscv64
|
|
|
|
|
cp -r lib/ffi/platform/riscv64-linux/ .%{gem_instdir}/lib/ffi/platform/
|
|
|
|
|
%endif
|
2020-08-28 14:49:59 +08:00
|
|
|
cp -a .%{gem_dir}/* \
|
|
|
|
|
%{buildroot}%{gem_dir}/
|
|
|
|
|
mkdir -p %{buildroot}%{gem_extdir_mri}
|
|
|
|
|
cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/
|
|
|
|
|
rm -rf %{buildroot}%{gem_instdir}/ext/
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
pushd .%{gem_instdir}
|
|
|
|
|
ln -s %{_builddir}/%{gem_name}-%{version}/spec spec
|
|
|
|
|
pushd spec/ffi/fixtures
|
|
|
|
|
make JFLAGS="%{optflags}"
|
|
|
|
|
popd
|
|
|
|
|
rspec -I$(dirs +1)%{gem_extdir_mri} spec
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%dir %{gem_instdir}
|
|
|
|
|
%{gem_extdir_mri}
|
|
|
|
|
%exclude %{gem_instdir}/.*
|
|
|
|
|
%license %{gem_instdir}/COPYING
|
|
|
|
|
%license %{gem_instdir}/LICENSE
|
|
|
|
|
%license %{gem_instdir}/LICENSE.SPECS
|
|
|
|
|
%exclude %{gem_instdir}/appveyor.yml
|
|
|
|
|
%{gem_libdir}
|
|
|
|
|
%exclude %{gem_cache}
|
|
|
|
|
%{gem_spec}
|
|
|
|
|
|
|
|
|
|
%files doc
|
|
|
|
|
%doc %{gem_docdir}
|
|
|
|
|
%doc %{gem_instdir}/CHANGELOG.md
|
|
|
|
|
%{gem_instdir}/Gemfile
|
|
|
|
|
%doc %{gem_instdir}/README.md
|
|
|
|
|
%{gem_instdir}/Rakefile
|
|
|
|
|
%{gem_instdir}/samples
|
|
|
|
|
%{gem_instdir}/ffi.gemspec
|
|
|
|
|
|
|
|
|
|
%changelog
|
2024-12-02 15:47:16 +08:00
|
|
|
* Mon Dec 02 2024 Jia Chao <jiac13@chinaunicom.cn> 1.10.0-6
|
|
|
|
|
- Fix: always apply loongarch64 patch, use the same gemspec on all arches.
|
|
|
|
|
|
2023-07-10 16:49:36 +08:00
|
|
|
* Mon Jul 10 2023 laokz <zhangkai@iscas.ac.cn> - 1.10.0-5
|
|
|
|
|
- backport upstream patch to support riscv64
|
|
|
|
|
|
2023-05-19 11:18:22 +08:00
|
|
|
* Thu May 18 2023 Wenlong Zhang <zhangwenlong@loongson.cn> - 1.10.0-4
|
|
|
|
|
- add loongarch64 support for rubygem-ffi
|
|
|
|
|
|
2022-05-10 17:26:57 +08:00
|
|
|
* Tue May 10 2022 yaoxin <yaoxin30@h-partners.com> - 1.10.0-3
|
|
|
|
|
- License compliance rectification
|
|
|
|
|
|
2022-01-26 17:13:02 +08:00
|
|
|
* Wed Jan 26 2022 liyanan <liyanan32@huawei.com> - 1.10.0-2
|
|
|
|
|
- Remove taint support
|
|
|
|
|
|
2020-08-28 14:49:59 +08:00
|
|
|
* Thu Aug 20 2020 xiezheng <xiezheng4@huawei.com> - 1.10.0-1
|
|
|
|
|
- package init
|