From 6d929443daed3a0f5421f6585af9c7f67940182a Mon Sep 17 00:00:00 2001 From: Titouan Rigoudy Date: Sun, 12 Apr 2015 17:33:27 -0400 Subject: [PATCH] Move systemd service enabling to spec file --- Makefile | 1 - init-headphone.spec | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4cb52af..c8e8c6d 100644 --- a/Makefile +++ b/Makefile @@ -8,5 +8,4 @@ install: install -Dm 755 init-headphone ${DESTDIR}/${SBINDIR}/init-headphone install -Dm 755 init-headphone.modules ${DESTDIR}/${SYSCONFIGDIR}/sysconfig/modules/init-headphone.modules install -Dm 755 init-headphone.service ${DESTDIR}/${UNITDIR}/init-headphone.service - systemctl enable init-headphone diff --git a/init-headphone.spec b/init-headphone.spec index d74f7f3..72e6443 100644 --- a/init-headphone.spec +++ b/init-headphone.spec @@ -11,14 +11,16 @@ BuildArch: noarch BuildRequires: systemd Requires: i2c-tools-python -Requires: systemd +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd %description This script fixes a bug in Clevo W230SS-based laptops where the headphone jack would not work anymore after a resume from suspend. %prep -%setup -qn %{name}-master +%setup -qn %{name} %build @@ -28,6 +30,15 @@ would not work anymore after a resume from suspend. %install make install DESTDIR=%{buildroot} +%post +%systemd_post init-headphone.service + +%preun +%systemd_preun init-headphone.service + +%postun +%systemd_postun + %files %{_sbindir}/init-headphone %{_sysconfdir}/sysconfig/modules/init-headphone.modules