[PackageKit] Replace direct systemctl call with systemd-rpm macros (#857376)

Richard Hughes rhughes at fedoraproject.org
Mon Jan 6 17:31:32 UTC 2014


commit 67e944221204cb94eb99207db30ce6aa9364e72b
Author: Václav Pavlín <vpavlin at redhat.com>
Date:   Mon Jan 6 17:46:10 2014 +0100

    Replace direct systemctl call with systemd-rpm macros (#857376)
    
    Signed-off-by: Richard Hughes <richard at hughsie.com>

 PackageKit.spec |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/PackageKit.spec b/PackageKit.spec
index c885206..d072b80 100644
--- a/PackageKit.spec
+++ b/PackageKit.spec
@@ -6,7 +6,7 @@
 Summary:   Package management service
 Name:      PackageKit
 Version:   0.8.15
-Release:   3%{?dist}
+Release:   4%{?dist}
 License:   GPLv2+ and LGPLv2+
 URL:       http://www.packagekit.org
 Source0:   http://www.packagekit.org/releases/%{name}-%{version}.tar.xz
@@ -231,10 +231,16 @@ popd > /dev/null
 %find_lang %name
 
 %post
-systemctl enable packagekit-offline-update.service &> /dev/null || :
+%systemd_post packagekit-offline-update.service packagekit.service
 
 %post glib -p /sbin/ldconfig
 
+%preun
+%systemd_preun packagekit-offline-update.service packagekit.service
+
+%postun
+%systemd_postun_with_restart packagekit-offline-update.service packagekit.service
+
 %postun glib -p /sbin/ldconfig
 
 %files -f %{name}.lang
@@ -284,8 +290,8 @@ systemctl enable packagekit-offline-update.service &> /dev/null || :
 %{_libdir}/packagekit-plugins/*.so
 %{_libdir}/girepository-1.0/PackageKitPlugin-1.0.typelib
 %{_datadir}/dbus-1/interfaces/*.xml
-/usr/lib/systemd/system/packagekit-offline-update.service
-/usr/lib/systemd/system/packagekit.service
+%{_unitdir}/packagekit-offline-update.service
+%{_unitdir}/packagekit.service
 %{_libexecdir}/pk-*offline-update
 %if 0%{?rhel} == 0
 %{_libdir}/packagekit-backend/libpk_backend_hawkey.so
@@ -334,6 +340,11 @@ systemctl enable packagekit-offline-update.service &> /dev/null || :
 %{_datadir}/gtk-doc/html/PackageKit
 
 %changelog
+* Mon Jan 06 2014 Václav Pavlín <vpavlin at redhat.com> - 0.8.15-4
+- Replace systemctl call with systemd-rpm macros and missing
+  macros (#857376)
+- Use macros instead of hardcoded paths
+
 * Fri Dec 20 2013 Richard Hughes <rhughes at redhat.com> - 0.8.15-3
 - Remove the internal requires of PackageKit-backend.
 


More information about the scm-commits mailing list