90 lines
3.2 KiB
RPMSpec
90 lines
3.2 KiB
RPMSpec
|
|
%global gem_name cucumber
|
||
|
|
%{?_with_bootstrap: %global bootstrap 1}
|
||
|
|
Name: rubygem-%{gem_name}
|
||
|
|
Version: 3.1.2
|
||
|
|
Release: 1
|
||
|
|
Summary: Tool to execute plain-text documents as functional tests
|
||
|
|
License: MIT
|
||
|
|
URL: https://cucumber.io/
|
||
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
||
|
|
Source1: https://github.com/%{gem_name}/%{gem_name}-ruby/archive/v%{version}.tar.gz
|
||
|
|
# Fix wire protocol.
|
||
|
|
# https://github.com/cucumber/cucumber-ruby/commit/486e4fe98b93580b63b504579d99c37790f4557d
|
||
|
|
Patch0: rubygem-cucumber-3.1.2-Pass-the-registry-to-the-Wire-plugin.patch
|
||
|
|
Requires: js-jquery < 4
|
||
|
|
BuildRequires: ruby(release) rubygems-devel ruby js-jquery < 4 web-assets-devel
|
||
|
|
%if ! 0%{?bootstrap}
|
||
|
|
BuildRequires: rubygem(aruba)
|
||
|
|
%endif
|
||
|
|
BuildRequires: rubygem(builder) rubygem(bundler) rubygem(cucumber-core)
|
||
|
|
BuildRequires: rubygem(cucumber-expressions) rubygem(cucumber-wire) rubygem(multi_json)
|
||
|
|
BuildRequires: rubygem(multi_test) rubygem(nokogiri) rubygem(rspec)
|
||
|
|
BuildArch: noarch
|
||
|
|
%description
|
||
|
|
Cucumber lets software development teams describe how software should behave
|
||
|
|
in plain text. The text is written in a business-readable domain-specific
|
||
|
|
language and serves as documentation, automated tests and development-aid.
|
||
|
|
|
||
|
|
%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
|
||
|
|
%gemspec_remove_file "lib/cucumber/step_argument.rb"
|
||
|
|
rm %{_builddir}/%{gem_name}-ruby-%{version}/spec/cucumber/step_argument_spec.rb
|
||
|
|
%gemspec_remove_dep -s ../%{gem_name}-%{version}.gemspec -g gherkin '~> 5.1.0'
|
||
|
|
%gemspec_add_dep -s ../%{gem_name}-%{version}.gemspec -g gherkin '>= 4.1.0'
|
||
|
|
|
||
|
|
%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}%{_bindir}
|
||
|
|
cp -pa .%{_bindir}/* \
|
||
|
|
%{buildroot}%{_bindir}/
|
||
|
|
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
|
||
|
|
ln -sf %{_jsdir}/jquery/latest/jquery.min.js %{buildroot}%{gem_libdir}/cucumber/formatter/jquery-min.js
|
||
|
|
|
||
|
|
%check
|
||
|
|
pushd .%{gem_instdir}
|
||
|
|
ln -s %{_builddir}/%{gem_name}-ruby-%{version}/cucumber.yml cucumber.yml
|
||
|
|
ln -s %{_builddir}/%{gem_name}-ruby-%{version}/spec spec
|
||
|
|
sed -i '/require.*pry/ s/^/#/' spec/spec_helper.rb
|
||
|
|
rspec spec
|
||
|
|
%if ! 0%{?bootstrap}
|
||
|
|
ln -s %{_builddir}/%{gem_name}-ruby-%{version}/features features
|
||
|
|
sed -i '/Scenario: Passing feature/i\ @skip' features/docs/raketask.feature
|
||
|
|
sed -i '/Scenario: Ambiguous steps$/i\ @skip' features/docs/defining_steps/ambiguous_steps.feature
|
||
|
|
touch Gemfile
|
||
|
|
RUBYOPT=-Ilib cucumber --tags 'not @skip'
|
||
|
|
%endif
|
||
|
|
popd
|
||
|
|
|
||
|
|
%files
|
||
|
|
%dir %{gem_instdir}
|
||
|
|
%{_bindir}/cucumber
|
||
|
|
%license %{gem_instdir}/LICENSE
|
||
|
|
%{gem_instdir}/bin
|
||
|
|
%{gem_libdir}
|
||
|
|
%exclude %{gem_cache}
|
||
|
|
%{gem_spec}
|
||
|
|
|
||
|
|
%files doc
|
||
|
|
%doc %{gem_docdir}
|
||
|
|
%doc %{gem_instdir}/CONTRIBUTING.md
|
||
|
|
%doc %{gem_instdir}/README.md
|
||
|
|
%doc %{gem_instdir}/CHANGELOG.md
|
||
|
|
|
||
|
|
%changelog
|
||
|
|
* Wed Aug 19 2020 fanjiachen <fanjiachen3@huawei.com> - 3.1.2-1
|
||
|
|
- package init
|