rubygem-rack-protection/rubygem-rack-protection.spec
lyn1001 73427708a6 update to 2.0.8.1
(cherry picked from commit 3b2537a4f49562876e1c8c719c11edd4026fc578)
2022-03-23 14:15:05 +08:00

79 lines
2.1 KiB
RPMSpec

%global gem_name rack-protection
%bcond_with bootstrap
Summary: Ruby gem that protects against typical web attacks
Name: rubygem-%{gem_name}
Version: 2.0.8.1
Release: 1
License: MIT
URL: http://github.com/sinatra/sinatra/tree/master/rack-protection
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# git clone https://github.com/sinatra/sinatra.git && cd sinatra/rack-protection
# git archive -v -o rack-protection-2.0.8.1-spec.tar.gz v2.0.8.1 spec/
Source1: %{gem_name}-%{version}-spec.tar.gz
# Fix test failure due to Rack 2.2.2 incompatibility.
# https://github.com/sinatra/sinatra/pull/1605
Patch0: rubygem-rack-protection-2.0.8.1-Fix-failing-tests.patch
BuildRequires: ruby(release) rubygems-devel ruby
%if %{without bootstrap}
BuildRequires: rubygem(rack) rubygem(rspec) rubygem(rack-test)
%endif
BuildArch: noarch
%description
This gem protects against typical web attacks.
Should work for all Rack apps, including Rails.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
%description doc
This package contains documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b 1
pushd %{_builddir}
%patch0 -p2
popd
%build
gem build ../%{gem_name}-%{version}.gemspec
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
%if %{without bootstrap}
%check
pushd .%{gem_instdir}
ln -s %{_builddir}/spec spec
rspec -r 'spec_helper' spec
popd
%endif
%files
%dir %{gem_instdir}
%license %{gem_instdir}/License
%{gem_libdir}
%exclude %{gem_instdir}/rack-protection.gemspec
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile
%changelog
* Thu Feb 24 2022 liyanan <liyanan32@huawei.com> - 2.0.8.1-1
- update to 2.0.8.1
* Wed Feb 10 2021 jeff200902 <gaojianxing@huawei.com> - 2.0.3-2
- fix check failed
* Fri Aug 21 2020 luoshengwei <luoshengwei@huawei.com> - 2.0.3-1
- package init