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