[cyrus-imapd/f15] use new systemd rpm macros (#850079)

Michal Hlavinka mhlavink at fedoraproject.org
Tue Aug 21 17:25:21 UTC 2012


commit b862dab1264960df42c7f4ebef49ef78d9a3b907
Author: Michal Hlavinka <mhlavink at redhat.com>
Date:   Tue Aug 21 19:24:56 2012 +0200

    use new systemd rpm macros (#850079)

 cyrus-imapd.spec |   23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)
---
diff --git a/cyrus-imapd.spec b/cyrus-imapd.spec
index 4e06434..cc4e30b 100644
--- a/cyrus-imapd.spec
+++ b/cyrus-imapd.spec
@@ -1,6 +1,6 @@
 Name: cyrus-imapd
 Version: 2.4.16
-Release: 1%{?dist}
+Release: 2%{?dist}
 
 %define ssl_pem_file %{_sysconfdir}/pki/%{name}/%{name}.pem
 
@@ -323,7 +323,6 @@ rm -rf %{buildroot}
   -G saslauth -s /sbin/nologin -u %{uid} -r %{_cyrususer} 2> /dev/null || :
 
 %post
-/bin/systemctl daemon-reload > /dev/null 2>&1 :
 
 # Force synchronous updates, usually only on ext2 filesystems
 for i in %{_var}/lib/imap/{user,quota} %{_var}/spool/imap
@@ -354,22 +353,13 @@ mv %{name}.pem %{ssl_pem_file}
 popd
 fi
 
+%systemd_post cyrus-imapd.service
+
 %preun
-if [ $1 -eq 0 ] ; then
-        # Package removal, not upgrade
-        /bin/systemctl disable cyrus-imapd.service >/dev/null 2>&1 || :
-        /bin/systemctl stop cyrus-imapd.service > /dev/null 2>&1 || :
-fi
+%systemd_preun cyrus-imapd.service
 
 %postun
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-        # Package upgrade, not uninstall
-        /bin/systemctl try-restart cyrus-imapd.service >/dev/null 2>&1 || :
-fi
-
-%triggerun -- cyrus-imapd < 2.4.7-2
-/sbin/chkconfig --level 3 cyrus-imapd && /bin/systemctl enable cyrus-imapd.service >/dev/null 2>&1 || :
+%systemd_postun_with_restart cyrus-imapd.service
 
 %files
 %defattr(-,root,root,-)
@@ -509,6 +499,9 @@ fi
 %{_mandir}/man1/*
 
 %changelog
+* Tue Aug 21 2012 Michal Hlavinka <mhlavink at redhat.com> - 2.4.16-2
+- use new systemd rpm macros (#850079)
+
 * Fri May 11 2012 Michal Hlavinka <mhlavink at redhat.com> - 2.4.16-1
 - updated to 2.4.16
 


More information about the scm-commits mailing list