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.
This commit is contained in:
Kalev Lember 2021-10-01 11:57:00 +02:00
parent da22091b90
commit 6ed4903e3c

View File

@ -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 <klember@redhat.com> - 0.26-31
- Avoid systemd_requires as per updated packaging guidelines
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.26-30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild