[olpc-kbdshim] Update systemd scripts to latest distro specs

Peter Robinson pbrobinson at fedoraproject.org
Sun May 11 12:02:15 UTC 2014


commit 33a68e2ec48d46e3d5336fd2caf8637d85cea34c
Author: Peter Robinson <pbrobinson at gmail.com>
Date:   Sun May 11 13:02:32 2014 +0100

    Update systemd scripts to latest distro specs

 olpc-kbdshim.spec |   42 ++++++++++++++++--------------------------
 1 files changed, 16 insertions(+), 26 deletions(-)
---
diff --git a/olpc-kbdshim.spec b/olpc-kbdshim.spec
index e21508e..f7924f5 100644
--- a/olpc-kbdshim.spec
+++ b/olpc-kbdshim.spec
@@ -1,11 +1,11 @@
 %define tag 206f6b6
 
+Name:    olpc-kbdshim
 Summary: OLPC XO keyboard support daemon
-Name: olpc-kbdshim
 Version: 29
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPLv2+
-Group: System Environment/Base
+Group:   System Environment/Base
 URL: http://dev.laptop.org/git/users/pgf/olpc-kbdshim/tree/README
 # Source0: the source tarball is created by "make tarball" from within
 # a clone of this git tree: git://dev.laptop.org/users/pgf/olpc-kbdshim
@@ -15,7 +15,9 @@ BuildRequires: kernel-headers, pkgconfig, glib2-devel
 BuildRequires: dbus-glib-devel, systemd-devel
 ExclusiveArch: %{ix86} %{arm}
 
-Requires: systemd-units
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
 
 %description
 The olpc-kbdshim-udev daemon monitors the keyboard and touchpad,
@@ -33,50 +35,38 @@ make
 
 %install
 mkdir -p %{buildroot}%{_bindir}
-mkdir -p %{buildroot}/lib/systemd/system
 
 install -p -m 755 olpc-kbdshim-udev %{buildroot}%{_bindir}/olpc-kbdshim-udev
 install -p -m 755 olpc-rotate %{buildroot}%{_bindir}/olpc-rotate
 install -p -m 755 olpc-brightness %{buildroot}%{_bindir}/olpc-brightness
 install -p -m 755 olpc-volume %{buildroot}%{_bindir}/olpc-volume
-install -p -m 644 olpc-kbdshim.service %{buildroot}/lib/systemd/system/olpc-kbdshim.service
+install -d %{buildroot}/%{_unitdir}
+install -p -m 644 olpc-kbdshim.service %{buildroot}%{_unitdir}/olpc-kbdshim.service
 
 
 %post
-if [ $1 -eq 1 ] ; then
-    # Initial installation
-    /bin/systemctl enable olpc-kbdshim.service >/dev/null 2>&1 || :
-fi
-
+%systemd_post olpc-kbdshim.service
 
 %preun
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable olpc-kbdshim.service > /dev/null 2>&1 || :
-    /bin/systemctl stop olpc-kbdshim.service > /dev/null 2>&1 || :
-fi
-
+%systemd_preun olpc-kbdshim.service
 
 %postun
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # Package upgrade, not uninstall
-    /bin/systemctl try-restart olpc-kbdshim.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart olpc-kbdshim.service
 
 
 %files
-%defattr(-,root,root,-)
 %doc README COPYING
-
 %{_bindir}/olpc-kbdshim-udev
 %{_bindir}/olpc-rotate
 %{_bindir}/olpc-brightness
 %{_bindir}/olpc-volume
-/lib/systemd/system/*
+%{_unitdir}/olpc-kbdshim.service
 
 
 %changelog
+* Sun May 11 2014 Peter Robinson <pbrobinson at fedoraproject.org> 29-4
+- Update systemd scripts to latest distro specs
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 29-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 
@@ -174,7 +164,7 @@ fi
 * Thu Jul 30 2009 Paul Fox <pg at laptop.org> - 8-1
 - add timestamps to events, to reduce racing during suspend/resume
 
-* Tue Jul 27 2009 Paul Fox <pg at laptop.org> - 7-1
+* Tue Jul 28 2009 Paul Fox <pg at laptop.org> - 7-1
 - fix touchpad rotation for F-11, which includes X11 amd/geode
   driver that fixes the earlier rotation direction issue. 
   (2.11.x and later are fixed.)


More information about the scm-commits mailing list