%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']") %global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) %global gemname term-ansicolor %global geminstdir %{gemdir}/gems/%{gemname}-%{version} Summary: Ruby library that colors strings using ANSI escape sequences Name: rubygem-%{gemname} Version: 1.0.6 Release: 2%{?dist} Group: Development/Languages License: GPLv2 URL: http://term-ansicolor.rubyforge.org Source0: http://gems.rubyforge.org/gems/%{gemname}-%{version}.gem BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: ruby(abi) = 1.8 Requires: rubygems BuildRequires: rubygems BuildArch: noarch Provides: rubygem(%{gemname}) = %{version} %description Small Ruby library that colors strings using ANSI escape sequences. %prep %build %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{gemdir} gem install --local --install-dir $RPM_BUILD_ROOT%{gemdir} \ --force --rdoc %{SOURCE0} # We strip bad shebangs (/usr/bin/env) instead of fixing them # since these files are not executable anyways find $RPM_BUILD_ROOT%{gemdir} \( -name '*.rb' -o -name 'Rakefile' \) \ -exec grep -q '^#!' '{}' \; -print |while read F do awk '/^#!/ {if (FNR == 1) next;} {print}' $F >chopped touch -r $F chopped mv chopped $F done # removing cdiff and decolor due to file conflict with colordiff package rm -rf %{buildroot}%{gemdir}/bin find $RPM_BUILD_ROOT%{geminstdir}/bin -type f |xargs chmod a+x %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %dir %{geminstdir} %doc %{geminstdir}/CHANGES %doc %{geminstdir}/VERSION %doc %{geminstdir}/COPYING %doc %{geminstdir}/examples %doc %{geminstdir}/tests %doc %{geminstdir}/README.rdoc %doc %{geminstdir}/doc-main.txt %doc %{geminstdir}/term-ansicolor.gemspec %doc %{geminstdir}/Gemfile %doc %{geminstdir}/.gitignore %{geminstdir}/Rakefile %{geminstdir}/*.rb %{geminstdir}/lib/ %{geminstdir}/bin/ %doc %{gemdir}/doc/%{gemname}-%{version} %{gemdir}/cache/%{gemname}-%{version}.gem %{gemdir}/specifications/%{gemname}-%{version}.gemspec %changelog * Sat Jul 23 2011 Jan Klepek <jan.klepek at, gmail.com> - 1.0.6-2 - removed cdiff/decolor due to conflict with colordiff package * Sat Jul 23 2011 Jan Klepek <jan.klepek at, gmail.com> - 1.0.6-1 - New version * Mon Mar 07 2011 Michal Fojtik <mfojtik@redhat.com> - 1.0.5-1 - Version bump * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.3-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.3-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Fri Jun 26 2009 Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com> - 1.0.3-3 - Get rid of duplicate files (thanks to Mamoru Tasaka) * Mon Jun 08 2009 Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com> - 1.0.3-2 - Fix up documentation list - Use geminstdir macro where appropriate - Do not move examples around - Depend on ruby(abi) - Replace defines with globals * Fri Jun 05 2009 Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com> - 1.0.3-1 - Package generated by gem2rpm - Strip useless shebangs - Move examples into documentation - Fix up License