3 %bcond_with 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}/%{pkgname}-%{version}.tar.gz
13 # Source0-md5: 5275e5f79b618ce2af85311cd760b977
14 Patch0: virtualization-vserver.patch
15 Patch1: platform-pld.patch
16 URL: http://docs.getchef.com/ohai.html
17 BuildRequires: rpm-rubyprov
18 BuildRequires: rpmbuild(macros) >= 1.665
19 BuildRequires: ruby-rake
20 BuildRequires: sed >= 4.0
22 BuildRequires: ruby-ffi >= 1.9
23 BuildRequires: ruby-ffi-yajl >= 1.0
24 BuildRequires: ruby-ipaddress
25 BuildRequires: ruby-mixlib-config
26 BuildRequires: ruby-mixlib-log
27 BuildRequires: ruby-mixlib-shellout >= 1.2
28 BuildRequires: ruby-rspec
29 BuildRequires: ruby-systemu >= 2.6.4
32 Requires: ruby-ffi >= 1.9
33 Requires: ruby-ffi-yajl >= 1.0
34 Requires: ruby-ipaddress
35 Requires: ruby-mime-types >= 1.16
36 Requires: ruby-mixlib-cli
37 Requires: ruby-mixlib-config >= 2.0
38 Requires: ruby-mixlib-log
39 Requires: ruby-mixlib-shellout >= 1.2
40 Requires: ruby-systemu >= 2.6.4
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 Ohai detects data about your operating system and prints out a JSON
46 data blob. It can be used standalone, but it's primary purpose is to
47 provide node data to Chef.
50 Summary: Documentation for %{name}
52 Requires: %{name} = %{version}-%{release}
55 This package contains documentation for %{name}.
58 %setup -q -n ohai-%{version}
61 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
63 # no plist and not darwin so don't care
64 rm spec/unit/plugins/darwin/system_profiler_spec.rb
66 # can't figure how to fix -r rubygems does not help
67 # ohai-6.16.0/spec/unit/plugins/ruby_spec.rb:52:in `block in <top (required)>': uninitialized cons tant Gem (NameError)
68 rm spec/unit/plugins/ruby_spec.rb
72 %{__tar} -xmf pkg/ohai-%{version}*.gem
76 # Occasionally fails with "undefined method `rfc2822' for nil:NilClass" during
77 # mock. Unsure why - disable for now.
78 #sed -i 's^Time.should_receive(:now)^^' spec/ohai/plugins/ohai_time_spec.rb
84 rm -rf $RPM_BUILD_ROOT
85 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir},%{_mandir}/man1}
86 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
87 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
88 cp -p docs/man/man1/ohai.1 $RPM_BUILD_ROOT%{_mandir}/man1
89 cp -p %{pkgname}-%{version}*.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
92 rm -rf $RPM_BUILD_ROOT
95 %defattr(644,root,root,755)
96 %doc README.md CHANGELOG.md RELEASE_NOTES.md OHAI_MVPS.md NOTICE
97 %attr(755,root,root) %{_bindir}/ohai
98 %{_mandir}/man1/ohai.1*
99 %{ruby_vendorlibdir}/%{pkgname}.rb
100 %{ruby_vendorlibdir}/%{pkgname}
101 %{ruby_specdir}/%{pkgname}-%{version}*.gemspec