119 lines
3.9 KiB
RPMSpec
119 lines
3.9 KiB
RPMSpec
%bcond_with bootstrap
|
|
%global majorver 2.14.8
|
|
%global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||')
|
|
%global fullver %{majorver}%{?preminorver}
|
|
%global gem_name rspec-core
|
|
%global rpmgem_name rspec2-core
|
|
%global need_bootstrap_set 0
|
|
Summary: Rspec 2 runner and formatters
|
|
Name: rubygem-%{rpmgem_name}
|
|
Version: %{majorver}
|
|
Release: 3
|
|
License: MIT
|
|
URL: http://github.com/rspec/rspec-core
|
|
Source0: http://rubygems.org/gems/%{gem_name}-%{fullver}.gem
|
|
# Fix for ruby24
|
|
Patch0: rubygem-rspec-core-2.14.8-ruby24.patch
|
|
# F-26 uses aruba 0.14.x, which uses rspec3 and so incompatible with rspec2.
|
|
# Remove aruba dependency
|
|
Patch1: rubygem-rspec-core-2.14.8-remove-aruba-dependency.patch
|
|
Patch2: Fix-rubygem-expression_parser-test-failure.patch
|
|
Source1: rspec2
|
|
BuildRequires: ruby(release) rubygems-devel
|
|
%if 0%{?need_bootstrap_set} < 1
|
|
BuildRequires: rubygem(ZenTest) rubygem(nokogiri) rubygem(rake) rubygem(rspec2)
|
|
BuildRequires: rubygem(rspec2-expectations) rubygem(aruba)
|
|
%endif
|
|
Requires: rubygem(rake)
|
|
Provides: rubygem(%{rpmgem_name}) = %{version}-%{release}
|
|
Obsoletes: rubygem-rspec-core < 2.14.8-1
|
|
BuildArch: noarch
|
|
%description
|
|
Behaviour Driven Development for Ruby.
|
|
|
|
%package doc
|
|
Summary: Documentation for %{name}
|
|
Requires: %{name} = %{version}-%{release}
|
|
Obsoletes: rubygem-rspec-core-doc < %{version}-%{release}
|
|
%description doc
|
|
This package contains documentation for %{name}.
|
|
|
|
%prep
|
|
gem unpack %{SOURCE0}
|
|
%setup -q -D -T -n %{gem_name}-%{version}
|
|
sed -i \
|
|
-e '\@#!/usr/bin/env@d' \
|
|
lib/rspec/core/mocking/with_flexmock.rb
|
|
sed -i \
|
|
-e 's|SAFE = 3|SAFE = 1|' \
|
|
spec/support/helper_methods.rb
|
|
%patch0 -p1
|
|
%patch1 -p1
|
|
%patch2 -p1
|
|
gem specification %{SOURCE0} -l --ruby > %{gem_name}.gemspec
|
|
|
|
%build
|
|
gem build %{gem_name}.gemspec
|
|
%gem_install
|
|
|
|
%install
|
|
mkdir -p %{buildroot}%{_prefix}
|
|
cp -a .%{_prefix}/* %{buildroot}%{_prefix}/
|
|
mv %{buildroot}%{_bindir}/autospec{,2}
|
|
mv %{buildroot}%{_bindir}/rspec{,2}
|
|
install -cpm 0755 %{SOURCE1} \
|
|
%{buildroot}%{_bindir}/rspec2
|
|
rm -f %{buildroot}%{gem_instdir}/{.document,.gitignore,.treasure_map.rb,.rspec,.travis.yml,spec.txt,.yardopts}
|
|
%if %{with bootstrap}
|
|
%if 0%{?need_bootstrap_set} < 1
|
|
|
|
%check
|
|
LANG=C.UTF-8
|
|
pushd .%{gem_instdir}
|
|
sed -i.bak \
|
|
-e "\@configures streams before command line options@s|do|, :broken => true do|" \
|
|
spec/rspec/core/command_line_spec.rb
|
|
sed -i.bak \
|
|
-e "\@produces HTML identical to the one we designed manually@s|do|, :broken => true do|" \
|
|
spec/rspec/core/formatters/text_mate_formatter_spec.rb
|
|
sed -i.bak \
|
|
-e "\@warns when HOME env var is not set@s|do|, :broken => true do|" \
|
|
spec/rspec/core/configuration_options_spec.rb
|
|
sed -i.bak spec/rspec/core/example_spec.rb \
|
|
-e "\@leaves a raised exception unmodified@s|do|, :broken => true do|"
|
|
sed -i.bak spec/support/mathn_integration_support.rb \
|
|
-e "\@require.*mathn@d"
|
|
sed -i.bak spec/rspec/core/memoized_helpers_spec.rb \
|
|
-e "\@is still a private method@s|do|, :broken => true do|"
|
|
ruby -rrubygems -Ilib/ %{buildroot}%{_bindir}/rspec2 spec || \
|
|
ruby -rrubygems -Ilib/ %{buildroot}%{_bindir}/rspec2 spec --tag ~broken
|
|
popd
|
|
%endif
|
|
%endif
|
|
|
|
%files
|
|
%dir %{gem_instdir}
|
|
%license %{gem_instdir}/License.txt
|
|
%doc %{gem_instdir}/*.md
|
|
%{_bindir}/autospec2
|
|
%{_bindir}/rspec2
|
|
%{gem_instdir}/exe/
|
|
%{gem_instdir}/lib/
|
|
%exclude %{gem_cache}
|
|
%{gem_spec}
|
|
|
|
%files doc
|
|
%{gem_docdir}
|
|
%{gem_instdir}/features/
|
|
%exclude %{gem_instdir}/spec/
|
|
|
|
%changelog
|
|
* Fri Aug 11 2023 yaoxin <yao_xin001@hoperun.com> - 2.14.8-3
|
|
- Fix rubygem-expression_parser test failure caused by ruby upgrade to 3.2.2
|
|
|
|
* Mon Sep 7 2020 liyanan <liyanan32@huawei.com> - 2.14.8-2
|
|
- fix build fail
|
|
|
|
* Mon Aug 24 2020 huangyangke <huangyangke@huawei.com> - 2.14.8-1
|
|
- package init
|