]>
Commit | Line | Data |
---|---|---|
559cb08c ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | ||
be317396 ER |
5 | %define gemname ohai |
6 | Summary: Profiles your system and emits JSON | |
7 | Name: ruby-%{gemname} | |
ebd314a9 | 8 | Version: 6.16.0 |
559cb08c | 9 | Release: 1 |
be317396 ER |
10 | License: Apache v2.0 |
11 | Group: Development/Languages | |
559cb08c ER |
12 | Source0: https://github.com/opscode/ohai/archive/%{version}.tar.gz |
13 | # Source0-md5: 5c00b0ba4c313bedfec62cd5e1525551 | |
0955027e | 14 | URL: http://docs.opscode.com/ohai.html |
be317396 ER |
15 | BuildRequires: rpm-rubyprov |
16 | BuildRequires: rpmbuild(macros) >= 1.656 | |
559cb08c ER |
17 | BuildRequires: sed >= 4.0 |
18 | %if %{with tests} | |
19 | BuildRequires: ruby-rake | |
20 | BuildRequires: ruby-rspec | |
21 | %endif | |
e442943f | 22 | Requires: ruby-ipaddress |
be317396 ER |
23 | Requires: ruby-mixlib-cli |
24 | Requires: ruby-mixlib-config | |
25 | Requires: ruby-mixlib-log | |
ebd314a9 | 26 | Requires: ruby-mixlib-shellout |
be317396 | 27 | Requires: ruby-systemu |
e442943f | 28 | Requires: ruby-yajl |
be317396 ER |
29 | BuildArch: noarch |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | Ohai detects data about your operating system and prints out a JSON | |
34 | data blob. It can be used standalone, but it's primary purpose is to | |
35 | provide node data to Chef. | |
36 | ||
37 | %package doc | |
38 | Summary: Documentation for %{name} | |
39 | Group: Documentation | |
40 | Requires: %{name} = %{version}-%{release} | |
41 | ||
42 | %description doc | |
43 | This package contains documentation for %{name}. | |
44 | ||
45 | %prep | |
559cb08c ER |
46 | %setup -q -n ohai-%{version} |
47 | %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* | |
48 | ||
49 | # no plist and not darwin so don't care | |
50 | rm spec/unit/plugins/darwin/system_profiler_spec.rb | |
51 | ||
52 | # can't figure how ti fix -r rubygems does not help | |
53 | # ohai-6.16.0/spec/unit/plugins/ruby_spec.rb:52:in `block in <top (required)>': uninitialized cons tant Gem (NameError) | |
54 | rm spec/unit/plugins/ruby_spec.rb | |
be317396 ER |
55 | |
56 | %build | |
57 | %if %{with tests} | |
58 | # Occasionally fails with "undefined method `rfc2822' for nil:NilClass" during | |
59 | # mock. Unsure why - disable for now. | |
559cb08c ER |
60 | #sed -i 's^Time.should_receive(:now)^^' spec/ohai/plugins/ohai_time_spec.rb |
61 | LC_ALL=en_US.utf8 \ | |
62 | rake -r rubygems spec | |
be317396 ER |
63 | %endif |
64 | ||
65 | %install | |
66 | rm -rf $RPM_BUILD_ROOT | |
559cb08c | 67 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir},%{_mandir}/man1} |
be317396 ER |
68 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} |
69 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} | |
559cb08c | 70 | cp -p docs/man/man1/ohai.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
be317396 ER |
71 | |
72 | %clean | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %files | |
76 | %defattr(644,root,root,755) | |
559cb08c | 77 | %doc README.rdoc CHANGELOG NOTICE |
be317396 ER |
78 | %attr(755,root,root) %{_bindir}/ohai |
79 | %{_mandir}/man1/ohai.1* | |
80 | %{ruby_vendorlibdir}/ohai.rb | |
81 | %{ruby_vendorlibdir}/ohai |