]>
Commit | Line | Data |
---|---|---|
74ff2d9a ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # build without tests | |
4 | ||
5 | %define gem_name rest-client | |
6 | Summary: Simple REST client for Ruby | |
7 | Name: ruby-%{gem_name} | |
8 | Version: 1.6.7 | |
63951f65 | 9 | Release: 2 |
74ff2d9a ER |
10 | License: MIT |
11 | Group: Development/Languages | |
12 | Source0: http://gems.rubyforge.org/gems/%{gem_name}-%{version}.gem | |
13 | # Source0-md5: 1f2d6b3b6ceb88e3ee2b327f5e508c22 | |
14 | URL: http://github.com/archiloque/rest-client | |
15 | BuildRequires: rpm-rubyprov | |
16 | BuildRequires: rpmbuild(macros) >= 1.656 | |
6ed29f9e | 17 | BuildRequires: sed >= 4.0 |
74ff2d9a ER |
18 | %if %{with tests} |
19 | BuildRequires: ruby-mime-types >= 1.16 | |
20 | BuildRequires: ruby-netrc | |
21 | BuildRequires: ruby-rspec | |
22 | BuildRequires: ruby-webmock >= 0.9.1 | |
23 | %endif | |
24 | Requires: ruby-mime-types >= 1.16 | |
25 | Requires: ruby-netrc | |
26 | BuildArch: noarch | |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %description | |
30 | A simple Simple HTTP and REST client for Ruby, inspired by the Sinatra | |
31 | microframework style of specifying actions: get, put, post, delete. | |
32 | ||
33 | %prep | |
34 | %setup -q -n %{gem_name}-%{version} | |
6ed29f9e | 35 | %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* |
74ff2d9a ER |
36 | |
37 | %build | |
38 | %if %{with tests} | |
39 | # TODO: According to comment in %%{PATCH0}, at least one test does not passes on | |
40 | # R1.9.3. I gon't go to investigate further ATM. | |
41 | rspec spec | grep -e "188 examples, [34] failures" | |
42 | %endif | |
43 | ||
44 | %install | |
45 | rm -rf $RPM_BUILD_ROOT | |
46 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}} | |
47 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} | |
48 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} | |
49 | ||
50 | %clean | |
51 | rm -rf $RPM_BUILD_ROOT | |
52 | ||
53 | %files | |
54 | %defattr(644,root,root,755) | |
55 | %doc README.rdoc history.md | |
56 | %attr(755,root,root) %{_bindir}/restclient | |
57 | %{ruby_vendorlibdir}/rest-client.rb | |
58 | %{ruby_vendorlibdir}/rest_client.rb | |
59 | %{ruby_vendorlibdir}/restclient.rb | |
60 | %{ruby_vendorlibdir}/restclient |