Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > a82e3c1d4c59f571050b660c2404281e > files > 3

rubygem-shoulda-2.11.3-1.fc13.src.rpm

%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
%global gemname shoulda
%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
%global railsver %(gem list rails | grep rails | cut -d\\( -f2 | cut -d\\) -f1 | head -1 )

Summary: Making tests easy on the fingers and eyes
Name: rubygem-%{gemname}
Version: 2.11.3
Release: 1%{?dist}
Group: Development/Languages
License: MIT
URL: http://thoughtbot.com/community/
Source0: http://rubygems.org/gems/%{gemname}-%{version}.gem
# The following files are needed for testing, but are not part of the
# distribution. Here's how you obtain these files:
# 
# git clone git://github.com/thoughtbot/shoulda.git
# cd shoulda
# git checkout v2.11.3 # the version 
# cp tasks/shoulda.rake /path/to/SOURCES/rubygem-shoulda-tasks_shoulda.rake
# cp init.rb /path/to/SOURCES/rubygem-shoulda-init.rb
Source1:        rubygem-shoulda-tasks_shoulda.rake
Source2:        rubygem-shoulda-init.rb

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: rubygems
Requires: ruby(abi) = 1.8
BuildRequires: rubygems
BuildRequires: dos2unix
BuildRequires(check): rubygem(cucumber)
BuildRequires(check): rubygem(rake)
BuildRequires(check): rubygem(rails) < 3 
BuildRequires(check): rubygem(sqlite3-ruby)
BuildRequires(check): rubygem(mocha)
BuildArch: noarch
Provides: rubygem(%{gemname}) = %{version}

%description
Making tests easy on the fingers and eyes

%package doc
Summary:           Documentation for %{name}
Group:             Documentation
Requires:          %{name} = %{version}-%{release}

%description doc
Documentation for %{name}.



%prep

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{gemdir}
gem install --local --install-dir %{buildroot}%{gemdir} \
            --force --rdoc %{SOURCE0}
mkdir -p %{buildroot}/%{_bindir}
mv %{buildroot}%{gemdir}/bin/* %{buildroot}/%{_bindir}
rmdir %{buildroot}%{gemdir}/bin
find %{buildroot}%{geminstdir}/bin -type f | xargs chmod a+x

# Notified upstream of lack of ability to run tests after running gem install 
#  on Sep 03, 2010.  Not holding my breath.

# This task is not part of the distribution but is required for rake test in %%check
mkdir -p %{buildroot}%{geminstdir}/tasks
cp -a -p %{SOURCE1} %{buildroot}%{geminstdir}/tasks/%{gemname}.rake
# This is also not part of dist gem, but needed for tests
cp -a -p %{SOURCE2} %{buildroot}%{geminstdir}/init.rb
# This is also not part of dist gem, but needed for tests
cp -a -p %{buildroot}/%{gemdir}/specifications/* %{buildroot}%{geminstdir}/shoulda.gemspec

# environment.rb set to use a static Rails version -- it's not pretty, but it works
echo 'RAILS_GEM_VERSION="%{railsver}" '  >  %{buildroot}%{geminstdir}/test/rails2_root/config/environment.tmp.rb
cat %{buildroot}%{geminstdir}/test/rails2_root/config/environment.rb >> %{buildroot}%{geminstdir}/test/rails2_root/config/environment.tmp.rb
mv -f  %{buildroot}%{geminstdir}/test/rails2_root/config/environment.tmp.rb %{buildroot}%{geminstdir}/test/rails2_root/config/environment.rb

# Fix end-of-line encoding
dos2unix %{buildroot}/%{geminstdir}/MIT-LICENSE



%clean
rm -rf %{buildroot}

%check 
cd %{buildroot}%{geminstdir}
rake test

%files
%defattr(-, root, root, -)
%{_bindir}/convert_to_should_syntax
%dir %{geminstdir}
%doc %{geminstdir}/README.rdoc
%doc %{geminstdir}/MIT-LICENSE
%{gemdir}/cache/%{gemname}-%{version}.gem
%{gemdir}/specifications/%{gemname}-%{version}.gemspec
%{geminstdir}/lib
%{geminstdir}/bin
%{geminstdir}/rails

%files doc
%defattr(-, root, root, -)
%{geminstdir}/tasks
%{geminstdir}/init.rb
%{geminstdir}/*.gemspec
%{gemdir}/doc/%{gemname}-%{version}
%{geminstdir}/CONTRIBUTION_GUIDELINES.rdoc
%{geminstdir}/test
%{geminstdir}/Rakefile



%changelog
* Wed Sep 01 2010 Michael Stahnke <stahnma@fedoraproject.org> - 2.11.3-1
- New version
- Fix many broken tests 
- Split into -doc package

* Sat Jan  9 2010 Jeroen van Meeuwen <j.van.meeuwen@ogd.nl> - 2.10.2-2
- Fix BuildRequires
- First package