%global gem_name fakefs Name: rubygem-%{gem_name} Version: 0.13.1 Release: 1 Summary: A fake filesystem. Use it in your tests License: MIT URL: https://github.com/fakefs/fakefs Source0: https://rubygems.org/gems/fakefs-%{version}.gem Source1: https://github.com/fakefs/fakefs/archive/v%{version}/fakefs-%{version}.tar.gz # Skip test of methods introduced in Ruby 2.5. # https://github.com/fakefs/fakefs/issues/390 Patch0: rubygem-fakefs-0.13.1-Skip-tests-of-pwrite-and-pwrite.patch BuildRequires: ruby(release) rubygems-devel ruby rubygem(rspec) rubygem(minitest) BuildArch: noarch %description A fake filesystem. Use it in your tests. %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 %patch0 -p1 %build gem build ../%{gem_name}-%{version}.gemspec %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ %check pushd .%{gem_instdir} ln -s %{_builddir}/{spec,test} . rspec spec popd sed -i '/bundler/ s/^/#/' test/test_helper.rb sed -i '/minitest\/rg/ s/^/#/' test/test_helper.rb ruby -Ilib -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' %files %dir %{gem_instdir} %license %{gem_instdir}/LICENSE %{gem_libdir} %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir} %doc %{gem_instdir}/README.md %changelog * Thu Jul 30 2020 maminjie - 0.13.1-1 - package init