From 6ed4903e3c60d4a2c837dc80a5e8f615e4577207 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 1 Oct 2021 11:57:00 +0200 Subject: [PATCH] Avoid systemd_requires as per updated packaging guidelines There is no need to have them as systemd correctly handles reloading depending on the transaction ordering (even if systemd is installed _after_ the package that installs the unit file). Additionally, this also makes the scriptlets that manually invoke systemctl conditional on systemctl being present, similar to what systemd rpm macros do. --- mlocate.spec | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mlocate.spec b/mlocate.spec index 4fcd4b0..0918a8b 100644 --- a/mlocate.spec +++ b/mlocate.spec @@ -3,7 +3,7 @@ Summary: An utility for finding files by name Name: mlocate Version: 0.26 -Release: 30%{?dist} +Release: 31%{?dist} License: GPLv2 URL: https://fedorahosted.org/mlocate/ Source0: https://fedorahosted.org/releases/m/l/mlocate/mlocate-%{version}.tar.xz @@ -13,8 +13,6 @@ Source3: mlocate-updatedb.service Source4: mlocate-updatedb.timer Requires(pre): shadow-utils Requires(post): grep, sed -# standard systemd requires -%{?systemd_requires} BuildRequires: make BuildRequires: systemd BuildRequires: gcc @@ -70,7 +68,9 @@ if [ "$VARIANT_ID" = "silverblue" ] || [ -f /run/ostree-booted ]; then fi %systemd_post mlocate-updatedb.timer -systemctl start mlocate-updatedb.timer +if [ -x /usr/bin/systemctl ]; then + /usr/bin/systemctl start mlocate-updatedb.timer +fi %preun %systemd_preun mlocate-updatedb.timer @@ -79,7 +79,9 @@ systemctl start mlocate-updatedb.timer %systemd_postun_with_restart mlocate-updatedb.timer %triggerin -- %{name} < 0.26-11 -/usr/bin/systemctl start mlocate-updatedb.timer +if [ -x /usr/bin/systemctl ]; then + /usr/bin/systemctl start mlocate-updatedb.timer +fi %files -f mlocate.lang %doc AUTHORS COPYING NEWS README @@ -94,6 +96,9 @@ systemctl start mlocate-updatedb.timer %ghost %attr(0640,root,slocate) %{_localstatedir}/lib/mlocate/mlocate.db %changelog +* Fri Oct 01 2021 Kalev Lember - 0.26-31 +- Avoid systemd_requires as per updated packaging guidelines + * Thu Jul 22 2021 Fedora Release Engineering - 0.26-30 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild