]> git.pld-linux.org Git - packages/ruby-ohai.git/blame - ruby-ohai.spec
- release 3 (by relup.sh)
[packages/ruby-ohai.git] / ruby-ohai.spec
CommitLineData
559cb08c 1#
373c014d 2# Release Notes: https://github.com/chef/ohai/blob/master/CHANGELOG.md
c5abc602 3#
559cb08c 4# Conditional build:
3b794a9f 5%bcond_with tests # build without tests
559cb08c 6
6892ed37 7%define pkgname ohai
be317396 8Summary: Profiles your system and emits JSON
6892ed37 9Name: ruby-%{pkgname}
85ad1ec3 10Version: 14.2.4
ae471ff5 11Release: 3
be317396
ER
12License: Apache v2.0
13Group: Development/Languages
b5b87a62 14Source0: https://github.com/opscode/ohai/archive/v%{version}/%{pkgname}-%{version}.tar.gz
85ad1ec3 15# Source0-md5: 09fe81cb0b178bad4ad9898c6cc72c57
6f310904 16Patch1: platform-pld.patch
b5b87a62 17URL: https://docs.getchef.com/ohai.html
be317396 18BuildRequires: rpm-rubyprov
6892ed37
ER
19BuildRequires: rpmbuild(macros) >= 1.665
20BuildRequires: ruby-rake
559cb08c
ER
21BuildRequires: sed >= 4.0
22%if %{with tests}
b9727106 23BuildRequires: ruby-ffi >= 1.9
704947ba 24BuildRequires: ruby-ffi-yajl >= 1.1
6497a7d8
ER
25BuildRequires: ruby-ipaddress
26BuildRequires: ruby-mixlib-config
27BuildRequires: ruby-mixlib-log
86596299 28BuildRequires: ruby-mixlib-shellout >= 1.2
559cb08c 29BuildRequires: ruby-rspec
b9727106 30BuildRequires: ruby-systemu >= 2.6.4
559cb08c 31%endif
b4153370 32Requires: iproute2
c40b9b81 33Requires: lsb-release
956fb169 34Requires: mount
8444e825 35Requires: ruby(abi) >= 2.0
be317396
ER
36BuildArch: noarch
37BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39%description
40Ohai detects data about your operating system and prints out a JSON
41data blob. It can be used standalone, but it's primary purpose is to
42provide node data to Chef.
43
44%package doc
45Summary: Documentation for %{name}
46Group: Documentation
47Requires: %{name} = %{version}-%{release}
48
49%description doc
50This package contains documentation for %{name}.
51
52%prep
559cb08c 53%setup -q -n ohai-%{version}
38a0d445 54%patch1 -p1
559cb08c
ER
55%{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
56
86596299
ER
57# don't need shellout 2.0 yet, but 2.0 is ok
58%{__sed} -i -e '/mixlib-shellout/ s/">= 2.0.0.rc.0", "< 3.0"/">= 1.2", "< 3.0"/' %{pkgname}.gemspec
59# optional
60%{__sed} -i -e '/net-dhcp/d' %{pkgname}.gemspec
61# platform specific and optional
62%{__sed} -i -e '/wmi-lite/d' %{pkgname}.gemspec
e5bdf1ce 63%{__sed} -i -e '/plist/d' %{pkgname}.gemspec
86596299
ER
64# dev dep
65%{__sed} -i -e '/rake/d' %{pkgname}.gemspec
66
559cb08c
ER
67# no plist and not darwin so don't care
68rm spec/unit/plugins/darwin/system_profiler_spec.rb
69
c40b9b81 70# can't figure how to fix -r rubygems does not help
2b26b7f0 71# ohai-6.16.0/spec/unit/plugins/ruby_spec.rb:52:in `block in <top (required)>': uninitialized constant Gem (NameError)
559cb08c 72rm spec/unit/plugins/ruby_spec.rb
be317396
ER
73
74%build
2b26b7f0
ER
75# make gemspec self-contained
76ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec"))
77 File.open("%{pkgname}-%{version}.gemspec", "w") do |file|
78 file.puts spec.to_ruby_for_cache
79end'
6892ed37 80
be317396
ER
81%if %{with tests}
82# Occasionally fails with "undefined method `rfc2822' for nil:NilClass" during
83# mock. Unsure why - disable for now.
559cb08c
ER
84#sed -i 's^Time.should_receive(:now)^^' spec/ohai/plugins/ohai_time_spec.rb
85LC_ALL=en_US.utf8 \
86rake -r rubygems spec
be317396
ER
87%endif
88
89%install
90rm -rf $RPM_BUILD_ROOT
6892ed37 91install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir},%{_mandir}/man1}
be317396
ER
92cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
93cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
3b794a9f 94cp -p %{pkgname}-%{version}*.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
be317396
ER
95
96%clean
97rm -rf $RPM_BUILD_ROOT
98
99%files
100%defattr(644,root,root,755)
b9727106 101%doc README.md CHANGELOG.md RELEASE_NOTES.md OHAI_MVPS.md NOTICE
be317396 102%attr(755,root,root) %{_bindir}/ohai
6892ed37
ER
103%{ruby_vendorlibdir}/%{pkgname}.rb
104%{ruby_vendorlibdir}/%{pkgname}
3b794a9f 105%{ruby_specdir}/%{pkgname}-%{version}*.gemspec
This page took 0.0732930000000001 seconds and 5 git commands to generate.