3 %bcond_without tests # build without tests
6 Summary: Profiles your system and emits JSON
11 Group: Development/Languages
12 Source0: https://github.com/opscode/ohai/archive/%{version}.tar.gz
13 # Source0-md5: 5c00b0ba4c313bedfec62cd5e1525551
14 URL: http://docs.opscode.com/ohai.html
15 BuildRequires: rpm-rubyprov
16 BuildRequires: rpmbuild(macros) >= 1.656
17 BuildRequires: sed >= 4.0
19 BuildRequires: ruby-rake
20 BuildRequires: ruby-rspec
22 Requires: ruby-ipaddress
23 Requires: ruby-mixlib-cli
24 Requires: ruby-mixlib-config
25 Requires: ruby-mixlib-log
26 Requires: ruby-mixlib-shellout
27 Requires: ruby-systemu
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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.
38 Summary: Documentation for %{name}
40 Requires: %{name} = %{version}-%{release}
43 This package contains documentation for %{name}.
46 %setup -q -n ohai-%{version}
47 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
49 # no plist and not darwin so don't care
50 rm spec/unit/plugins/darwin/system_profiler_spec.rb
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
58 # Occasionally fails with "undefined method `rfc2822' for nil:NilClass" during
59 # mock. Unsure why - disable for now.
60 #sed -i 's^Time.should_receive(:now)^^' spec/ohai/plugins/ohai_time_spec.rb
66 rm -rf $RPM_BUILD_ROOT
67 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir},%{_mandir}/man1}
68 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
69 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
70 cp -p docs/man/man1/ohai.1 $RPM_BUILD_ROOT%{_mandir}/man1
73 rm -rf $RPM_BUILD_ROOT
76 %defattr(644,root,root,755)
77 %doc README.rdoc CHANGELOG NOTICE
78 %attr(755,root,root) %{_bindir}/ohai
79 %{_mandir}/man1/ohai.1*
80 %{ruby_vendorlibdir}/ohai.rb
81 %{ruby_vendorlibdir}/ohai