]>
Commit | Line | Data |
---|---|---|
559cb08c | 1 | # |
c5abc602 ER |
2 | # Release Notes: https://github.com/opscode/ohai/blob/master/CHANGELOG.md |
3 | # | |
559cb08c | 4 | # Conditional build: |
3b794a9f | 5 | %bcond_with tests # build without tests |
559cb08c | 6 | |
6892ed37 | 7 | %define pkgname ohai |
be317396 | 8 | Summary: Profiles your system and emits JSON |
6892ed37 | 9 | Name: ruby-%{pkgname} |
704947ba | 10 | Version: 7.6.0 |
e3e3d619 | 11 | Release: 0.3 |
be317396 ER |
12 | License: Apache v2.0 |
13 | Group: Development/Languages | |
2214528e | 14 | Source0: https://github.com/opscode/ohai/archive/%{version}/%{pkgname}-%{version}.tar.gz |
704947ba | 15 | # Source0-md5: b28339ec7f835a2ed4ec0f876178fb14 |
410d4b64 | 16 | Patch0: virtualization-vserver.patch |
6f310904 | 17 | Patch1: platform-pld.patch |
956fb169 | 18 | Patch2: soft-net-dhcp.patch |
b9727106 | 19 | URL: http://docs.getchef.com/ohai.html |
be317396 | 20 | BuildRequires: rpm-rubyprov |
6892ed37 ER |
21 | BuildRequires: rpmbuild(macros) >= 1.665 |
22 | BuildRequires: ruby-rake | |
559cb08c | 23 | BuildRequires: sed >= 4.0 |
e7d4a0b0 ER |
24 | # rake gem uses installed ohai version not version we intend to build! |
25 | BuildConflicts: ruby-ohai | |
559cb08c | 26 | %if %{with tests} |
b9727106 | 27 | BuildRequires: ruby-ffi >= 1.9 |
704947ba | 28 | BuildRequires: ruby-ffi-yajl >= 1.1 |
6497a7d8 ER |
29 | BuildRequires: ruby-ipaddress |
30 | BuildRequires: ruby-mixlib-config | |
31 | BuildRequires: ruby-mixlib-log | |
704947ba | 32 | BuildRequires: ruby-mixlib-shellout >= 2.0.0 |
559cb08c | 33 | BuildRequires: ruby-rspec |
b9727106 | 34 | BuildRequires: ruby-systemu >= 2.6.4 |
559cb08c | 35 | %endif |
b4153370 | 36 | Requires: iproute2 |
c40b9b81 | 37 | Requires: lsb-release |
956fb169 | 38 | Requires: mount |
b9727106 | 39 | Requires: ruby-ffi >= 1.9 |
704947ba | 40 | Requires: ruby-ffi-yajl >= 1.1 |
e442943f | 41 | Requires: ruby-ipaddress |
7223e804 | 42 | Requires: ruby-mime-types >= 1.16 |
be317396 | 43 | Requires: ruby-mixlib-cli |
7223e804 | 44 | Requires: ruby-mixlib-config >= 2.0 |
be317396 | 45 | Requires: ruby-mixlib-log |
704947ba | 46 | Requires: ruby-mixlib-shellout >= 2.0.0 |
b9727106 | 47 | Requires: ruby-systemu >= 2.6.4 |
956fb169 | 48 | Suggests: ruby-net-dhcp |
be317396 ER |
49 | BuildArch: noarch |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
51 | ||
52 | %description | |
53 | Ohai detects data about your operating system and prints out a JSON | |
54 | data blob. It can be used standalone, but it's primary purpose is to | |
55 | provide node data to Chef. | |
56 | ||
57 | %package doc | |
58 | Summary: Documentation for %{name} | |
59 | Group: Documentation | |
60 | Requires: %{name} = %{version}-%{release} | |
61 | ||
62 | %description doc | |
63 | This package contains documentation for %{name}. | |
64 | ||
65 | %prep | |
559cb08c | 66 | %setup -q -n ohai-%{version} |
704947ba | 67 | #%patch0 -p1 |
38a0d445 | 68 | %patch1 -p1 |
956fb169 | 69 | %patch2 -p1 |
559cb08c ER |
70 | %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* |
71 | ||
72 | # no plist and not darwin so don't care | |
73 | rm spec/unit/plugins/darwin/system_profiler_spec.rb | |
74 | ||
c40b9b81 | 75 | # can't figure how to fix -r rubygems does not help |
559cb08c ER |
76 | # ohai-6.16.0/spec/unit/plugins/ruby_spec.rb:52:in `block in <top (required)>': uninitialized cons tant Gem (NameError) |
77 | rm spec/unit/plugins/ruby_spec.rb | |
be317396 ER |
78 | |
79 | %build | |
e7d4a0b0 | 80 | rake -Ilib gem |
3b794a9f | 81 | %{__tar} -xmf pkg/ohai-%{version}*.gem |
6892ed37 ER |
82 | %__gem_helper spec |
83 | ||
be317396 ER |
84 | %if %{with tests} |
85 | # Occasionally fails with "undefined method `rfc2822' for nil:NilClass" during | |
86 | # mock. Unsure why - disable for now. | |
559cb08c ER |
87 | #sed -i 's^Time.should_receive(:now)^^' spec/ohai/plugins/ohai_time_spec.rb |
88 | LC_ALL=en_US.utf8 \ | |
89 | rake -r rubygems spec | |
be317396 ER |
90 | %endif |
91 | ||
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
6892ed37 | 94 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir},%{_mandir}/man1} |
be317396 ER |
95 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} |
96 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} | |
559cb08c | 97 | cp -p docs/man/man1/ohai.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
3b794a9f | 98 | cp -p %{pkgname}-%{version}*.gemspec $RPM_BUILD_ROOT%{ruby_specdir} |
be317396 ER |
99 | |
100 | %clean | |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | ||
103 | %files | |
104 | %defattr(644,root,root,755) | |
b9727106 | 105 | %doc README.md CHANGELOG.md RELEASE_NOTES.md OHAI_MVPS.md NOTICE |
be317396 ER |
106 | %attr(755,root,root) %{_bindir}/ohai |
107 | %{_mandir}/man1/ohai.1* | |
6892ed37 ER |
108 | %{ruby_vendorlibdir}/%{pkgname}.rb |
109 | %{ruby_vendorlibdir}/%{pkgname} | |
3b794a9f | 110 | %{ruby_specdir}/%{pkgname}-%{version}*.gemspec |