%global gemname session %global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) %global geminstdir %{gemdir}/gems/%{gemname}-%{version} %global rubyabi 1.8 Summary: Session drives external progams Name: rubygem-%{gemname} Version: 3.1.0 Release: 1%{?dist} Group: Development/Languages License: Ruby URL: http://github.com/ahoward/session/tree/master Source0: http://rubygems.org/gems/%{gemname}-%{version}.gem Requires: ruby(abi) = %{rubyabi} Requires: ruby(rubygems) Requires: ruby Requires: rubygem(fattr) BuildRequires: ruby(abi) = %{rubyabi} BuildRequires: ruby(rubygems) BuildRequires: ruby BuildArch: noarch Provides: rubygem(%{gemname}) = %{version} %description Session offers a set of classes built upon Open3::popen3 for driving external progams via pipes. It offers a significant abstraction over Open3::popen in that the stdout/stderr of each command sent can be deliniated %package doc Summary: Documentation for %{name} Group: Documentation Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Documentation for %{name} %prep %setup -q -c -T mkdir -p .%{gemdir} gem install --local --install-dir .%{gemdir} \ --force %{SOURCE0} # Adjusting permissions chmod 0664 .%{geminstdir}/lib/session.rb %build %install mkdir -p %{buildroot}%{gemdir} cp -a .%{gemdir}/* \ %{buildroot}%{gemdir}/ # Remove the binary extension sources and build leftovers. rm -rf %{buildroot}%{geminstdir}/.yardoc rm %{buildroot}%{geminstdir}/Rakefile rm %{buildroot}%{geminstdir}/gemspec.rb rm %{buildroot}%{geminstdir}/session.gemspec %check cd %{buildroot}%{geminstdir} RUBYOPT="-Ilib -I%{buildroot}%{ruby_sitearch} -Itest" testrb test/session.rb %files %dir %{geminstdir} %{geminstdir}/lib %doc %{geminstdir}/LICENSE %doc %{geminstdir}/README %{gemdir}/cache/%{gemname}-%{version}.gem %{gemdir}/specifications/%{gemname}-%{version}.gemspec %files doc %doc %{gemdir}/doc/%{gemname}-%{version} %doc %{geminstdir}/sample %doc %{geminstdir}/test %changelog * Sun Jan 22 2012 Guillermo Gómez - 3.1.0-1 - Initial package