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