From bdf750e12e28914f5b70be3ab71c9b0488b99fc7 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Feb 27 2013 11:02:43 +0000 Subject: use systemd macros (#850135) --- diff --git a/gpsd.spec b/gpsd.spec index 5765d97..1c2175e 100644 --- a/gpsd.spec +++ b/gpsd.spec @@ -22,6 +22,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: udev Requires(post): systemd-units Requires(preun): systemd-units +Requires(postun): systemd-units %description gpsd is a service daemon that mediates access to a GPS sensor @@ -141,25 +142,19 @@ for i in %{buildroot}%{python_sitearch}/gps/*.so; do done %post -/bin/systemctl daemon-reload &> /dev/null -if [ -f %{_initrddir}/%{name} ] && /sbin/chkconfig --level 3 %{name}; then - /bin/systemctl enable %{name}.service &> /dev/null -fi -: +%systemd_post gpsd.service %preun -if [ $1 = 0 ]; then - /bin/systemctl --no-reload disable %{name}.service &> /dev/null - /bin/systemctl stop %{name}.service &> /dev/null -fi -: +%systemd_preun gpsd.service -%post libs -p /sbin/ldconfig +%postun +# Don't restart the service +%systemd_postun +%post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig - %files %doc README INSTALL COPYING %config(noreplace) %{_sysconfdir}/sysconfig/%{name}