From 87f58c2beca8b6ab64f6e3b7876c74ce1e48bf6d Mon Sep 17 00:00:00 2001 From: rhatdan Date: Mon, 17 Sep 2012 12:34:10 -0400 Subject: [PATCH] Use systemd post install scriplets --- mcstrans.spec | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/mcstrans.spec b/mcstrans.spec index ae12556..fc09a35 100644 --- a/mcstrans.spec +++ b/mcstrans.spec @@ -1,7 +1,7 @@ Summary: SELinux Translation Daemon Name: mcstrans Version: 0.3.3 -Release: 5%{?dist} +Release: 6%{?dist} License: GPL+ Group: System Environment/Daemons Source: http://fedora.redhat.com/projects/%{name}-%{version}.tgz @@ -12,8 +12,9 @@ BuildRequires: libselinux-devel >= 1.30.3-1 BuildRequires: libcap-devel pcre-devel libsepol-devel libsepol-static BuildRequires: systemd-units Requires: pcre -Requires(pre): systemd-units Requires(post):systemd-units +Requires(preun): systemd-units +Requires(postun):systemd-units Provides: setransd Provides: libsetrans Obsoletes: libsetrans @@ -59,22 +60,14 @@ rm -rf %{buildroot}/%{_sysconfdir}/rc.d/init.d/mcstrans %clean rm -rf %{buildroot} -%post -if [ $1 -eq 1 ] ; then - /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : -fi +%post +%systemd_post mcstransd.service %preun -if [ $1 -eq 0 ]; then - /usr/bin/systemctl --no-reload mcstransd.service >/dev/null 2>&1 || : - /usr/bin/systemctl stop mcstransd.service > /dev/null 2>&1 || : -fi +%systemd_preun mcstransd.service -%postun -/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : -if [ $1 -ge 1 ]; then - /usr/bin/systemctl try-restart mcstransd.service >/dev/null 2>&1 || : -fi +%postun +%systemd_postun_with_restart mcstransd.service %files %defattr(-,root,root,0755) @@ -96,6 +89,9 @@ fi %{_usr}/share/mcstrans/util/* %changelog +* Mon Sep 16 2012 Dan Walsh - 0.3.3-5 +- Fix ot use systemd macros + * Thu Jul 19 2012 Fedora Release Engineering - 0.3.3-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild