[mcstrans/f18] Use systemd post install scriplets
Daniel J Walsh
dwalsh at fedoraproject.org
Mon Sep 17 16:34:37 UTC 2012
commit 87f58c2beca8b6ab64f6e3b7876c74ce1e48bf6d
Author: rhatdan <dwalsh at redhat.com>
Date: Mon Sep 17 12:34:10 2012 -0400
Use systemd post install scriplets
mcstrans.spec | 26 +++++++++++---------------
1 files 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 <dwalsh at redhat.com> - 0.3.3-5
+- Fix ot use systemd macros
+
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.3.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
More information about the scm-commits
mailing list