[uptimed: 1/2] use systemd macro, minor updates to unit and spec
Tomasz Torcz
ttorcz at fedoraproject.org
Thu Aug 23 07:16:04 UTC 2012
commit 5817e9f35e444579b190517c220a7ceaa0271b1c
Author: Tomasz Torcz <tomek at pipebreaker.pl>
Date: Thu Aug 23 09:12:37 2012 +0200
use systemd macro, minor updates to unit and spec
uptimed.service | 1 +
uptimed.spec | 28 +++++++++++-----------------
2 files changed, 12 insertions(+), 17 deletions(-)
---
diff --git a/uptimed.service b/uptimed.service
index 4b92a36..531c415 100644
--- a/uptimed.service
+++ b/uptimed.service
@@ -1,5 +1,6 @@
[Unit]
Description=Uptime record tracking daemon
+Documentation=man:uptimed(8) man:uprecords(1)
[Service]
ExecStartPre=/usr/sbin/uptimed -b
diff --git a/uptimed.spec b/uptimed.spec
index 8aec50a..e2039ba 100644
--- a/uptimed.spec
+++ b/uptimed.spec
@@ -2,7 +2,7 @@
Summary: A daemon to record and keep track of system up times
Name: uptimed
Version: 0.3.17
-Release: 1%{?dist}
+Release: 3%{?dist}
License: GPLv2
Group: System Environment/Daemons
URL: http://podgorny.cz/moin/Uptimed
@@ -33,8 +33,8 @@ Development header and library for uptimed.
%prep
%setup -q
# remove bundled getopt
-%{__rm} -rf src/getopt.[ch]
-%{__sed} --in-place -e 's/AC_REPLACE_FUNCS(getopt)//' configure.ac
+rm -rf src/getopt.[ch]
+sed --in-place -e 's/AC_REPLACE_FUNCS(getopt)//' configure.ac
%build
%configure --disable-static
@@ -56,29 +56,18 @@ mkdir -p %{buildroot}%{_localstatedir}/spool/uptimed
%post
/sbin/ldconfig
-if [ $1 -eq 1 ] ; then
- # Initial installation
- /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post %{name}.service
%post devel -p /sbin/ldconfig
%postun
/sbin/ldconfig
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
- # Package upgrade, not uninstall
- /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart %{name}.service
%postun devel -p /sbin/ldconfig
%preun
-if [ $1 -eq 0 ] ; then
- # Package removal, not upgrade
- /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || :
- /bin/systemctl stop %{name}.service > /dev/null 2>&1 || :
-fi
+%systemd_preun %{name}.service
%files
%defattr(-,root,root,-)
@@ -97,6 +86,11 @@ fi
%{_includedir}/uptimed.h
%changelog
+* Thu Aug 23 2012 Tomasz Torcz <ttorcz at fedoraproject.org> 0.3.17-3
+- bring systemd unit in-line with upstream (until new version is released)
+- use systemd macros
+- do not use macros for system executables (rm, sed)
+
* Sun Jun 03 2012 Tomasz Torcz <ttorcz at fedoraproject.org> 0.3.17-1
- new upstream version
- do not regenerate auto* stuff
More information about the scm-commits
mailing list