From 269d0de785de791d22a7cbc470b479f854d4f022 Mon Sep 17 00:00:00 2001 From: Jan Macku Date: Mon, 27 Jun 2022 08:25:52 +0200 Subject: [PATCH] spec: Use systemd-rpm-macros to handle ledmon.service Resolves: #2101300 --- ledmon.spec | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ledmon.spec b/ledmon.spec index 65c9506..b72e322 100644 --- a/ledmon.spec +++ b/ledmon.spec @@ -1,7 +1,7 @@ Summary: Enclosure LED Utilities Name: ledmon Version: 0.96 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: https://github.com/intel/ledmon Source0: https://github.com/intel/ledmon/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz @@ -14,6 +14,8 @@ BuildRequires: autoconf automake BuildRequires: gcc make # Needed for the udev dependency. BuildRequires: systemd-devel +BuildRequires: systemd-rpm-macros + Obsoletes: ledctl = 0.1-1 Provides: ledctl = %{version}-%{release} Requires: sg3_utils-libs @@ -39,6 +41,15 @@ make %install %make_install SBIN_DIR=$RPM_BUILD_ROOT/%{_sbindir} MANDIR=$RPM_BUILD_ROOT%{_mandir} +%post +%systemd_post ledmon.service + +%preun +%systemd_preun ledmon.service + +%postun +%systemd_postun_with_restart ledmon.service + %files %doc README.md COPYING %{_sbindir}/ledctl