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