Replace remaining scriptlets with new systemd-rpm macros in spec file

- remaining scriptlets replaced with new systemd macros (#850199)
- many thanks to Lukás Nykrýn and Václav Pavlín
This commit is contained in:
Prarit Bhargava 2013-08-14 08:15:52 -04:00
parent c691b9569d
commit 0fc3cb2a62

View File

@ -3,7 +3,7 @@
Summary: Tool to translate x86-64 CPU Machine Check Exception data
Name: mcelog
Version: 1.0
Release: 0.10.%{last_git_commit}%{?dist}
Release: 0.11.%{last_git_commit}%{?dist}
Epoch: 2
Group: System Environment/Base
License: GPLv2
@ -54,21 +54,14 @@ install -p -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/mcelog.service
install -p -m644 mcelog.8 $RPM_BUILD_ROOT/%{_mandir}/man8
%post
systemctl enable mcelog.service &> /dev/null ||
systemctl daemon-reload &> /dev/null
%systemd_post mcelog.service
%preun
# Handle removing mcelog
if [ "$1" -eq 0 ]; then
systemctl disable mcelog.service &> /dev/null
systemctl stop mcelog.service &> /dev/null
fi
%systemd_preun mcelog.service
%postun
# Handle upgrading mcelog
if [ "$1" -ge 1 ]; then
systemctl try-restart mcelog.service &> /dev/null
fi
%systemd_postun_with_restart mcelog.service
%files
%doc README CHANGES
@ -82,6 +75,9 @@ fi
%attr(0644,root,root) %{_mandir}/*/*
%changelog
* Wed Aug 14 2013 Prarit Bhargava <prarit@redhat.com> 2:1.0-0.11.f0d7654
- remaining scriptlets replaced with new systemd macros (#850199)
* Mon Aug 12 2013 Prarit Bhargava <prarit@redhat.com> 2:1.0-0.10.f0d7654
- updated to latest mcelog
- removed mcelog-fix-trigger-path-and-cacheing.patch. AFAICT triggers are