%global gem_name mustermann %{?_with_bootstrap: %global bootstrap 1} Name: rubygem-%{gem_name} Version: 1.0.2 Release: 1 Summary: Your personal string matching expert License: MIT URL: https://github.com/sinatra/mustermann Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem Source1: https://github.com/sinatra/mustermann/archive/v%{version}.tar.gz BuildRequires: ruby(release) rubygems-devel ruby >= 2.2.0 rubygem(rspec) rubygem(rspec-its) %if ! 0%{?bootstrap} BuildRequires: rubygem(sinatra) %endif BuildRequires: rubygem(rack-test) BuildArch: noarch %description A library implementing patterns that behave like regular expressions. %package doc Summary: Documentation for %{name} Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Documentation for %{name}. %prep gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} -b 1 ln -s %{gem_name}-%{version}/support support ln -s %{gem_name}-%{version}/mustermann-contrib mustermann-contrib gem spec %{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}/ %if ! 0%{?bootstrap} %check sed -i "/^require 'tool\/warning_filter'/ s/^/#/" \ %{_builddir}/support/lib/support/env.rb sed -i "/^require 'support\/coverage'/ s/^/#/" \ %{_builddir}/support/lib/support.rb pushd .%{gem_instdir} mv spec/extension_spec.rb{,.disabled} sed -i "/^require 'mustermann\/extension'/ s/^/#/" \ spec/mustermann_spec.rb sed -i '/^ describe :extend_object do$/,/^ end$/ s/^/#/' \ spec/mustermann_spec.rb sed -i "/^ context 'accepts a block with no arguments, using the return value' do$/,/^ end$/ s/^/#/" \ spec/mapper_spec.rb sed -i "/^ context 'accepts mappings followed by options' do$/,/^ end$/ s/^/#/" \ spec/mapper_spec.rb sed -i "/^ context 'accepts options followed by mappings' do$/,/^ end$/ s/^/#/" \ spec/mapper_spec.rb sed -i "/^ context 'allows specifying type' do$/,/^ end$/ s/^/#/" \ spec/mapper_spec.rb rspec -I%{_builddir}/{support,mustermann-contrib}/lib spec popd %endif %files %dir %{gem_instdir} %license %{gem_instdir}/LICENSE %{gem_libdir} %exclude %{gem_instdir}/mustermann.gemspec %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir} %doc %{gem_instdir}/README.md %{gem_instdir}/bench %{gem_instdir}/spec %changelog * Wed Aug 19 2020 geyanan - 1.0.2-1 - package init