62 lines
1.6 KiB
RPMSpec
62 lines
1.6 KiB
RPMSpec
|
|
%global gem_name rack-protection
|
||
|
|
%{?_with_bootstrap: %global bootstrap 1}
|
||
|
|
Summary: Ruby gem that protects against typical web attacks
|
||
|
|
Name: rubygem-%{gem_name}
|
||
|
|
Version: 2.0.3
|
||
|
|
Release: 1
|
||
|
|
License: MIT
|
||
|
|
URL: http://github.com/sinatra/sinatra/tree/master/rack-protection
|
||
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
||
|
|
Source1: https://github.com/sinatra/sinatra/archive/v%{version}.tar.gz
|
||
|
|
BuildRequires: ruby(release) rubygems-devel ruby
|
||
|
|
%if ! 0%{?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 -c -T
|
||
|
|
%gem_install -n %{SOURCE0}
|
||
|
|
|
||
|
|
%build
|
||
|
|
%if ! 0%{?bootstrap}
|
||
|
|
|
||
|
|
%check
|
||
|
|
pushd .%{gem_instdir}
|
||
|
|
tar xzvf %{SOURCE1}
|
||
|
|
ln -s sinatra-%{version}/%{gem_name}/spec spec
|
||
|
|
rspec -r 'spec_helper' spec
|
||
|
|
popd
|
||
|
|
%endif
|
||
|
|
|
||
|
|
%install
|
||
|
|
%{__mkdir_p} %{buildroot}%{gem_dir}
|
||
|
|
cp -rv .%{gem_dir}/* %{buildroot}%{gem_dir}
|
||
|
|
|
||
|
|
%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
|
||
|
|
* Fri Aug 21 2020 luoshengwei <luoshengwei@huawei.com> - 2.0.3-1
|
||
|
|
- package init
|