summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rubygem-oauth.spec29
1 files changed, 28 insertions, 1 deletions
diff --git a/rubygem-oauth.spec b/rubygem-oauth.spec
index 43764b9..62a603a 100644
--- a/rubygem-oauth.spec
+++ b/rubygem-oauth.spec
@@ -1,7 +1,11 @@
# Generated from oauth-0.4.4.gem by gem2rpm -*- rpm-spec -*-
%global gem_name oauth
+%if 0%{?el6}
+%global rubyabi 1.8
+%else
%global rubyabi 1.9.1
+%endif
# Can be enabled if build system has connectivity into internet.
# Unfortunatelly this is not the case of Koji atm.
@@ -10,7 +14,7 @@
Summary: OAuth Core Ruby implementation
Name: rubygem-%{gem_name}
Version: 0.4.4
-Release: 4%{?dist}
+Release: 5%{?dist}
Group: Development/Languages
License: MIT
URL: https://github.com/oauth/oauth-ruby
@@ -19,7 +23,11 @@ Requires: ruby(abi) = %{rubyabi}
Requires: ruby(rubygems)
Requires: ruby
BuildRequires: ruby(abi) = %{rubyabi}
+%if 0%{?fedora}
BuildRequires: rubygems-devel
+%else
+BuildRequires: ruby(rubygems)
+%endif
BuildRequires: ruby
BuildRequires: rubygem(mocha)
BuildRequires: rubygem(typhoeus)
@@ -31,6 +39,16 @@ BuildRequires: rubygem(minitest)
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}
+# macros for RHEL6 compatibility:
+%{!?gem_dir: %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)}
+%{!?gem_instdir: %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version}}
+%{!?gem_libdir: %global gem_libdir %{gem_instdir}/lib}
+%{!?gem_cache: %global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem}
+%{!?gem_spec: %global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec}
+%{!?gem_docdir: %global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version}}
+%{!?gem_extdir: %global gem_extdir %{_libdir}/gems/exts/%{gem_name}-%{version}}
+
+
%description
This is a RubyGem for implementing both OAuth clients and servers
in Ruby applications.
@@ -81,10 +99,16 @@ mv test/test_action_controller_request_proxy.rb test/test_action_controller_requ
%if 0%{?has_network_connectivity} < 1
sed -i '207,+24d' test/test_net_http_client.rb
%endif
+
+%if 0%{?el6}
+ruby -Ilib -e "Dir.glob('./test/**/test_*.rb').each {|t| require t}"
+%else
# one test fails because of lowercase/uppercase d/D
# reported: https://github.com/oauth/oauth-ruby/issues/45
ruby -Ilib -e "Dir.glob('./test/**/test_*.rb').each {|t| require t}" | \
grep "115 tests, 299 assertions, 1 failures, 0 errors, 0 skips"
+%endif
+
popd
%files
@@ -110,6 +134,9 @@ popd
%changelog
+* Wed Feb 06 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.4.4-5
+- RHEL 6 compatibility
+
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild