]> git.pld-linux.org Git - packages/ruby-ohai.git/blob - ruby-ohai.spec
up to 7.4.0
[packages/ruby-ohai.git] / ruby-ohai.spec
1 #
2 # Conditional build:
3 %bcond_with     tests           # build without tests
4
5 %define pkgname ohai
6 Summary:        Profiles your system and emits JSON
7 Name:           ruby-%{pkgname}
8 Version:        7.4.0
9 Release:        0.1
10 License:        Apache v2.0
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 URL:            http://docs.getchef.com/ohai.html
16 BuildRequires:  rpm-rubyprov
17 BuildRequires:  rpmbuild(macros) >= 1.665
18 BuildRequires:  ruby-rake
19 BuildRequires:  sed >= 4.0
20 %if %{with tests}
21 BuildRequires:  ruby-ffi >= 1.9
22 BuildRequires:  ruby-ffi-yajl >= 1.0
23 BuildRequires:  ruby-ipaddress
24 BuildRequires:  ruby-mixlib-config
25 BuildRequires:  ruby-mixlib-log
26 BuildRequires:  ruby-mixlib-shellout >= 1.2
27 BuildRequires:  ruby-rspec
28 BuildRequires:  ruby-systemu >= 2.6.4
29 %endif
30 Requires:       lsb-release
31 Requires:       ruby-ffi >= 1.9
32 Requires:       ruby-ffi-yajl >= 1.0
33 Requires:       ruby-ipaddress
34 Requires:       ruby-mixlib-cli
35 Requires:       ruby-mixlib-config
36 Requires:       ruby-mixlib-log
37 Requires:       ruby-mixlib-shellout >= 1.2
38 Requires:       ruby-systemu >= 2.6.4
39 BuildArch:      noarch
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 Ohai detects data about your operating system and prints out a JSON
44 data blob. It can be used standalone, but it's primary purpose is to
45 provide node data to Chef.
46
47 %package doc
48 Summary:        Documentation for %{name}
49 Group:          Documentation
50 Requires:       %{name} = %{version}-%{release}
51
52 %description doc
53 This package contains documentation for %{name}.
54
55 %prep
56 %setup -q -n ohai-%{version}
57 %patch0 -p1
58 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
59
60 # no plist and not darwin so don't care
61 rm spec/unit/plugins/darwin/system_profiler_spec.rb
62
63 # can't figure how to fix -r rubygems does not help
64 # ohai-6.16.0/spec/unit/plugins/ruby_spec.rb:52:in `block in <top (required)>': uninitialized cons tant Gem (NameError)
65 rm spec/unit/plugins/ruby_spec.rb
66
67 %build
68 rake gem
69 %{__tar} -xmf pkg/ohai-%{version}*.gem
70 %__gem_helper spec
71
72 %if %{with tests}
73 # Occasionally fails with "undefined method `rfc2822' for nil:NilClass" during
74 # mock. Unsure why - disable for now.
75 #sed -i 's^Time.should_receive(:now)^^' spec/ohai/plugins/ohai_time_spec.rb
76 LC_ALL=en_US.utf8 \
77 rake -r rubygems spec
78 %endif
79
80 %install
81 rm -rf $RPM_BUILD_ROOT
82 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir},%{_mandir}/man1}
83 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
84 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
85 cp -p docs/man/man1/ohai.1 $RPM_BUILD_ROOT%{_mandir}/man1
86 cp -p %{pkgname}-%{version}*.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
87
88 %clean
89 rm -rf $RPM_BUILD_ROOT
90
91 %files
92 %defattr(644,root,root,755)
93 %doc README.md CHANGELOG.md RELEASE_NOTES.md OHAI_MVPS.md NOTICE
94 %attr(755,root,root) %{_bindir}/ohai
95 %{_mandir}/man1/ohai.1*
96 %{ruby_vendorlibdir}/%{pkgname}.rb
97 %{ruby_vendorlibdir}/%{pkgname}
98 %{ruby_specdir}/%{pkgname}-%{version}*.gemspec
This page took 0.063768 seconds and 4 git commands to generate.