rubygem-rspec2-mocks/rubygem-rspec2-mocks.spec

79 lines
2.3 KiB
RPMSpec
Raw Permalink Normal View History

2020-09-07 11:21:15 +08:00
%bcond_with bootstrap
2020-08-25 14:51:26 +08:00
%global majorver 2.14.6
%global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||')
%global fullver %{majorver}%{?preminorver}
%global gem_name rspec-mocks
%global rpmgem_name rspec2-mocks
%global need_bootstrap_set 0
2020-09-07 11:21:15 +08:00
Summary: Rspec 2 doubles (mocks and stubs)
Name: rubygem-%{rpmgem_name}
Version: %{majorver}
Release: 2
License: MIT
URL: http://github.com/rspec/rspec-mocks
Source0: https://rubygems.org/gems/%{gem_name}-%{fullver}.gem
BuildRequires: ruby(release) rubygems-devel
2020-08-25 14:51:26 +08:00
%if 0%{?need_bootstrap_set} < 1
2020-09-07 11:21:15 +08:00
BuildRequires: rubygem(rspec2)
2020-08-25 14:51:26 +08:00
%endif
2020-09-07 11:21:15 +08:00
Provides: rubygem(%{rpmgem_name}) = %{version}-%{release}
Obsoletes: rubygem-rspec-mocks < 2.14.6-1
BuildArch: noarch
2020-08-25 14:51:26 +08:00
%description
rspec-mocks provides a test-double framework for Rspec including support
for method stubs, fakes, and message expectations.
%package doc
2020-09-07 11:21:15 +08:00
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
Obsoletes: rubygem-rspec-mocks-doc < %{version}-{release}
2020-08-25 14:51:26 +08:00
%description doc
This package contains documentation for %{name}.
%prep
gem unpack %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version}
gem specification %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%build
gem build %{gem_name}.gemspec
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
rm -f %{buildroot}%{gem_instdir}/{.document,.gitignore,.travis.yml,.yardopts}
2020-09-07 11:21:15 +08:00
%if %{with bootstrap}
2020-08-25 14:51:26 +08:00
%if 0%{?need_bootstrap_set} < 1
2020-09-07 11:22:03 +08:00
2020-08-25 14:51:26 +08:00
%check
pushd .%{gem_instdir}
sed -i.yaml spec/rspec/mocks/serialization_spec.rb \
-e '\@::YAML::ENGINE.yamler@d'
sed -i.toplevel spec/rspec/mocks/mutate_const_spec.rb \
-e '\@expect.TestClass::Hash.@d'
ruby -rrubygems -Ilib/ -S rspec2 spec/
%endif
2020-09-07 11:21:15 +08:00
%endif
2020-08-25 14:51:26 +08:00
%files
%dir %{gem_instdir}
%license %{gem_instdir}/License.txt
%doc %{gem_instdir}/*.md
%{gem_instdir}/lib/
%exclude %{gem_cache}
%{gem_spec}
%files doc
%{gem_docdir}
%{gem_instdir}/features/
%exclude %{gem_instdir}/spec/
%changelog
2020-09-07 11:21:15 +08:00
* Mon Sep 7 2020 liyanan <liyanan32@huawei.com> - 2.14.6-2
- fix build fail
2020-08-25 14:51:26 +08:00
* Wed Aug 19 2020 huangyangke <huangyangke@huawei.com> - %{majorver}-1
- package init