use systemd macros (#850135)

This commit is contained in:
Miroslav Lichvar 2013-02-27 11:48:52 +01:00
parent 7a3abcb7d3
commit bdf750e12e

View File

@ -22,6 +22,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: udev Requires: udev
Requires(post): systemd-units Requires(post): systemd-units
Requires(preun): systemd-units Requires(preun): systemd-units
Requires(postun): systemd-units
%description %description
gpsd is a service daemon that mediates access to a GPS sensor 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 done
%post %post
/bin/systemctl daemon-reload &> /dev/null %systemd_post gpsd.service
if [ -f %{_initrddir}/%{name} ] && /sbin/chkconfig --level 3 %{name}; then
/bin/systemctl enable %{name}.service &> /dev/null
fi
:
%preun %preun
if [ $1 = 0 ]; then %systemd_preun gpsd.service
/bin/systemctl --no-reload disable %{name}.service &> /dev/null
/bin/systemctl stop %{name}.service &> /dev/null %postun
fi # Don't restart the service
: %systemd_postun
%post libs -p /sbin/ldconfig %post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig
%files %files
%doc README INSTALL COPYING %doc README INSTALL COPYING
%config(noreplace) %{_sysconfdir}/sysconfig/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/%{name}