use new systemd rpm macros (#850316)

This commit is contained in:
Michal Hlavinka 2012-08-21 18:25:02 +02:00
parent b9109aa24c
commit ed4f38482a

View File

@ -1,7 +1,7 @@
Summary: Tools for monitoring SMART capable hard disks Summary: Tools for monitoring SMART capable hard disks
Name: smartmontools Name: smartmontools
Version: 5.43 Version: 5.43
Release: 2%{?dist} Release: 3%{?dist}
Epoch: 1 Epoch: 1
Group: System Environment/Base Group: System Environment/Base
License: GPLv2+ License: GPLv2+
@ -73,28 +73,13 @@ rm -rf $RPM_BUILD_ROOT/%{_docdir}/%{name}
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%preun %preun
if [ $1 -eq 0 ] ; then %systemd_preun smartd.service
# Package removal, not upgrade
/bin/systemctl --no-reload disable smartd.service >/dev/null 2>&1 || :
/bin/systemctl stop smartd.service > /dev/null 2>&1 || :
fi
%post %post
if [ $1 -eq 1 ]; then %systemd_post smartd.service
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
/bin/systemctl enable smartd.service >/dev/null 2>&1 || :
else
if [ -n "$(find /etc/rc.d/rc5.d/ -name 'S??smartd' 2>/dev/null)" ]; then
/bin/systemctl enable smartd.service >/dev/null 2>&1 || :
fi
fi
%postun %postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || : %systemd_postun_with_restart smartd.service
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart smartd.service >/dev/null 2>&1 || :
fi
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -111,6 +96,9 @@ fi
%{_datadir}/%{name} %{_datadir}/%{name}
%changelog %changelog
* Tue Aug 21 2012 Michal Hlavinka <mhlavink@redhat.com> - 1:5.43-3
- use new systemd rpm macros (#850316)
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:5.43-2 * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:5.43-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild