## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global gem_name openfact Name: %{gem_name} Version: 5.1.0 Release: %autorelease Summary: Command and Ruby library for gathering system information License: Apache-2.0 URL: https://github.com/OpenVoxProject/openfact Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem BuildRequires: rubygems-devel BuildRequires: ruby >= 2.5 Requires: ruby(release) >= 2.5 Requires: ruby(rubygems) # Add runtime deps for testing # ruby-default-gems in EL 9 doesn't have Provides for the gems BuildRequires: ((rubygem(base64) >= 0.1 with rubygem(base64) < 0.4) or ruby-default-gems < 3.4) BuildRequires: (rubygem(hocon) >= 1.3 with rubygem(hocon) < 2) BuildRequires: (rubygem(thor) >= 1.0.1 with rubygem(thor) < 2) BuildRequires: ((rubygem(logger) >= 1.3 with rubygem(logger) < 2) or ruby-default-gems < 3.4) BuildRequires: rubygem(sys-filesystem) # Binaries that OpenFact can call for complete facts %ifarch %ix86 x86_64 ia64 Requires: dmidecode Requires: pciutils Requires: virt-what %endif Requires: net-tools # Soft dependency for the mountpoints fact Requires: rubygem(sys-filesystem) # OpenFact still uses lib/facter instead of its own namespace Provides: rubygem(facter) = %{version} # Both provide /usr/bin/facter Conflicts: facter Obsoletes: facter < 5 BuildArch: noarch %description Openfact is a lightweight program that gathers basic node information about the hardware and operating system. Openfact is especially useful for retrieving things like operating system names, hardware characteristics, IP addresses, MAC addresses, and SSH keys. Openfact is extensible and allows gathering of node information that may be custom or site specific. It is easy to extend by including your own custom facts. Openfact can also be used to create conditional expressions in Puppet that key off the values returned by facts. It is a community fork of Facter, which is now closed source. %package doc Summary: Documentation for %{name} Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Documentation for %{name}. %prep %setup -q -n %{gem_name}-%{version} %gemspec_add_dep -g sys-filesystem # https://github.com/OpenVoxProject/openfact/pull/36/files#r2404603367 %gemspec_remove_dep -g logger "~> 1.7" %gemspec_add_dep -g logger "~> 1.3" %build gem build ../%{gem_name}-%{version}.gemspec %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}/ rm %{buildroot}%{gem_instdir}/LICENSE mkdir -p %{buildroot}%{_bindir} cp -a .%{gem_instdir}/bin/facter %{buildroot}%{_bindir} rm -rf %{buildroot}/%{gem_instdir}/bin %check # No test suite can run since the spec files are not part of the gem # So try to run the executable and see if that works GEM_HOME="%{buildroot}%{gem_dir}" %{buildroot}%{_bindir}/facter %files %license LICENSE %dir %{gem_instdir} %{_bindir}/facter %{gem_libdir} %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir} %changelog ## START: Generated by rpmautospec * Sun Oct 05 2025 Ewoud Kohl van Wijngaarden - 5.1.0-1 - Initial packaging ## END: Generated by rpmautospec