diff --git a/munin.spec b/munin.spec index 85e913d..d9a1781 100644 --- a/munin.spec +++ b/munin.spec @@ -1,6 +1,6 @@ Name: munin Version: 2.0.76 -Release: 10%{?dist} +Release: 3%{?dist} Summary: Network-wide resource monitoring tool License: GPL-2.0-only URL: http://munin-monitoring.org/ @@ -36,9 +36,6 @@ Source33: munin-cgi-graph.socket Source34: munin-cgi-html.service Source35: munin-cgi-html.socket -# Common sources -Source40: munin.sysusers - # Patches Patch101: 21b3d860c17d7997d64267963f91ed75ca8a3e03.patch Patch102: cd842e36f3ab1a55c05304d6b78dc07048bd8f84.patch @@ -95,6 +92,7 @@ Requires: perl(Taint::Runtime) Requires: perl(Text::Balanced) Requires: perl(Time::HiRes) Requires: rrdtool +Requires(pre): shadow-utils %{?systemd_requires} BuildArch: noarch @@ -133,6 +131,7 @@ Requires: perl(Net::CIDR) Requires: perl(Net::SSLeay) Requires: perl(Net::Server) Requires: procps-ng +Requires(pre): shadow-utils Requires(pre): %{_sbindir}/semanage Requires(pre): %{_sbindir}/restorecon %{?systemd_requires} @@ -161,8 +160,8 @@ SNMP or similar technology. %package common Summary: Network-wide resource monitoring tool (common files) Requires: acl +Requires(pre): shadow-utils %{?systemd_requires} -%{?sysusers_requires_compat} BuildArch: noarch @@ -233,7 +232,6 @@ FastCGI so you don't need this package. sed -i -e ' s,^PREFIX = \(.*\),PREFIX = $(DESTDIR)%{_prefix},; - s,^SBINDIR = \(.*\),SBINDIR = $(DESTDIR)%{_sbindir},; s,^CONFDIR = \(.*\),CONFDIR = $(DESTDIR)%{_sysconfdir}/munin,; s,^DOCDIR = \(.*\),DOCDIR = $(DESTDIR)%{_docdir}/%{name}-%{version},; s,^MANDIR = \(.*\),MANDIR = $(DESTDIR)%{_mandir},; @@ -398,9 +396,10 @@ touch %{buildroot}%{_sysconfdir}/httpd/conf.d/munin-cgi.conf touch %{buildroot}%{_sysconfdir}/munin/munin-htpasswd -### Common ### - -install -m0644 -D %{SOURCE40} %{buildroot}%{_sysusersdir}/munin.conf +%pre +getent group munin >/dev/null || groupadd -r munin +getent passwd munin >/dev/null || useradd -r -g munin -d %{_sharedstatedir}/munin -s /bin/sh -c "Munin user" munin +exit 0 %post @@ -436,6 +435,33 @@ fi %systemd_postun munin.service +%triggerin -- munin < 2.0.69-2 +if [ -n "$(ls %{_sysconfdir}/munin/conf.d/* 2>/dev/null)" ]; then + mv -f %{_sysconfdir}/munin/conf.d/* %{_sysconfdir}/munin/munin-conf.d/ +fi +exit 0 + + +%triggerpostun -- munin < 2.0.69-2 +if [ -d %{_sysconfdir}/munin/conf.d ]; then + if ! rmdir %{_sysconfdir}/munin/conf.d 2>/dev/null; then + mv -f %{_sysconfdir}/munin/conf.d %{_sysconfdir}/munin/conf.d.rpmold + fi +fi +if [ -f %{_sysconfdir}/munin/munin.conf.rpmnew ]; then + if [ -n "$(ls %{_sysconfdir}/munin/munin-conf.d/* 2>/dev/null)" ]; then + ln -sf munin-conf.d %{_sysconfdir}/munin/conf.d + fi +fi +exit 0 + + +%pre node +getent group munin >/dev/null || groupadd -r munin +getent passwd munin >/dev/null || useradd -r -g munin -d %{_sharedstatedir}/munin -s /bin/sh -c "Munin user" munin +exit 0 + + %post node # Create log file [ -f %{_localstatedir}/log/munin-node/munin-node.log ] || \ @@ -476,7 +502,9 @@ fi %pre common -%sysusers_create_compat %{SOURCE40} +getent group munin >/dev/null || groupadd -r munin +getent passwd munin >/dev/null || useradd -r -g munin -d %{_sharedstatedir}/munin -s /bin/sh -c "Munin user" munin +exit 0 %post nginx @@ -600,7 +628,6 @@ fi %dir %{perl_vendorlib}/Munin %{perl_vendorlib}/Munin/Common %{_tmpfilesdir}/%{name}.conf -%{_sysusersdir}/munin.conf %attr(0775, root, munin) %dir %{_rundir}/munin @@ -632,27 +659,6 @@ fi %changelog -* Thu Jul 16 2026 Fedora Release Engineering - 2.0.76-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild - -* Fri Jan 16 2026 Fedora Release Engineering - 2.0.76-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild - -* Sun Dec 28 2025 Kim B. Heino - 2.0.76-8 -- rhbz 2406177: Move sysusers.d config to munin-common - -* Thu Jul 24 2025 Fedora Release Engineering - 2.0.76-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Tue Feb 11 2025 Zbigniew Jędrzejewski-Szmek - 2.0.76-6 -- Add sysusers.d config file to allow rpm to create users/groups automatically - -* Mon Jan 27 2025 Kim B. Heino - 2.0.76-5 -- rhbz 2340895: Fix build on Fedora 42 - -* Fri Jan 17 2025 Fedora Release Engineering - 2.0.76-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - * Mon Oct 21 2024 Kim B. Heino - 2.0.76-3 - Don't restart firewalld on package update, rhbz #2295597 diff --git a/munin.sysusers b/munin.sysusers deleted file mode 100644 index 50515ab..0000000 --- a/munin.sysusers +++ /dev/null @@ -1 +0,0 @@ -u munin - "Munin user" /var/lib/munin /bin/sh