%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
%global gemname warden
%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
Summary: Rack middle-ware that provides authentication for rack applications
Name: rubygem-%{gemname}
Version: 1.0.3
Release: 3%{?dist}
Group: Development/Languages
License: MIT
URL: http://github.com/hassox/%{gemname}
Source0: http://rubygems.org/gems/%{gemname}-%{version}.gem
Requires: ruby(abi) = 1.8
Requires: rubygems
Requires: rubygem(rack)
BuildRequires: rubygems
BuildRequires: rubygem(rack)
BuildRequires: rubygem(rspec)
BuildArch: noarch
Provides: rubygem(%{gemname}) = %{version}
%description
Warden is a Rack-based middle-ware, designed to provide a mechanism for
authentication in Ruby web applications. It is a common mechanism that fits
into the Rack Machinery to offer powerful options for authentication.
%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires:%{name} = %{version}-%{release}
%description doc
Documentation for %{name}
%prep
%build
%install
mkdir -p %{buildroot}%{gemdir}
gem install --local --install-dir %{buildroot}%{gemdir} \
--force --rdoc %{SOURCE0}
sed -i -e "/RSpec/i\
RSpec = Spec::Runner unless defined? RSpec # for RSpec 1 compatability" \
%{buildroot}%{geminstdir}/spec/spec_helper.rb
rm %{buildroot}/%{geminstdir}/.gitignore
%check
pushd %{buildroot}/%{geminstdir}
spec spec/
popd
%files
%defattr(-, root, root, -)
%dir %{geminstdir}
%{geminstdir}/lib
%doc %{geminstdir}/History.rdoc
%doc %{geminstdir}/LICENSE
%doc %{geminstdir}/README.textile
%doc %{geminstdir}/TODO.textile
%{gemdir}/cache/%{gemname}-%{version}.gem
%{gemdir}/specifications/%{gemname}-%{version}.gemspec
%files doc
%defattr(-, root, root, -)
%{geminstdir}/spec
%{geminstdir}/warden.gemspec
%{geminstdir}/Rakefile
%doc %{gemdir}/doc/%{gemname}-%{version}
%changelog
* Mon Dec 20 2010 Vít Ondruch <vondruch@redhat.com> - 1.0.3-3
- Removed RSpec runtime reference
* Mon Dec 20 2010 Vít Ondruch <vondruch@redhat.com> - 1.0.3-2
- Removed obsolete BuildRoot
- Removed explicit library requires
- Removed obsolete build root cleaning
- Removed explicit path to RSpec call
* Wed Dec 15 2010 Vít Ondruch <vondruch@redhat.com> - 1.0.3-1
- Initial package