%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) %global gemname rack-protection %global geminstdir %{gemdir}/gems/%{gemname}-%{version} Summary: Ruby gem that protects against typical web attacks Name: rubygem-%{gemname} Version: 1.2.0 Release: 2%{?dist} Group: Development/Languages License: MIT URL: http://github.com/rkh/rack-protection Source0: http://rubygems.org/downloads/%{gemname}-%{version}.gem Requires: ruby(abi) = 1.8 Requires: rubygems Requires: rubygem(rack) BuildRequires: rubygems BuildRequires: rubygem(rack) BuildRequires: rubygem(rspec-core) BuildRequires: rubygem(rack-test) BuildArch: noarch Provides: rubygem(%{gemname}) = %{version} %description This gem protects against typical web attacks. Should work for all Rack apps, including Rails. %package doc Summary: Documentation for %{name} Group: Documentation Requires: %{name} = %{version}-%{release} Requires: ruby(rubygems) %description doc This package contains documentation for %{name}. %prep %setup -q -c -T %{__mkdir_p} .%{gemdir} gem install --local --install-dir .%{gemdir} \ --force -V %{SOURCE0} rm .%{geminstdir}/%{gemname}.gemspec rm .%{gemdir}/cache/%{gemname}-%{version}.gem %build %check pushd .%{geminstdir} rspec spec popd %install %{__mkdir_p} %{buildroot}%{gemdir} cp -rv .%{gemdir}/* %{buildroot}%{gemdir} %files %dir %{geminstdir} %{geminstdir}/lib %{gemdir}/specifications/%{gemname}-%{version}.gemspec %doc %{geminstdir}/License %files doc %doc %{geminstdir}/README.md %{geminstdir}/Rakefile %{geminstdir}/spec %doc %{gemdir}/doc/%{gemname}-%{version} %changelog * Mon Jan 03 2012 Michal Fojtik - 1.2.0-2 - Fixed BR - Marked documentation file with doc tag - Changed the way how to run rspec tests * Mon Jan 02 2012 Michal Fojtik - 1.2.0-1 - Initial import