[389-admin/f18] Ticket 432 - Introduce new systemd-rpm macros in 389-admin spec file

Mark Reynolds mreynolds at fedoraproject.org
Fri Oct 19 21:31:42 UTC 2012


commit e1592f5cf7b623fe1980d84559c533a5890d899f
Author: Mark Reynolds <mreynolds at redhat.com>
Date:   Fri Oct 19 16:23:23 2012 -0400

    Ticket 432 - Introduce new systemd-rpm macros in 389-admin spec file
    
    Description:  Added the new systemd macros where possible, but had to manually
                  add the preset command in %post
    
    https://fedorahosted.org/389/ticket/432
    
    Reviewed by: richm(Thanks!)

 389-admin.spec |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/389-admin.spec b/389-admin.spec
index e27d85e..18152d9 100644
--- a/389-admin.spec
+++ b/389-admin.spec
@@ -85,7 +85,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
 rm -f $RPM_BUILD_ROOT%{_libdir}/%{pkgname}/modules/*.a
 rm -f $RPM_BUILD_ROOT%{_libdir}/%{pkgname}/modules/*.la
 
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -97,7 +96,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %post -p <lua>
 -- do the usual daemon post setup stuff
-os.execute('/bin/systemctl enable %{pkgname}-admin.service >/dev/null 2>&1 || :')
+os.execute('/bin/systemctl preset %{pkgname}-admin.service >/dev/null 2>&1 || :')
 os.execute('/sbin/ldconfig')
 -- restore permissions if upgrading
 if %{pkgname}admin_adminserv then
@@ -110,11 +109,7 @@ if %{pkgname}admin_consoleconf then
 end
 
 %preun
-if [ $1 -eq 0 ]; then
-   # Package removal, not upgrade
-   /bin/systemctl stop %{pkgname}-admin.service > /dev/null 2>&1 || :
-   /bin/systemctl --no-reload disable %{pkgname}-admin.service >/dev/null 2>&1 || :
-fi
+%systemd_preun %{pkgname}-admin.service
 
 %postun
 /sbin/ldconfig


More information about the scm-commits mailing list