[rubygem-term-ansicolor] Rebuilt for Ruby 1.9.3. Introduced %check section for running tests.

Bohuslav Kabrda bkabrda at fedoraproject.org
Tue Jan 24 07:09:16 UTC 2012


commit 292ee19dec28150fd5d3a1e1f71f0a265819828f
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Tue Jan 24 08:09:08 2012 +0100

    Rebuilt for Ruby 1.9.3.
    Introduced %check section for running tests.

 rubygem-term-ansicolor.spec |   78 +++++++++++++++++++++++--------------------
 1 files changed, 42 insertions(+), 36 deletions(-)
---
diff --git a/rubygem-term-ansicolor.spec b/rubygem-term-ansicolor.spec
index e8aa9b4..922ef55 100644
--- a/rubygem-term-ansicolor.spec
+++ b/rubygem-term-ansicolor.spec
@@ -1,22 +1,20 @@
-%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}
+%global gem_name term-ansicolor
 
 Summary:        Ruby library that colors strings using ANSI escape sequences
-Name:           rubygem-%{gemname}
+Name:           rubygem-%{gem_name}
 Version:        1.0.7
-Release:        2%{?dist}
+Release:        3%{?dist}
 Group:          Development/Languages
 License:        GPLv2
 URL:            http://term-ansicolor.rubyforge.org
-Source0:        http://gems.rubyforge.org/gems/%{gemname}-%{version}.gem
+Source0:        http://gems.rubyforge.org/gems/%{gem_name}-%{version}.gem
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires:       ruby(abi) = 1.8
-Requires:       rubygems
-BuildRequires:  rubygems
+Requires:       ruby(abi) = 1.9.1
+Requires:       ruby(rubygems)
+BuildRequires:  rubygems-devel
+BuildRequires:  rubygem(minitest)
 BuildArch:      noarch
-Provides:       rubygem(%{gemname}) = %{version}
+Provides:       rubygem(%{gem_name}) = %{version}
 
 %description
 Small Ruby library that colors strings using ANSI escape sequences.
@@ -30,13 +28,13 @@ Small Ruby library that colors strings using ANSI escape sequences.
 
 %install
 rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT%{gemdir}
-gem install --local --install-dir $RPM_BUILD_ROOT%{gemdir} \
+mkdir -p $RPM_BUILD_ROOT%{gem_dir}
+gem install --local --install-dir $RPM_BUILD_ROOT%{gem_dir} \
         --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' \) \
+find $RPM_BUILD_ROOT%{gem_dir} \( -name '*.rb' -o -name 'Rakefile' \) \
         -exec grep -q '^#!' '{}' \; -print |while read F
 do
         awk '/^#!/ {if (FNR == 1) next;} {print}' $F >chopped
@@ -44,38 +42,46 @@ do
         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
+rm -rf %{buildroot}%{gem_dir}/bin
+find $RPM_BUILD_ROOT%{gem_instdir}/bin -type f |xargs chmod a+x
 
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%check
+pushd %{buildroot}%{gem_instdir}
+testrb -Ilib tests/*
+popd
 
 %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/
-%{geminstdir}/.travis.yml
-%doc %{gemdir}/doc/%{gemname}-%{version}
-%{gemdir}/cache/%{gemname}-%{version}.gem
-%{gemdir}/specifications/%{gemname}-%{version}.gemspec
+%dir %{gem_instdir}
+%doc %{gem_instdir}/CHANGES
+%doc %{gem_instdir}/VERSION
+%doc %{gem_instdir}/COPYING
+%doc %{gem_instdir}/examples
+%doc %{gem_instdir}/tests
+%doc %{gem_instdir}/README.rdoc
+%doc %{gem_instdir}/doc-main.txt
+%doc %{gem_instdir}/term-ansicolor.gemspec
+%doc %{gem_instdir}/Gemfile
+%doc %{gem_instdir}/.gitignore
+%{gem_instdir}/Rakefile
+%{gem_instdir}/*.rb
+%{gem_libdir}/
+%{gem_instdir}/bin/
+%{gem_instdir}/.travis.yml
+%doc %{gem_docdir}
+%{gem_cache}
+%{gem_spec}
 
 
 %changelog
+* Tue Jan 24 2012 Bohuslav Kabrda <bkabrda at redhat.com> - 1.0.7-3
+- Rebuilt for Ruby 1.9.3.
+- Introduced %%check section for running tests.
+
 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0.7-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 
@@ -102,7 +108,7 @@ rm -rf $RPM_BUILD_ROOT
 
 * Mon Jun 08 2009 Lubomir Rintel (Good Data) <lubo.rintel at gooddata.com> - 1.0.3-2
 - Fix up documentation list
-- Use geminstdir macro where appropriate
+- Use gem_instdir macro where appropriate
 - Do not move examples around
 - Depend on ruby(abi)
 - Replace defines with globals


More information about the scm-commits mailing list