summaryrefslogtreecommitdiffstats
path: root/rubygem-oauth.spec
blob: 62a603a43e032401767e789ba2e2cb867cc2f9b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# 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.
%global has_network_connectivity 0

Summary: OAuth Core Ruby implementation
Name: rubygem-%{gem_name}
Version: 0.4.4
Release: 5%{?dist}
Group: Development/Languages
License: MIT
URL: https://github.com/oauth/oauth-ruby
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
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)
BuildRequires: rubygem(curb)
BuildRequires: rubygem(actionpack)
BuildRequires: rubygem(minitest)
# Enable when available in Fedora.
# BuildRequires: rubygem(em-http-request)
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.

See the OAuth specs http://oauth.net/core/1.0/

%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 .%{gem_dir}
gem install --local --install-dir .%{gem_dir} \
            --bindir .%{_bindir} \
            --force %{SOURCE0}

%build

%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/

mkdir -p %{buildroot}%{_bindir}
cp -a .%{_bindir}/* \
        %{buildroot}%{_bindir}/

find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x

rm %{buildroot}%{gem_instdir}/.gitignore
chmod a-x %{buildroot}%{gem_instdir}/examples/yql.rb

%check
pushd .%{gem_instdir}
# The following test fails due to Rails 3 incompatibility. Oauth my fail also,
# but it seems that Rails 3 users don't care.
# https://github.com/oauth/oauth-ruby/issues/13
mv test/test_action_controller_request_proxy.rb test/test_action_controller_request_proxy.rb.disabled

# Disable test which needs internet connectivity."
%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
%dir %{gem_instdir}
%doc %{gem_instdir}/LICENSE
%{_bindir}/oauth
%{gem_instdir}/bin
%{gem_libdir}
%{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/HISTORY
%doc %{gem_instdir}/README.rdoc
%doc %{gem_instdir}/TODO
%{gem_instdir}/Gemfile*
%{gem_instdir}/oauth.gemspec
%{gem_instdir}/Rakefile
%doc %{gem_instdir}/examples
%{gem_instdir}/tasks
%{gem_instdir}/test


%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

* Mon Feb 06 2012 Vít Ondruch <vondruch@redhat.com> - 0.4.4-3
- Rebuilt for Ruby 1.9.3.

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Jun 15 2011 Vít Ondruch <vondruch@redhat.com> - 0.4.4-1
- Initial package