rubygem-bootsnap/rubygem-bootsnap.spec
cherry530 b8c1df13bf Fixed mocha/minitest dependency issue due to rubygem-mocha upgrade
Signed-off-by: cherry530 <xuping33@huawei.com>
(cherry picked from commit e22bb051660ce0d640bb1ca43e42d3ec212e0b5a)
2022-10-19 09:04:12 +08:00

95 lines
3.1 KiB
RPMSpec

%global gem_name bootsnap
Name: rubygem-%{gem_name}
Version: 1.3.2
Release: 4
Summary: Boot large ruby/rails apps faster
License: MIT
URL: https://github.com/Shopify/bootsnap
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Source1: https://github.com/Shopify/bootsnap/archive/v1.3.2.tar.gz
Patch1: fix-no-implicit-conversion-of-String-into-Integer.patch
BuildRequires: ruby(release) rubygems-devel ruby-devel >= 2.0.0 rubygem(minitest)
BuildRequires: rubygem(mocha) rubygem(msgpack) gcc
ExcludeArch: armv7hl
%description
Bootsnap is a library that plugs into Ruby, with optional support
for ActiveSupport and YAML, to optimize and cache expensive computations.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version}
%patch1 -p1
sed -i -e "/^\s*\$CFLAGS / s/^/#/g" \
ext/bootsnap/extconf.rb
%build
gem build ../%{gem_name}-%{version}.gemspec
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
mkdir -p %{buildroot}%{gem_extdir_mri}/%{gem_name}
cp -a .%{gem_extdir_mri}/gem.build_complete %{buildroot}%{gem_extdir_mri}/
cp -a .%{gem_extdir_mri}/%{gem_name}/*.so %{buildroot}%{gem_extdir_mri}/%{gem_name}
rm -rf %{buildroot}%{gem_instdir}/ext/
%check
pushd .%{gem_instdir}
tar xzvf %{SOURCE1}
ln -s %{gem_name}-%{version}/test test
sed -i 'N;38a\ if RUBY_REVISION.is_a?(String)\n exp = [Help.fnv1a_64(RUBY_REVISION) >> 32].pack("L")\n else\n exp = [RUBY_REVISION].pack("L")\n end' bootsnap-1.3.2/test/compile_cache_key_format_test.rb
sed -i '38 d' bootsnap-1.3.2/test/compile_cache_key_format_test.rb
sed -i -e "/require 'bundler/ s/^/#/g" \
test/test_helper.rb
sed -i -e "/^\s*assert stable.stable?,/ s/^/#/g" \
-e "/^\s*refute stable.volatile?,/ s/^/#/g" \
-e "/^\s*assert bundler.stable?,/ s/^/#/g" \
-e "/^\s*Bundler/ s/^/#/g" \
test/load_path_cache/path_test.rb
ruby -Ilib:test:ext -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
popd
%files
%dir %{gem_instdir}
%{gem_extdir_mri}
%exclude %{gem_instdir}/.*
%license %{gem_instdir}/LICENSE.txt
%exclude %{gem_instdir}/bootsnap.gemspec
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
%doc %{gem_instdir}/CONTRIBUTING.md
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.jp.md
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile
%{gem_instdir}/dev.yml
%{gem_instdir}/shipit.rubygems.yml
%{gem_instdir}/bin
%doc %{gem_instdir}/CODE_OF_CONDUCT.md
%changelog
* Tue Jul 05 2022 xu_ping <xuping33@h-partners.com> - 1.3.2-4
- fixed mocha/minitest dependency issue due to rubygem-mocha upgrade
* Thu Jan 27 2022 wulei <wulei@huawei.com> - 1.3.2-3
- fix no implicit conversion of String into Integer
* Tue Sep 8 2020 yanan li <liyanan032@huawei.com> - 1.3.2-2
- fix build fail
* Tue Aug 18 2020 wanglin <wanglin175@huawei.com> - 1.3.2-1
- package init