]> git.pld-linux.org Git - packages/ruby-ohai.git/blame_incremental - ruby-ohai.spec
net/dhcp no longer required in ohai code
[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: 8.16.0
11Release: 0.1
12License: Apache v2.0
13Group: Development/Languages
14Source0: https://github.com/opscode/ohai/archive/%{version}/%{pkgname}-%{version}.tar.gz
15# Source0-md5: 7a2182e562bab7dcc48e0b68e07daf92
16Patch1: platform-pld.patch
17URL: http://docs.getchef.com/ohai.html
18BuildRequires: rpm-rubyprov
19BuildRequires: rpmbuild(macros) >= 1.665
20BuildRequires: ruby-rake
21BuildRequires: sed >= 4.0
22# rake gem uses installed ohai version not version we intend to build!
23BuildConflicts: ruby-ohai
24%if %{with tests}
25BuildRequires: ruby-ffi >= 1.9
26BuildRequires: ruby-ffi-yajl >= 1.1
27BuildRequires: ruby-ipaddress
28BuildRequires: ruby-mixlib-config
29BuildRequires: ruby-mixlib-log
30BuildRequires: ruby-mixlib-shellout >= 1.2
31BuildRequires: ruby-rspec
32BuildRequires: ruby-systemu >= 2.6.4
33%endif
34Requires: iproute2
35Requires: lsb-release
36Requires: mount
37Requires: ruby(abi) >= 2.0
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 >= 1.2
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%{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
68
69# don't need shellout 2.0 yet, but 2.0 is ok
70%{__sed} -i -e '/mixlib-shellout/ s/">= 2.0.0.rc.0", "< 3.0"/">= 1.2", "< 3.0"/' %{pkgname}.gemspec
71# optional
72%{__sed} -i -e '/net-dhcp/d' %{pkgname}.gemspec
73# platform specific and optional
74%{__sed} -i -e '/wmi-lite/d' %{pkgname}.gemspec
75%{__sed} -i -e '/plist/d' %{pkgname}.gemspec
76# dev dep
77%{__sed} -i -e '/rake/d' %{pkgname}.gemspec
78
79# no plist and not darwin so don't care
80rm spec/unit/plugins/darwin/system_profiler_spec.rb
81
82# can't figure how to fix -r rubygems does not help
83# ohai-6.16.0/spec/unit/plugins/ruby_spec.rb:52:in `block in <top (required)>': uninitialized constant Gem (NameError)
84rm spec/unit/plugins/ruby_spec.rb
85
86%build
87# make gemspec self-contained
88ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec"))
89 File.open("%{pkgname}-%{version}.gemspec", "w") do |file|
90 file.puts spec.to_ruby_for_cache
91end'
92
93%if %{with tests}
94# Occasionally fails with "undefined method `rfc2822' for nil:NilClass" during
95# mock. Unsure why - disable for now.
96#sed -i 's^Time.should_receive(:now)^^' spec/ohai/plugins/ohai_time_spec.rb
97LC_ALL=en_US.utf8 \
98rake -r rubygems spec
99%endif
100
101%install
102rm -rf $RPM_BUILD_ROOT
103install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir},%{_mandir}/man1}
104cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
105cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
106cp -p docs/man/man1/ohai.1 $RPM_BUILD_ROOT%{_mandir}/man1
107cp -p %{pkgname}-%{version}*.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
108
109%clean
110rm -rf $RPM_BUILD_ROOT
111
112%files
113%defattr(644,root,root,755)
114%doc README.md CHANGELOG.md RELEASE_NOTES.md OHAI_MVPS.md NOTICE
115%attr(755,root,root) %{_bindir}/ohai
116%{_mandir}/man1/ohai.1*
117%{ruby_vendorlibdir}/%{pkgname}.rb
118%{ruby_vendorlibdir}/%{pkgname}
119%{ruby_specdir}/%{pkgname}-%{version}*.gemspec
This page took 0.080331 seconds and 4 git commands to generate.