[rubygem-gem2rpm/f16] Fix template for F17 and above. Fix release enumeration logic.

Vít Ondruch vondruch at fedoraproject.org
Thu Feb 9 12:22:01 UTC 2012


commit 8d1114940910b8293ab1022f0c7d9617a921e44d
Author: Vít Ondruch <vondruch at redhat.com>
Date:   Thu Feb 9 13:20:36 2012 +0100

    Fix template for F17 and above.
    Fix release enumeration logic.

 .gitignore           |    2 +
 rubygem-gem2rpm.spec |   71 +++++++++++++++++++++++++++----------------------
 sources              |    4 +-
 3 files changed, 43 insertions(+), 34 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index ed61a18..ea6d621 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,5 @@ gem2rpm-0.6.0.gem
 /gem2rpm-tests.tgz
 /gem2rpm-0.8.0.gem
 /gem2rpm-0.8.0-tests.tgz
+/gem2rpm-0.8.1-tests.tgz
+/gem2rpm-0.8.1.gem
diff --git a/rubygem-gem2rpm.spec b/rubygem-gem2rpm.spec
index 77f8c3c..ecec732 100644
--- a/rubygem-gem2rpm.spec
+++ b/rubygem-gem2rpm.spec
@@ -1,33 +1,36 @@
 # Generated from gem2rpm-0.5.2.gem by gem2rpm -*- rpm-spec -*-
-%global gemname gem2rpm
+%global gem_name gem2rpm
 
-%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
-%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
-%global gemdocdir %{gemdir}/doc/%{gemname}-%{version}
+%if 0%{fedora} >= 17
+%global rubyabi 1.9.1
+%else
 %global rubyabi 1.8
+%endif
 
 Summary: Generate rpm specfiles from gems
-Name: rubygem-%{gemname}
-Version: 0.8.0
+Name: rubygem-%{gem_name}
+Version: 0.8.1
 Release: 1%{?dist}
 Group: Development/Languages
-License: GPLv2+ or Ruby
+License: GPLv2+
 %if 0%{?rhel} <= 5
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 %endif
 URL: https://github.com/lutter/gem2rpm/
-Source0: http://rubygems.org/gems/%{gemname}-%{version}.gem
-# git clone https://github.com/lutter/gem2rpm.git && cd gem2rpm && git checkout v0.8.0
-# tar czvf gem2rpm-0.8.0-tests.tgz test/
-Source1: %{gemname}-%{version}-tests.tgz
+Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
+# git clone https://github.com/lutter/gem2rpm.git && cd gem2rpm && git checkout v0.8.1
+# tar czvf gem2rpm-0.8.1-tests.tgz test/
+Source1: %{gem_name}-%{version}-tests.tgz
 Requires: ruby(abi) = %{rubyabi}
 Requires: ruby(rubygems)
 Requires: ruby
+Requires: /usr/bin/rpmdev-packager
 BuildRequires: ruby(abi) = %{rubyabi}
-BuildRequires: ruby(rubygems)
+BuildRequires: rubygems-devel
 BuildRequires: ruby
+BuildRequires: /usr/bin/rpmdev-packager
 BuildArch: noarch
-Provides: rubygem(%{gemname}) = %{version}
+Provides: rubygem(%{gem_name}) = %{version}
 
 %description
 Generate source rpms and rpm spec files from a Ruby Gem.  The spec file
@@ -46,8 +49,8 @@ Documentation for %{name}.
 
 %prep
 %setup -q -c -T
-mkdir -p .%{gemdir}
-gem install --local --install-dir .%{gemdir} \
+mkdir -p .%{gem_dir}
+gem install --local --install-dir .%{gem_dir} \
             --bindir .%{_bindir} \
             --force %{SOURCE0}
 
@@ -55,38 +58,42 @@ gem install --local --install-dir .%{gemdir} \
 
 %install
 rm -rf %{buildroot}
-mkdir -p %{buildroot}%{gemdir}
-cp -a .%{gemdir}/* \
-        %{buildroot}%{gemdir}/
+mkdir -p %{buildroot}%{gem_dir}
+cp -a .%{gem_dir}/* \
+        %{buildroot}%{gem_dir}/
 
 mkdir -p %{buildroot}%{_bindir}
 cp -a .%{_bindir}/* \
         %{buildroot}%{_bindir}/
 
-find %{buildroot}%{geminstdir}/bin -type f | xargs chmod a+x
+find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
 
 %check
-tar xzvf %{SOURCE1} -C .%{geminstdir}
-pushd .%{geminstdir}
-RUBYOPT=Itest testrb test/
+tar xzvf %{SOURCE1} -C .%{gem_instdir}
+pushd .%{gem_instdir}
+testrb -Itest test/
 popd
 
 %files
-%dir %{geminstdir}
+%dir %{gem_instdir}
 %{_bindir}/gem2rpm
-%{geminstdir}/bin
-%{geminstdir}/lib
-%{geminstdir}/templates
-%doc %{geminstdir}/LICENSE
-%{gemdir}/cache/%{gemname}-%{version}.gem
-%{gemdir}/specifications/%{gemname}-%{version}.gemspec
+%{gem_instdir}/bin
+%{gem_libdir}
+%{gem_instdir}/templates
+%doc %{gem_instdir}/LICENSE
+%exclude %{gem_cache}
+%{gem_spec}
 
 %files doc
-%doc %{gemdocdir}
-%doc %{geminstdir}/README
-%doc %{geminstdir}/AUTHORS
+%doc %{gem_docdir}
+%doc %{gem_instdir}/README
+%doc %{gem_instdir}/AUTHORS
 
 %changelog
+* Thu Feb 09 2012 Vít Ondruch <vondruch at redhat.com> - 0.8.1-1
+- Fix template for F17 and above.
+- Fix release enumeration logic.
+
 * Mon Jan 23 2012 Vít Ondruch <vondruch at redhat.com> - 0.8.0-1
 - Updated to gem2rpm 0.8.0.
 
diff --git a/sources b/sources
index 7180526..7eb510e 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-db9078078887a606b1c0fca3ad54638c  gem2rpm-0.8.0-tests.tgz
-0fbbffcc6efa671e166a537f973fc24a  gem2rpm-0.8.0.gem
+d7d8bc231dc405bbce00f570c89f530e  gem2rpm-0.8.1-tests.tgz
+d3c9416f225ae944fd195e69e122d46e  gem2rpm-0.8.1.gem


More information about the scm-commits mailing list