From 4ecda1c3d8af205f2693b88f1c2e4ee9542fcb99 Mon Sep 17 00:00:00 2001 From: Breno Brand Fernandes Date: Thu, 1 Jul 2021 09:27:07 -0400 Subject: [PATCH] Puppet 7.7 build -- ruby 3 --- 0001-Fix-puppet-paths.patch | 58 --- ...rt-maint-Remove-puppetmaster.service.patch | 46 -- ...lease-restrictions-from-DNF-provider.patch | 24 - RPM-GPG-KEY-puppet-20250406 | 31 ++ puppet-5.5.18-ruby-27.patch | 17 - puppet-5.5.18-sync.patch | 20 - puppet.spec | 492 ++++++------------ sources | 14 +- 8 files changed, 192 insertions(+), 510 deletions(-) delete mode 100644 0001-Fix-puppet-paths.patch delete mode 100644 0002-Revert-maint-Remove-puppetmaster.service.patch delete mode 100644 0003-Remove-Fedora-release-restrictions-from-DNF-provider.patch create mode 100644 RPM-GPG-KEY-puppet-20250406 delete mode 100644 puppet-5.5.18-ruby-27.patch delete mode 100644 puppet-5.5.18-sync.patch diff --git a/0001-Fix-puppet-paths.patch b/0001-Fix-puppet-paths.patch deleted file mode 100644 index 6034a89..0000000 --- a/0001-Fix-puppet-paths.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 88c57975f8b3832688b00afc4f41b6dd87153ec2 Mon Sep 17 00:00:00 2001 -From: Lucien Weller -Date: Wed, 11 Sep 2019 23:30:38 +0200 -Subject: [PATCH 1/5] Fix-puppet-paths - ---- - lib/puppet/provider/package/puppet_gem.rb | 2 +- - lib/puppet/util/run_mode.rb | 10 +++++----- - 2 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/lib/puppet/provider/package/puppet_gem.rb b/lib/puppet/provider/package/puppet_gem.rb -index 8d876a0..86752b7 100644 ---- a/lib/puppet/provider/package/puppet_gem.rb -+++ b/lib/puppet/provider/package/puppet_gem.rb -@@ -12,6 +12,6 @@ Puppet::Type.type(:package).provide :puppet_gem, :parent => :gem do - # sort out the absolute path. - commands :gemcmd => "gem" - else -- commands :gemcmd => "/opt/puppetlabs/puppet/bin/gem" -+ commands :gemcmd => "/usr/bin/gem" - end - end -diff --git a/lib/puppet/util/run_mode.rb b/lib/puppet/util/run_mode.rb -index cf6c461..777156a 100644 ---- a/lib/puppet/util/run_mode.rb -+++ b/lib/puppet/util/run_mode.rb -@@ -59,23 +59,23 @@ module Puppet - - class UnixRunMode < RunMode - def conf_dir -- which_dir("/etc/puppetlabs/puppet", "~/.puppetlabs/etc/puppet") -+ which_dir("/etc/puppet", "~/.puppet") - end - - def code_dir -- which_dir("/etc/puppetlabs/code", "~/.puppetlabs/etc/code") -+ which_dir("/etc/puppet", "~/.puppet/code") - end - - def var_dir -- which_dir("/opt/puppetlabs/puppet/cache", "~/.puppetlabs/opt/puppet/cache") -+ which_dir("/var/lib/puppet", "~/.puppet/cache") - end - - def run_dir -- which_dir("/var/run/puppetlabs", "~/.puppetlabs/var/run") -+ which_dir("/run/puppet", "~/.puppet/var/run") - end - - def log_dir -- which_dir("/var/log/puppetlabs/puppet", "~/.puppetlabs/var/log") -+ which_dir("/var/log/puppet", "~/.puppet/var/log") - end - end - --- -2.20.1 - diff --git a/0002-Revert-maint-Remove-puppetmaster.service.patch b/0002-Revert-maint-Remove-puppetmaster.service.patch deleted file mode 100644 index 365e21f..0000000 --- a/0002-Revert-maint-Remove-puppetmaster.service.patch +++ /dev/null @@ -1,46 +0,0 @@ -From f54a22b96e9e631991bad095a7b321273a2e6e3f Mon Sep 17 00:00:00 2001 -From: Gael Chamoulaud -Date: Wed, 29 Jul 2015 21:58:48 +0200 -Subject: [PATCH 2/5] Revert "(maint) Remove puppetmaster.service" - -This reverts commit c0e30daa53b6267c1c86b6e27c01b1c26cf49af5. ---- - ext/systemd/puppet.service | 2 +- - ext/systemd/puppetmaster.service | 12 ++++++++++++ - 2 files changed, 13 insertions(+), 1 deletion(-) - create mode 100644 ext/systemd/puppetmaster.service - -diff --git a/ext/systemd/puppet.service b/ext/systemd/puppet.service -index 7c16615..36769ac 100644 ---- a/ext/systemd/puppet.service -+++ b/ext/systemd/puppet.service -@@ -11,7 +11,7 @@ - [Unit] - Description=Puppet agent - Wants=basic.target --After=basic.target network.target -+After=basic.target network.target puppetmaster.service - - [Service] - EnvironmentFile=-/etc/sysconfig/puppetagent -diff --git a/ext/systemd/puppetmaster.service b/ext/systemd/puppetmaster.service -new file mode 100644 -index 0000000..dbbd627 ---- /dev/null -+++ b/ext/systemd/puppetmaster.service -@@ -0,0 +1,12 @@ -+[Unit] -+Description=Puppet master -+Wants=basic.target -+After=basic.target network.target -+ -+[Service] -+EnvironmentFile=-/etc/sysconfig/puppetmaster -+EnvironmentFile=-/etc/default/puppetmaster -+ExecStart=/usr/bin/puppet master $PUPPETMASTER_EXTRA_OPTS --no-daemonize -+ -+[Install] -+WantedBy=multi-user.target --- -2.19.2 - diff --git a/0003-Remove-Fedora-release-restrictions-from-DNF-provider.patch b/0003-Remove-Fedora-release-restrictions-from-DNF-provider.patch deleted file mode 100644 index eba3cc8..0000000 --- a/0003-Remove-Fedora-release-restrictions-from-DNF-provider.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 5688991cd78f7c38a1edf28f76e9b7825a7d415a Mon Sep 17 00:00:00 2001 -From: Dominic Cleal -Date: Wed, 31 May 2017 10:07:04 +0100 -Subject: [PATCH 3/5] Remove Fedora release restrictions from DNF provider - -Ensure DNF provider will be used on all versions of Fedora, without new -ones being excluded. ---- - lib/puppet/provider/package/dnf.rb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/puppet/provider/package/dnf.rb b/lib/puppet/provider/package/dnf.rb -index 0bf5847..be55568 100644 ---- a/lib/puppet/provider/package/dnf.rb -+++ b/lib/puppet/provider/package/dnf.rb -@@ -28,7 +28,7 @@ Puppet::Type.type(:package).provide :dnf, :parent => :yum do - end - end - -- defaultfor :operatingsystem => :fedora, :operatingsystemmajrelease => (22..30).to_a -+ defaultfor :operatingsystem => :fedora - defaultfor :osfamily => :redhat, :operatingsystemmajrelease => ["8"] - - def self.update_command diff --git a/RPM-GPG-KEY-puppet-20250406 b/RPM-GPG-KEY-puppet-20250406 new file mode 100644 index 0000000..333b379 --- /dev/null +++ b/RPM-GPG-KEY-puppet-20250406 @@ -0,0 +1,31 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBFyrv4oBEADhL8iyDPZ+GWN7L+A8dpEpggglxTtL7qYNyN5Uga2j0cusDdOD +ftPHsurLjfxtc2EFGdFK/N8y4LSpq+nOeazhkHcPeDiWC2AuN7+NGjH9LtvMUqKy +NWPhPYP2r/xPL547oDMdvLXDH5n+FsLFW8QgATHk4AvlIhGng0gWu80OqTCiL0HC +W7TftkF8ofP8k90SnLYbI9HDVOj6VYYtqG5NeoCHGAqrb79G/jq64Z/gLktD3IrB +CxYhKFfJtZ/BSDB8Aa4ht+jIyeFCNSbGyfFfWlHKvF3JngS/76Y7gxX1sbR3gHJQ +hO25AQdsPYKxgtIgNeB9/oBp1+V3K1W/nta4gbDVwJWCqDRbEFlHIdV7fvV/sqiI +W7rQ60aAY7J6Gjt/aUmNArvT8ty3szmhR0wEEU5/hhIVV6VjS+AQsI8pFv6VB8bJ +TLfOBPDW7dw2PgyWhVTEN8KW/ckyBvGmSdzSgAhw+rAe7li50/9e2H8eiJgBbGid +8EQidZgkokh331CMDkIA6F3ygiB+u2ZZ7ywxhxIRO70JElIuIOiofhVfRnh/ODlH +X7eD+cA2rlLQd2yWf4diiA7C9R8r8vPrAdp3aPZ4xLxvYYZV8E1JBdMus5GRy4rB +Avetp0Wx/1r9zVDKD/J1bNIlt0SR9FTmynZj4kLWhoCqmbrLS35325sS6wARAQAB +tEhQdXBwZXQsIEluYy4gUmVsZWFzZSBLZXkgKFB1cHBldCwgSW5jLiBSZWxlYXNl +IEtleSkgPHJlbGVhc2VAcHVwcGV0LmNvbT6JAlQEEwEKAD4WIQTWgR7Tre64RBr1 +qo9FKLbNnmHvJgUCXKu/igIbAwUJC0c1AAULCQgHAwUVCgkICwUWAgMBAAIeAQIX +gAAKCRBFKLbNnmHvJg/vD/0eOl/pBb6ooGnzg2qoD+XwgOK3HkTdvGNZKGsIrhUG +q6O0zoyPW8v9b/i7QEDre8QahARmMAEQ+T3nbNVzw4kpE+YIrEkKjoJsrF8/K/1L +zBHJCc3S9oF9KubG5BuQ4bAmcvnI+qpEYbSTLHztYGUfXAGu+MnaDf4C60G7zM6m +ec4bX8lVnt+gcsGGGCdN89XsZLBNdv21z9xMeaAPiRYJpbqwrb8cYbKQeqFSQt2M +UylN5oVeN77Q8iyXSyVwpc6uKzXdQ8bVPbKUTWSXQ4SSp0HJjtAMiDH2pjty4PG6 +EgZ6/njJLOzQ29ZgFrS19XLONlptHwKzLYB8nJhJvGHfzzInmNttDtNwTA6IxpsR +4aCnrPWFJRCbmMBNXvBR9B/O+e/T5ngL21ipMEwzEOiQlRSacnO2pICwZ5pARMRI +dxq/5BQYry9HNlJDGR7YIfn7i0oCGk5BxwotSlAPw8jFpNU/zTOvpQAdPvZje2JP +6GS+hYxSdHsigREXI2gxTvpcLk8LOe9PsqJv631e6Kvn9P9OHiihIp8G9fRQ8T7y +elHcNanV192mfbWxJhDAcQ+JEy9883lOanaCoaf/7z4kdmCQLz5/oNg2K0qjSgZH +JY/gxCOwuAuUJlLcAXQG6txJshfMxyQUO46DXg0/gjwkKgT/9PbTJEN/WN/G6n1h +lQ== +=nKF2 +-----END PGP PUBLIC KEY BLOCK----- + diff --git a/puppet-5.5.18-ruby-27.patch b/puppet-5.5.18-ruby-27.patch deleted file mode 100644 index 9b97f02..0000000 --- a/puppet-5.5.18-ruby-27.patch +++ /dev/null @@ -1,17 +0,0 @@ -Description: Fix Ruby 2.7 warning - The '**' operater should be used to pass keyword arguments from now on. -Author: Lucas Kanashiro -Last-Updated: 26-03-2020 -Forwarded: yes, https://github.com/puppetlabs/puppet/pull/8060 - ---- a/lib/puppet/file_system/file_impl.rb -+++ b/lib/puppet/file_system/file_impl.rb -@@ -77,7 +77,7 @@ - end - - def read(path, opts = {}) -- path.read(opts) -+ path.read(**opts) - end - - def read_preserve_line_endings(path) diff --git a/puppet-5.5.18-sync.patch b/puppet-5.5.18-sync.patch deleted file mode 100644 index 6f38a7e..0000000 --- a/puppet-5.5.18-sync.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb -index 2ccddbe..4c6e33d 100644 ---- a/lib/puppet/configurer.rb -+++ b/lib/puppet/configurer.rb -@@ -1,5 +1,4 @@ - # The client for interacting with the puppetmaster config server. --require 'sync' - require 'timeout' - require 'puppet/network/http_pool' - require 'puppet/util' -diff --git a/lib/puppet/util/storage.rb b/lib/puppet/util/storage.rb -index 713f650..b9183ca 100644 ---- a/lib/puppet/util/storage.rb -+++ b/lib/puppet/util/storage.rb -@@ -1,5 +1,4 @@ - require 'yaml' --require 'sync' - require 'singleton' - require 'puppet/util/yaml' - diff --git a/puppet.spec b/puppet.spec index 1073d92..9a0ba0a 100644 --- a/puppet.spec +++ b/puppet.spec @@ -1,72 +1,56 @@ -# Augeas and SELinux requirements may be disabled at build time by passing -# --without augeas and/or --without selinux to rpmbuild or mock - -# Specifically not using systemd on F18 as it's technically a break between -# using SystemV on 2.7.x and Systemd on 3.1.0. -%if 0%{?fedora} || 0%{?rhel} >= 7 -%global puppet_libdir %{ruby_vendorlibdir} -%else -%global puppet_libdir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["sitelibdir"]') -%endif - -%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} -%global _with_systemd 1 -%endif - -# FIXME(hguemar): RH products builds of facter and hiera have introduced epochs -# does not impact Fedora nor EPEL -%if 0%{?rhel} && 0%{?rhel} >= 7 && !0%{?epel} -%global has_epoch 1 -%endif - -%global confdir conf -%global pending_upgrade_path %{_localstatedir}/lib/rpm-state/puppet -%global pending_upgrade_file %{pending_upgrade_path}/upgrade_pending - -%if 0%{?fedora} > 30 || 0%{?rhel} >= 8 %global nm_dispatcher_dir %{_prefix}/lib/NetworkManager -%else -%global nm_dispatcher_dir %{_sysconfdir}/NetworkManager -%endif +%global puppet_libdir %{ruby_vendorlibdir} Name: puppet -Version: 5.5.20 -Release: 4%{?dist} -Summary: A network tool for managing many disparate systems +Version: 7.7.0 +Release: 1%{?dist} +Summary: Network tool for managing many disparate systems License: ASL 2.0 -URL: http://puppetlabs.com -Source0: http://downloads.puppetlabs.com/%{name}/%{name}-%{version}.tar.gz -Source1: http://downloads.puppetlabs.com/%{name}/%{name}-%{version}.tar.gz.asc -Source2: puppet-nm-dispatcher -Source3: puppet-nm-dispatcher.systemd -Source4: start-puppet-wrapper +URL: https://puppetlabs.com +Source0: https://downloads.puppetlabs.com/puppet/%{name}-%{version}.tar.gz +Source1: https://downloads.puppetlabs.com/puppet/%{name}-%{version}.tar.gz.asc +Source2: RPM-GPG-KEY-puppet-20250406 +Source3: https://forge.puppet.com/v3/files/puppetlabs-mount_core-1.0.4.tar.gz +Source4: https://forge.puppet.com/v3/files/puppetlabs-host_core-1.0.3.tar.gz +Source5: https://forge.puppet.com/v3/files/puppetlabs-augeas_core-1.1.1.tar.gz +Source6: https://forge.puppet.com/v3/files/puppetlabs-cron_core-1.0.4.tar.gz +Source7: https://forge.puppet.com/v3/files/puppetlabs-scheduled_task-2.2.1.tar.gz +Source8: https://forge.puppet.com/v3/files/puppetlabs-selinux_core-1.0.4.tar.gz +Source9: https://forge.puppet.com/v3/files/puppetlabs-sshkeys_core-2.2.0.tar.gz +Source10: https://forge.puppet.com/v3/files/puppetlabs-yumrepo_core-1.0.7.tar.gz +Source11: https://forge.puppet.com/v3/files/puppetlabs-zfs_core-1.1.0.tar.gz +Source12: https://forge.puppet.com/v3/files/puppetlabs-zone_core-1.0.3.tar.gz +Source13: puppet-nm-dispatcher.systemd +Source14: start-puppet-wrapper + +BuildArch: noarch -# Puppetlabs messed up with default paths -Patch01: 0001-Fix-puppet-paths.patch -Patch02: 0002-Revert-maint-Remove-puppetmaster.service.patch -Patch03: 0003-Remove-Fedora-release-restrictions-from-DNF-provider.patch -# https://tickets.puppetlabs.com/browse/PUP-10247 -Patch04: puppet-5.5.18-sync.patch -# https://github.com/puppetlabs/puppet/pull/8060 -Patch05: puppet-5.5.18-ruby-27.patch - -BuildArch: noarch -BuildRequires: git -BuildRequires: ruby-devel >= 1.8.7 # ruby-devel does not require the base package, but requires -libs instead -BuildRequires: ruby >= 1.8.7 - -Requires: puppet-headless = %{version}-%{release} - -%if 0%{?_with_systemd} -%{?systemd_requires} +BuildRequires: ruby +BuildRequires: ruby-devel +BuildRequires: rubygem-json +BuildRequires: facter +BuildRequires: hiera BuildRequires: systemd -%else -Requires(post): chkconfig -Requires(preun): chkconfig -Requires(preun): initscripts -Requires(postun): initscripts -%endif +BuildRequires: gnupg2 +Requires: hiera >= 3.3.1 +Requires: facter >= 3.9.6 +Requires: ruby-facter >= 3.9.6 +Requires: rubygem-semantic_puppet >= 1.0.2 +Requires: rubygem-puppet-resource_api +Requires: rubygem-deep_merge +Requires: rubygem-httpclient +Requires: rubygem-multi_json +Requires: rubygem-json +Requires: ruby-augeas >= 0.5.0 +Requires: augeas >= 1.10.1 +Requires: augeas-libs >= 1.10.1 +Requires: cpp-hocon >= 0.2.1 +Requires: rubygem-concurrent-ruby >= 1.0.5 +Requires: ruby(selinux) libselinux-utils +Obsoletes: puppet-headless < 6.0.0 +Obsoletes: puppet-server < 6.0.0 +Obsoletes: puppet < 6.0.0 %description Puppet lets you centrally manage every important aspect of your system using a @@ -74,322 +58,144 @@ cross-platform specification language that manages all the separate elements normally aggregated in different files, like users, cron jobs, and hosts, along with obviously discrete elements like packages, services, and files. -%package server -Summary: Server for the puppet system management tool -Requires: puppet = %{version}-%{release} -Requires: puppet-headless = %{version}-%{release} -%if 0%{?_with_systemd} -%{?systemd_requires} -BuildRequires: systemd -%else -Requires(post): chkconfig -Requires(preun): chkconfig -Requires(preun): initscripts -Requires(postun): initscripts -%endif - -%description server -Provides the central puppet server daemon which provides manifests to clients. -The server can also function as a certificate authority and file server. - -%package headless -Summary: Headless Puppet -Conflicts: puppet < 5.5.6-6 -%if 0%{?rhel} && 0%{?rhel} <= 6 -Requires: ruby(abi) = 1.8 -%else -Requires: ruby(release) -%endif -Requires: ruby(shadow) -Requires: rubygem(json) -Requires: rubygem(pathspec) -Requires: rubygem(rgen) -Requires: rubygem(multi_json) -# Prevents jruby from being pulled in by dependencies (BZ #985208) -Requires: ruby -# Pull in ruby selinux bindings where available -%{!?_without_selinux:Requires: ruby(selinux), libselinux-utils} - -# Fedora 28 updates to facter3 where puppet needs to require the ruby bindings specifically -%if 0%{?fedora} || 0%{?rhel} >= 8 -BuildRequires: ruby-facter >= 3.0 -BuildRequires: ruby-facter < 4 -Requires: ruby-facter >= 3.0 -Requires: ruby-facter < 4 -%else -BuildRequires: facter >= %{?has_epoch:1:}2.0 -BuildRequires: facter < %{?has_epoch:1:}4 -Requires: facter >= %{?has_epoch:1:}2.0 -Requires: facter < %{?has_epoch:1:}4 -%endif -BuildRequires: hiera >= 2.0 -BuildRequires: hiera < %{?has_epoch:1:}4 -Requires: hiera >= 2.0 -Requires: hiera < %{?has_epoch:1:}4 -Obsoletes: hiera-puppet < 1.0.0-2 -Provides: hiera-puppet = %{version}-%{release} - -%{!?_without_augeas:Requires: ruby(augeas)} -Requires: tar -Requires(pre): shadow-utils - -%description headless -This puppet headless subpackage may be used when there is no need to -have puppet agent running as a service, for example, in a container -image. - %prep -%autosetup -S git -# Unbundle -rm -r lib/puppet/vendor/pathspec -# Note(hguemar): remove unrelated OS/distro specific folders -# These mess-up with RPM automatic dependencies compute by adding -# unnecessary deps like /sbin/runscripts -rm -r ext/{debian,freebsd,gentoo,ips,osx,solaris,suse,windows} -rm ext/redhat/*.init -rm ext/{build_defaults.yaml,project_data.yaml} - - -%build -# Nothing to build +%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%autosetup +cp -a %{sources} . +for f in puppetlabs-*.tar*; do + tar xvf $f +done +# Puppetlabs messed up with default paths +find -type f -exec \ + sed -i \ + -e 's|/opt/puppetlabs/puppet/bin|%{_bindir}|' \ + -e 's|/opt/puppetlabs/puppet/cache|%{_sharedstatedir}/puppet|' \ + -e 's|/opt/puppetlabs/puppet/share/locale|%{_datadir}/puppetlabs/puppet/locale|' \ + -e 's|/opt/puppetlabs/puppet/modules|%{_datadir}/puppetlabs/puppet/modules|' \ + -e 's|/opt/puppetlabs/puppet/vendor_modules|%{_datadir}/puppetlabs/puppet/vendor_modules|' \ + '{}' + %install -rm -rf %{buildroot} ruby install.rb --destdir=%{buildroot} \ - --configdir=%{_sysconfdir}/puppet \ - --bindir=%{_bindir} --vardir=%{_localstatedir}/cache/puppet \ - --logdir=%{_localstatedir}/log/puppet \ - --rundir=%{_localstatedir}/log/puppet \ - --localedir=%{_datadir}/%{name}/locale \ - --quick --no-rdoc --sitelibdir=%{puppet_libdir} - - -install -d -m0755 %{buildroot}%{_sysconfdir}/puppet/manifests -install -d -m0755 %{buildroot}%{_datadir}/%{name}/modules -install -d -m0755 %{buildroot}%{_localstatedir}/lib/puppet -install -d -m0755 %{buildroot}%{_localstatedir}/run/puppet -install -d -m0750 %{buildroot}%{_localstatedir}/log/puppet -install -d -m0750 %{buildroot}%{_localstatedir}/cache/puppet - -%if 0%{?_with_systemd} -%{__install} -d -m0755 %{buildroot}%{_unitdir} -install -Dp -m0644 ext/systemd/puppet.service %{buildroot}%{_unitdir}/puppet.service -ln -s %{_unitdir}/puppet.service %{buildroot}%{_unitdir}/puppetagent.service -install -Dp -m0644 ext/systemd/puppetmaster.service %{buildroot}%{_unitdir}/puppetmaster.service -%else -install -Dp -m0644 %{confdir}/client.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/puppet -install -Dp -m0755 %{confdir}/client.init %{buildroot}%{_initrddir}/puppet -install -Dp -m0644 %{confdir}/server.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/puppetmaster -install -Dp -m0755 %{confdir}/server.init %{buildroot}%{_initrddir}/puppetmaster -install -Dp -m0755 %{confdir}/queue.init %{buildroot}%{_initrddir}/puppetqueue -%endif - -install -Dp -m0644 %{confdir}/auth.conf %{buildroot}%{_sysconfdir}/puppet/auth.conf -install -Dp -m0644 %{confdir}/fileserver.conf %{buildroot}%{_sysconfdir}/puppet/fileserver.conf -install -Dp -m0644 %{confdir}/puppet.conf %{buildroot}%{_sysconfdir}/puppet/puppet.conf -install -Dp -m0644 ext/redhat/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/puppet + --bindir=%{_bindir} \ + --logdir=%{_localstatedir}/log/puppet \ + --rundir=%{_rundir}/puppet \ + --localedir=%{_datadir}/puppetlabs/puppet/locale \ + --vardir=%{_sharedstatedir}/puppet \ + --configdir=%{_sysconfdir}/puppet \ + --codedir=%{_sysconfdir}/puppet/code \ + --sitelibdir=%{puppet_libdir} + +mkdir -p %{buildroot}/usr/share/puppetlabs/puppet/vendor_modules +for d in $(find -mindepth 1 -maxdepth 1 -type d -name 'puppetlabs-*'); do + modver=${d#*-} + mod=${modver%-*} + cp -a $d %{buildroot}%{_datadir}/puppetlabs/puppet/vendor_modules/$mod +done -# Note(hguemar): Conflicts with config file from hiera package -rm %{buildroot}%{_sysconfdir}/puppet/hiera.yaml +install -Dp -m0644 ext/redhat/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/puppet -# Install a NetworkManager dispatcher script to pickup changes to -# /etc/resolv.conf and such (https://bugzilla.redhat.com/532085). -%if 0%{?_with_systemd} -install -Dpv -m0755 %{SOURCE3} \ - %{buildroot}%{nm_dispatcher_dir}/dispatcher.d/98-%{name} -%else -install -Dpv -m0755 %{SOURCE2} \ - %{buildroot}%{nm_dispatcher_dir}/dispatcher.d/98-%{name} -%endif +%{__install} -d -m0755 %{buildroot}%{_unitdir} +install -Dp -m0644 ext/systemd/puppet.service %{buildroot}%{_unitdir}/puppet.service +ln -s %{_unitdir}/puppet.service %{buildroot}%{_unitdir}/puppetagent.service -# Install the ext/ directory to %%{_datadir}/%%{name} -install -d %{buildroot}%{_datadir}/%{name} -cp -a ext/ %{buildroot}%{_datadir}/%{name} +install -Dpv -m0755 %{SOURCE13} \ + %{buildroot}%{nm_dispatcher_dir}/dispatcher.d/98-%{name} -chmod 0755 %{buildroot}%{_datadir}/%{name}/ext/regexp_nodes/regexp_nodes.rb +# Install the ext/ directory to %%{_datadir}/puppetlabs/%%{name} +install -d %{buildroot}%{_datadir}/puppetlabs/%{name} +cp -a ext/ %{buildroot}%{_datadir}/puppetlabs/%{name} +chmod 0755 %{buildroot}%{_datadir}/puppetlabs/%{name}/ext/regexp_nodes/regexp_nodes.rb # Install wrappers for SELinux -install -Dp -m0755 %{SOURCE4} %{buildroot}%{_bindir}/start-puppet-agent -install -Dp -m0755 %{SOURCE4} %{buildroot}%{_bindir}/start-puppet-master -install -Dp -m0755 %{SOURCE4} %{buildroot}%{_bindir}/start-puppet-ca -%if 0%{?_with_systemd} -sed -i 's|^ExecStart=.*/bin/puppet|ExecStart=/usr/bin/start-puppet-master|' \ - %{buildroot}%{_unitdir}/puppetmaster.service -sed -i 's|^ExecStart=.*/bin/puppet|ExecStart=/usr/bin/start-puppet-agent|' \ - %{buildroot}%{_unitdir}/puppet.service -%endif - -%if 0%{?fedora} || 0%{?rhel} >= 8 +install -Dp -m0755 %{SOURCE14} %{buildroot}%{_bindir}/start-puppet-agent +sed -i 's|^ExecStart=.*/bin/puppet|ExecStart=%{_bindir}/start-puppet-agent|' \ + %{buildroot}%{_unitdir}/puppet.service + # Setup tmpfiles.d config mkdir -p %{buildroot}%{_tmpfilesdir} -echo "D /run/%{name} 0755 %{name} %{name} -" > \ - %{buildroot}%{_tmpfilesdir}/%{name}.conf -%endif - -# Create puppet modules directory for puppet module tool -mkdir -p %{buildroot}%{_sysconfdir}/%{name}/modules +echo "D %{_rundir}/%{name} 0755 %{name} %{name} -" > \ + %{buildroot}%{_tmpfilesdir}/%{name}.conf +# Unbundle +# Note(hguemar): remove unrelated OS/distro specific folders +# These mess-up with RPM automatic dependencies compute by adding +# unnecessary deps like /sbin/runscripts +# some other things were removed with the patch +rm -r %{buildroot}%{_datadir}/puppetlabs/puppet/ext/{debian,freebsd,gentoo,ips,osx,solaris,suse,windows} +rm %{buildroot}%{_datadir}/puppetlabs/puppet/ext/redhat/*.init +rm %{buildroot}%{_datadir}/puppetlabs/puppet/ext/{build_defaults.yaml,project_data.yaml} %files -%if 0%{?_with_systemd} +%attr(-, puppet, puppet) %{_localstatedir}/log/puppet +%attr(-, puppet, puppet) %{_datadir}/puppetlabs/puppet +%dir %attr(-, puppet, puppet) %{_datadir}/puppetlabs %{_unitdir}/puppet.service %{_unitdir}/puppetagent.service -%else -%{_initrddir}/puppet -%config(noreplace) %{_sysconfdir}/sysconfig/puppet -%endif -%if 0%{?fedora} || 0%{?rhel} >= 8 %{_tmpfilesdir}/%{name}.conf -%endif -%config(noreplace) %{_sysconfdir}/logrotate.d/puppet %dir %{nm_dispatcher_dir} %dir %{nm_dispatcher_dir}/dispatcher.d %{nm_dispatcher_dir}/dispatcher.d/98-puppet +%{_bindir}/start-puppet-agent -%files headless %doc README.md examples %license LICENSE +%{_datadir}/ruby/vendor_ruby/hiera +%{_datadir}/ruby/vendor_ruby/hiera_puppet.rb +%{_datadir}/ruby/vendor_ruby/puppet +%{_datadir}/ruby/vendor_ruby/puppet_pal.rb +%{_datadir}/ruby/vendor_ruby/puppet.rb +%{_datadir}/ruby/vendor_ruby/puppet_x.rb +%{_sharedstatedir}/puppet %{_bindir}/puppet -%{_bindir}/start-puppet-* -%{puppet_libdir}/* -%dir %{_sysconfdir}/puppet -%dir %{_sysconfdir}/%{name}/modules -%config(noreplace) %{_sysconfdir}/puppet/puppet.conf -%config(noreplace) %{_sysconfdir}/puppet/auth.conf -%{_datadir}/%{name} -# These need to be owned by puppet so the server can -# write to them -%attr(-, puppet, puppet) %{_localstatedir}/run/puppet -%attr(0750, puppet, puppet) %{_localstatedir}/log/puppet -%attr(-, puppet, puppet) %{_localstatedir}/lib/puppet -%attr(0750, puppet, puppet) %{_localstatedir}/cache/puppet -%{_mandir}/man5/puppet.conf.5.gz -%{_mandir}/man8/puppet.8.gz -%{_mandir}/man8/puppet-agent.8.gz -%{_mandir}/man8/puppet-apply.8.gz -%{_mandir}/man8/puppet-catalog.8.gz -%{_mandir}/man8/puppet-describe.8.gz -%{_mandir}/man8/puppet-ca.8.gz -%{_mandir}/man8/puppet-cert.8.gz -%{_mandir}/man8/puppet-certificate.8.gz -%{_mandir}/man8/puppet-certificate_request.8.gz -%{_mandir}/man8/puppet-certificate_revocation_list.8.gz -%{_mandir}/man8/puppet-config.8.gz -%{_mandir}/man8/puppet-device.8.gz -%{_mandir}/man8/puppet-doc.8.gz -%{_mandir}/man8/puppet-facts.8.gz -%{_mandir}/man8/puppet-filebucket.8.gz -%{_mandir}/man8/puppet-generate.8.gz -%{_mandir}/man8/puppet-help.8.gz -%{_mandir}/man8/puppet-epp.8.gz -%{_mandir}/man8/puppet-key.8.gz -%{_mandir}/man8/puppet-lookup.8.gz -%{_mandir}/man8/puppet-man.8.gz -%{_mandir}/man8/puppet-module.8.gz -%{_mandir}/man8/puppet-node.8.gz -%{_mandir}/man8/puppet-parser.8.gz -%{_mandir}/man8/puppet-plugin.8.gz -%{_mandir}/man8/puppet-report.8.gz -%{_mandir}/man8/puppet-resource.8.gz -%{_mandir}/man8/puppet-script.8.gz -%{_mandir}/man8/puppet-status.8.gz - -%files server -%if 0%{?_with_systemd} -%{_unitdir}/puppetmaster.service -%else -%{_initrddir}/puppetmaster -%{_initrddir}/puppetqueue -%config(noreplace) %{_sysconfdir}/sysconfig/puppetmaster -%endif -%config(noreplace) %{_sysconfdir}/puppet/fileserver.conf -%dir %{_sysconfdir}/puppet/manifests -%{_mandir}/man8/puppet-master.8.gz - -# Fixed uid/gid were assigned in bz 472073 (Fedora), 471918 (RHEL-5), -# and 471919 (RHEL-4) -%pre headless +%{_mandir}/man5/puppet.conf.5* +%{_mandir}/man8/puppet-plugin.8* +%{_mandir}/man8/puppet-report.8* +%{_mandir}/man8/puppet-resource.8* +%{_mandir}/man8/puppet-script.8* +%{_mandir}/man8/puppet-ssl.8* +%{_mandir}/man8/puppet-agent.8* +%{_mandir}/man8/puppet.8* +%{_mandir}/man8/puppet-apply.8* +%{_mandir}/man8/puppet-catalog.8* +%{_mandir}/man8/puppet-config.8* +%{_mandir}/man8/puppet-describe.8* +%{_mandir}/man8/puppet-device.8* +%{_mandir}/man8/puppet-doc.8* +%{_mandir}/man8/puppet-epp.8* +%{_mandir}/man8/puppet-facts.8* +%{_mandir}/man8/puppet-filebucket.8* +%{_mandir}/man8/puppet-generate.8* +%{_mandir}/man8/puppet-help.8* +%{_mandir}/man8/puppet-lookup.8* +%{_mandir}/man8/puppet-module.8* +%{_mandir}/man8/puppet-node.8* +%{_mandir}/man8/puppet-parser.8* + +%config(noreplace) %attr(-, puppet, puppet) %dir %{_sysconfdir}/puppet +%config(noreplace) %attr(-, puppet, puppet) %dir %{_sysconfdir}/puppet/code +%config(noreplace) %attr(644, puppet, puppet) %{_sysconfdir}/puppet/puppet.conf +%config(noreplace) %attr(644, puppet, puppet) %{_sysconfdir}/puppet/hiera.yaml +%config(noreplace) %attr(644, root, root) %{_sysconfdir}/logrotate.d/%{name} + +%ghost %attr(755, puppet, puppet) %{_rundir}/%{name} + +%pre getent group puppet &>/dev/null || groupadd -r puppet -g 52 &>/dev/null getent passwd puppet &>/dev/null || \ -useradd -r -u 52 -g puppet -d %{_localstatedir}/lib/puppet -s /sbin/nologin \ - -c "Puppet" puppet &>/dev/null -# ensure that old setups have the right puppet home dir -if [ $1 -gt 1 ]; then - usermod -d %{_localstatedir}/lib/puppet puppet &>/dev/null -fi -exit 0 +useradd -r -u 52 -g puppet -d /usr/local/puppetlabs -s /sbin/nologin \ + -c "Puppet" puppet &>/dev/null %post -%if 0%{?_with_systemd} %systemd_post puppet.service -%else -# If there's a running puppet agent, restart it during upgrade. Fixes -# BZ #1024538. -if [ "$1" -ge 1 ]; then - pid="%{_localstatedir}/run/puppet/agent.pid" - if [ -e "$pid" ]; then - if ps -p "$(< "$pid")" -o cmd= | grep -q "puppet agent"; then - kill "$(< "$pid")" \ - && rm -f "$pid" \ - && /sbin/service puppet start - fi &>/dev/null - fi -fi -/sbin/chkconfig --add puppet -%endif -exit 0 - -%post server -%if 0%{?_with_systemd} -%systemd_post puppetmaster.service -%else -/sbin/chkconfig --add puppetmaster -%endif -exit 0 - -%preun -%if 0%{?_with_systemd} -%systemd_preun puppet.service -%else -if [ "$1" -eq 0 ]; then - /sbin/service puppet stop &>/dev/null - /sbin/chkconfig --del puppet -fi -%endif -exit 0 - -%preun server -%if 0%{?_with_systemd} -%systemd_preun puppetmaster.service -%else -if [ "$1" -eq 0 ]; then - /sbin/service puppetmaster stop &>/dev/null - /sbin/chkconfig --del puppetmaster -fi -%endif -exit 0 %postun -%if 0%{?_with_systemd} %systemd_postun_with_restart puppet.service -%else -if [ "$1" -ge 1 ]; then - /sbin/service puppet condrestart &>/dev/null -fi -%endif -exit 0 - -%postun server -%if 0%{?_with_systemd} -%systemd_postun_with_restart puppetmaster.service -%else -if [ "$1" -ge 1 ]; then - /sbin/service puppetmaster condrestart &>/dev/null -fi -%endif -exit 0 %changelog +* Tue Jun 15 2021 Breno Brand Fernandes - 7.7.0-1 +- Update to 7.7.0 -- the version that supports ruby 3 + * Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 5.5.20-4 - Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583. diff --git a/sources b/sources index 04dfbd2..08a1fc9 100644 --- a/sources +++ b/sources @@ -1,2 +1,12 @@ -SHA512 (puppet-5.5.20.tar.gz) = 83b8f234697e13d6fd8ac16634fff4e4adfece70858c32c1001925c71cc4d9a482da1880c27c08e796facb46d5d17889f9521121a69cb49e160e3c031ad564c4 -SHA512 (puppet-5.5.20.tar.gz.asc) = d862eaf430cbb86112b67a8e0b3da228d3dd2d2dc4d16cd6272c4f1d737e9c8674418e56fd96a47a6be55f699a803e0e889256ad3d2cff66f6eff397c7e719cc +SHA512 (gpgkey-6F6B15509CF8E59E6E469F327F438280EF8D349F.gpg) = 57dca499c8cf46ce19c07902b67f2b0f92813e5372057e468cc9dbe032cbe3dfd481b0f749cf5a696d86936977e5bafcc72c8662976e6dcee5e10860e7d9148c +SHA512 (puppet-7.7.0.tar.gz) = 2cd1bf799bfe5a3d5d3458db84021a29d119651faae111b8c3bfd374c2c1b008610f2c15d4b434dbd13caa91aea073503d40071d85e86687fa330e997b80f220 +SHA512 (puppetlabs-augeas_core-1.1.1.tar.gz) = 19e312da6b1accb74b772cb2d0a19dfa29d93cf03173bbf3c58e1def46ed352dd7c0618e0420b28a09607412ba87144ef3f2afc1cdedbe93f227b39bc4e290ac +SHA512 (puppetlabs-cron_core-1.0.4.tar.gz) = bdeab644f8f6084dcb8331edb207f5634672e512bf3573d85bb5eadcb979f83da7fb5ccbec150383d903bced3d0f05a7c20d4394abc2c479e194cff6646cb0ee +SHA512 (puppetlabs-host_core-1.0.3.tar.gz) = 09b4084663f4f6886380a473d26d1b759026f345bd3850084ac4f3ef59ed8ab2396fecdb3c836591d9097b9c5252ba794c4b7d3296b8321ff401f8a956ad093c +SHA512 (puppetlabs-mount_core-1.0.4.tar.gz) = 07aaae0c1176ffe098647094f2c7d9ea975288b52965af9dcc2aab043d65c20424bd6698988af540e4b1eb1852eaf3ceec9c71a6e08642f103370f5679d9206f +SHA512 (puppetlabs-scheduled_task-2.2.1.tar.gz) = a7d0860e28971167c3560a997e18d8ca7a528aa5ce9331645ff67eb021d5262964d7f735cf657227b8b680a930a79b50afc07324272b760866663f593851289a +SHA512 (puppetlabs-selinux_core-1.0.4.tar.gz) = 600bef04791bd5bb9a46a5397af6e5ed5937b0e271cb312ef64db6bb93c85acf5c6df6ab53a7999ce7609a7b7ea8c299f37cb6d44dfa2c48b3456ca893be6876 +SHA512 (puppetlabs-sshkeys_core-2.2.0.tar.gz) = 933d7a41f94aa499805dfd260ee52791400163f47135920ffed6294978805ef9db8f7edc2ad28c60a00a23f566143565a4e8cf52929020a400feff91c04db68b +SHA512 (puppetlabs-yumrepo_core-1.0.7.tar.gz) = 8fb3cb40077ac113c332a761c01c1d7ce4bdfff1016be696efb41be20c86ff688b40b83c00a47394d79e64941cf6c23ea4bbd1107b4c7856d1b481733cb2d7ce +SHA512 (puppetlabs-zfs_core-1.1.0.tar.gz) = cda1fcc55a54b4690c81edadf6c62e849db80b5f09a5310cdd9b82d0cef374432c2c62b98e5c8e8cc2bbb8d22007ddb3694b88208658ff303fdd608a76c15e0b +SHA512 (puppetlabs-zone_core-1.0.3.tar.gz) = 1083bcc810e8a7b048fad1c70656d806c65b5fa912c627bf1dfaf3b9d8a0ec675db100abc2fc6499669c17927ea3e55a5c968fde0e577fc1f4cebb1fbd5e0851