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