75 lines
2.2 KiB
RPMSpec
75 lines
2.2 KiB
RPMSpec
|
|
%bcond_with bootstrap
|
||
|
|
%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
|
||
|
|
Summary: Rspec 2 doubles (mocks and stubs)
|
||
|
|
Name: rubygem-%{rpmgem_name}
|
||
|
|
Version: %{majorver}
|
||
|
|
Release: 1
|
||
|
|
License: MIT
|
||
|
|
URL: http://github.com/rspec/rspec-mocks
|
||
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{fullver}.gem
|
||
|
|
BuildRequires: ruby(release) rubygems-devel
|
||
|
|
%if 0%{?need_bootstrap_set} < 1
|
||
|
|
BuildRequires: rubygem(rspec2)
|
||
|
|
%endif
|
||
|
|
Provides: rubygem(%{rpmgem_name}) = %{version}-%{release}
|
||
|
|
Obsoletes: rubygem-rspec-mocks < 2.14.6-1
|
||
|
|
BuildArch: noarch
|
||
|
|
%description
|
||
|
|
rspec-mocks provides a test-double framework for Rspec including support
|
||
|
|
for method stubs, fakes, and message expectations.
|
||
|
|
|
||
|
|
%package doc
|
||
|
|
Summary: Documentation for %{name}
|
||
|
|
Requires: %{name} = %{version}-%{release}
|
||
|
|
Obsoletes: rubygem-rspec-mocks-doc < %{version}-{release}
|
||
|
|
%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}
|
||
|
|
%if 0%{?need_bootstrap_set} < 1
|
||
|
|
|
||
|
|
%if %{with bootstrap}
|
||
|
|
%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
|
||
|
|
|
||
|
|
%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
|
||
|
|
* Wed Aug 19 2020 huangyangke <huangyangke@huawei.com> - %{majorver}-1
|
||
|
|
- package init
|