[packages/upower] - restart on upgrade when using systemd

arekm arekm at pld-linux.org
Tue Mar 26 12:22:26 CET 2013


commit 48f5336ef3d142e87f8f70e61c31f11fa55730bc
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Mar 26 12:22:23 2013 +0100

    - restart on upgrade when using systemd

 upower.spec | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/upower.spec b/upower.spec
index 788bd35..d2f2a9f 100644
--- a/upower.spec
+++ b/upower.spec
@@ -31,6 +31,8 @@ BuildRequires:	udev-glib-devel >= 1:147
 BuildRequires:	xz
 Requires:	pm-utils
 Requires:	polkit >= 0.97
+Requires(post,preun,postun):	systemd-units >= 38
+Requires:	systemd-units >= 38
 Obsoletes:	DeviceKit-power < 0.15
 Obsoletes:	UPower < 0.9.8-2
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -136,6 +138,18 @@ rm -rf $RPM_BUILD_ROOT
 %post	libs -p /sbin/ldconfig
 %postun	libs -p /sbin/ldconfig
 
+%post
+%systemd_post upower.service
+
+%preun
+if [ "$1" = "0" ]; then
+        %service upower stop
+fi
+%systemd_preun upower.service
+
+%postun
+%systemd_reload
+
 %files -f upower.lang
 %defattr(644,root,root,755)
 %doc AUTHORS HACKING NEWS README
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/upower.git/commitdiff/48f5336ef3d142e87f8f70e61c31f11fa55730bc



More information about the pld-cvs-commit mailing list