spec: Use systemd-rpm-macros to handle ledmon.service

Resolves: #2073332
This commit is contained in:
Jan Macku 2022-06-27 13:14:39 +02:00
parent e8e3e81bc2
commit d9ba673e15

View File

@ -1,7 +1,7 @@
Summary: Enclosure LED Utilities Summary: Enclosure LED Utilities
Name: ledmon Name: ledmon
Version: 0.96 Version: 0.96
Release: 3%{?dist} Release: 4%{?dist}
License: GPLv2+ License: GPLv2+
URL: https://github.com/intel/ledmon URL: https://github.com/intel/ledmon
Source0: https://github.com/intel/ledmon/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz 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 BuildRequires: gcc make
# Needed for the udev dependency. # Needed for the udev dependency.
BuildRequires: systemd-devel BuildRequires: systemd-devel
BuildRequires: systemd-rpm-macros
Obsoletes: ledctl = 0.1-1 Obsoletes: ledctl = 0.1-1
Provides: ledctl = %{version}-%{release} Provides: ledctl = %{version}-%{release}
Requires: sg3_utils-libs Requires: sg3_utils-libs
@ -39,6 +41,15 @@ make
%install %install
%make_install SBIN_DIR=$RPM_BUILD_ROOT/%{_sbindir} MANDIR=$RPM_BUILD_ROOT%{_mandir} %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 %files
%doc README.md COPYING %doc README.md COPYING
%{_sbindir}/ledctl %{_sbindir}/ledctl
@ -47,6 +58,9 @@ make
%{_unitdir}/ledmon.service %{_unitdir}/ledmon.service
%changelog %changelog
* Mon Jun 27 2022 Jan Macku <jamacku@redhat.com> - 0.96-4
- Use systemd-rpm-macros to handle ledmon.service (#2073332)
* Wed Jun 01 2022 Jan Macku <jamacku@redhat.com> - 0.96-3 * Wed Jun 01 2022 Jan Macku <jamacku@redhat.com> - 0.96-3
- Add tests - Add tests