File rubygem-chef.spec of Package rubygem-chef
#
# spec file for package rubygem-chef
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
#
# This file was generated with a gem2rpm.yml and not just plain gem2rpm.
# All sections marked as MANUAL, license headers, summaries and descriptions
# can be maintained in that file. Please consult this file before editing any
# of those fields
#
Name: rubygem-chef
Version: 18.0.185
Release: 0
%define mod_name chef
%define mod_full_name %{mod_name}-%{version}
# MANUAL
BuildRequires: systemd
%{systemd_requires}
Requires(pre): pwdutils
Requires: rubygem(chef) = %{version}
# /MANUAL
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: %{ruby >= 3.0.3}
BuildRequires: %{rubygem gem2rpm}
BuildRequires: ruby-macros >= 5
URL: https://www.chef.io
Source: https://rubygems.org/gems/%{mod_full_name}.gem
Source1: chef.rb
Source2: chef-client.init
Source3: chef-client.service
Source4: chef-15.6.10.gem.sha256
Source5: gem2rpm.yml
Summary: A systems integration framework, built to bring the benefits of
License: Apache-2.0
Group: Development/Languages/Ruby
%description
A systems integration framework, built to bring the benefits of configuration
management to your entire infrastructure.
%prep
%build
%install
%gem_install \
--doc-files="LICENSE README.md" \
-f
# MANUAL
mkdir -p %{buildroot}/etc/chef
mkdir -p %{buildroot}%{_sbindir}
install -m 0640 %{S:1} %{buildroot}/etc/chef/client.rb
mkdir -p %{buildroot}%{_unitdir}
install -m 0640 %{S:3} %{buildroot}%{_unitdir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcchef-client
mkdir -p %{buildroot}%{_localstatedir}/log/chef
mkdir -p %{buildroot}%{_localstatedir}/lib/chef
mkdir -p %{buildroot}%{_localstatedir}/cache/chef
mkdir -p %{buildroot}/run/chef
rm -rf %{buildroot}%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_full_name}/distro
find %{buildroot}%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_full_name}/spec -type f -exec chmod -x {} \;
# /MANUAL
%files
%defattr(-,root,root,-)
%defattr(-,root,root,-)
%config(noreplace) %attr(0640, root, chef) /etc/chef/client.rb
%dir %attr(0750, root, chef) %{_sysconfdir}/chef
%dir %attr(0750, chef, chef) %{_localstatedir}/log/chef
%dir %attr(0750, chef, chef) %{_localstatedir}/lib/chef
%dir %attr(0750, chef, chef) %{_localstatedir}/cache/chef
%ghost %attr(0750, chef, chef) /run/chef
%{_unitdir}/chef-client.service
%{_sbindir}/rcchef-client
%pre
getent group chef >/dev/null || groupadd -r chef
getent passwd chef >/dev/null || useradd -r -g chef -d %{_localstatedir}/lib/chef -s /sbin/nologin -c "Opscode Chef Daemon" chef
%service_add_pre chef-client.service
exit 0
%post
%fillup_only
%service_add_post chef-client.service
%preun
if [ -f /etc/init.d/chef-client ]; then
%stop_on_removal chef-client
fi
%service_del_preun chef-client.service
%postun
%service_del_postun chef-client.service
%gem_packages
%changelog