[packages/ruby-ohai] Up to 19.1.24
arekm
arekm at pld-linux.org
Sat Mar 28 00:15:31 CET 2026
commit 9e046c47e7ef3f1b10a0a818a886958b11b628f6
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Mar 28 00:15:18 2026 +0100
Up to 19.1.24
platform-pld.patch | 20 +++++++++----------
ruby-ohai-shebang.patch | 10 ++++++++++
ruby-ohai.spec | 51 +++++++++----------------------------------------
3 files changed, 29 insertions(+), 52 deletions(-)
---
diff --git a/ruby-ohai.spec b/ruby-ohai.spec
index 41a393b..6d00619 100644
--- a/ruby-ohai.spec
+++ b/ruby-ohai.spec
@@ -7,32 +7,24 @@
%define pkgname ohai
Summary: Profiles your system and emits JSON
Name: ruby-%{pkgname}
-Version: 14.2.4
-Release: 3
+Version: 19.1.24
+Release: 1
License: Apache v2.0
Group: Development/Languages
-Source0: https://github.com/opscode/ohai/archive/v%{version}/%{pkgname}-%{version}.tar.gz
-# Source0-md5: 09fe81cb0b178bad4ad9898c6cc72c57
-Patch1: platform-pld.patch
-URL: https://docs.getchef.com/ohai.html
+Source0: https://github.com/chef/ohai/archive/v%{version}/%{pkgname}-%{version}.tar.gz
+# Source0-md5: 7ec278f51908ef08a2dbff1c81fbbdbc
+Patch0: platform-pld.patch
+Patch1: ruby-ohai-shebang.patch
+URL: https://github.com/chef/ohai
BuildRequires: rpm-rubyprov
BuildRequires: rpmbuild(macros) >= 1.665
-BuildRequires: ruby-rake
-BuildRequires: sed >= 4.0
+BuildRequires: ruby-modules >= 1:1.8
%if %{with tests}
-BuildRequires: ruby-ffi >= 1.9
-BuildRequires: ruby-ffi-yajl >= 1.1
-BuildRequires: ruby-ipaddress
-BuildRequires: ruby-mixlib-config
-BuildRequires: ruby-mixlib-log
-BuildRequires: ruby-mixlib-shellout >= 1.2
BuildRequires: ruby-rspec
-BuildRequires: ruby-systemu >= 2.6.4
%endif
Requires: iproute2
Requires: lsb-release
Requires: mount
-Requires: ruby(abi) >= 2.0
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -51,25 +43,8 @@ This package contains documentation for %{name}.
%prep
%setup -q -n ohai-%{version}
+%patch -P0 -p1
%patch -P1 -p1
-%{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
-
-# don't need shellout 2.0 yet, but 2.0 is ok
-%{__sed} -i -e '/mixlib-shellout/ s/">= 2.0.0.rc.0", "< 3.0"/">= 1.2", "< 3.0"/' %{pkgname}.gemspec
-# optional
-%{__sed} -i -e '/net-dhcp/d' %{pkgname}.gemspec
-# platform specific and optional
-%{__sed} -i -e '/wmi-lite/d' %{pkgname}.gemspec
-%{__sed} -i -e '/plist/d' %{pkgname}.gemspec
-# dev dep
-%{__sed} -i -e '/rake/d' %{pkgname}.gemspec
-
-# no plist and not darwin so don't care
-rm spec/unit/plugins/darwin/system_profiler_spec.rb
-
-# can't figure how to fix -r rubygems does not help
-# ohai-6.16.0/spec/unit/plugins/ruby_spec.rb:52:in `block in <top (required)>': uninitialized constant Gem (NameError)
-rm spec/unit/plugins/ruby_spec.rb
%build
# make gemspec self-contained
@@ -78,14 +53,6 @@ ruby -r rubygems -e 'spec = eval(File.read("%{pkgname}.gemspec"))
file.puts spec.to_ruby_for_cache
end'
-%if %{with tests}
-# Occasionally fails with "undefined method `rfc2822' for nil:NilClass" during
-# mock. Unsure why - disable for now.
-#sed -i 's^Time.should_receive(:now)^^' spec/ohai/plugins/ohai_time_spec.rb
-LC_ALL=en_US.utf8 \
-rake -r rubygems spec
-%endif
-
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir},%{_mandir}/man1}
diff --git a/platform-pld.patch b/platform-pld.patch
index 5032da8..7e649a7 100644
--- a/platform-pld.patch
+++ b/platform-pld.patch
@@ -1,16 +1,16 @@
-somewhy fallback [1] no longer works
-set one in linux/platform
+Add PLD Linux recognition to platform_family detection.
-[1] https://github.com/opscode/ohai/blob/7.4.0/lib/ohai/plugins/platform.rb#L26
+PLD Linux is an independent RPM-based distribution that uses its own
+package set, so it gets its own platform_family.
---- ohai-14.1.7/lib/ohai/plugins/linux/platform.rb~ 2018-05-29 19:14:33.000000000 +0300
-+++ ohai-14.1.7/lib/ohai/plugins/linux/platform.rb 2018-07-16 16:13:58.058756979 +0300
-@@ -147,6 +147,8 @@
- "arch"
- when /exherbo/
+--- ohai-19.1.24/lib/ohai/plugins/linux/platform.rb.orig 2026-03-27 05:37:48.000000000 +0000
++++ ohai-19.1.24/lib/ohai/plugins/linux/platform.rb 2026-03-27 12:00:00.000000000 +0000
+@@ -162,6 +162,8 @@
"exherbo"
-+ when /pld/
-+ "pld"
when /alpine/
"alpine"
++ when /pld/
++ "pld"
when /clearlinux/
+ "clearlinux"
+ when /mangeia/
diff --git a/ruby-ohai-shebang.patch b/ruby-ohai-shebang.patch
new file mode 100644
index 0000000..1ed0744
--- /dev/null
+++ b/ruby-ohai-shebang.patch
@@ -0,0 +1,10 @@
+Fix shebang to use system ruby path.
+
+--- ohai-19.1.24/bin/ohai.orig 2026-03-27 05:37:48.000000000 +0000
++++ ohai-19.1.24/bin/ohai 2026-03-27 12:00:00.000000000 +0000
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/ruby
+ # frozen_string_literal: true
+ #
+ # Author:: Adam Jacob (<adam at chef.io>)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/ruby-ohai.git/commitdiff/9e046c47e7ef3f1b10a0a818a886958b11b628f6
More information about the pld-cvs-commit
mailing list