From efee52edc9ac6cd7b10629dca76064fbcf0c187c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Fri, 7 Jan 2022 23:31:17 +0100 Subject: [PATCH] - update systemd scriptlets to use upstream macros and add user units --- template.spec | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/template.spec b/template.spec index f90e1a5..072220e 100644 --- a/template.spec +++ b/template.spec @@ -26,10 +26,13 @@ Requires(post,preun): /sbin/chkconfig Requires: rc-scripts %endif %if %{with systemd_service} -BuildRequires: rpmbuild(macros) >= 1.647 +BuildRequires: rpmbuild(macros) >= 2.011 Requires(post,preun,postun): systemd-units >= 38 Requires: systemd-units >= 0.38 %endif +%if %{with systemd_user_service} +BuildRequires: rpmbuild(macros) >= 2.011 +%endif #BuildRequires: - #BuildRequires: autoconf #BuildRequires: automake @@ -190,7 +193,16 @@ fi %systemd_preun %{name}.service %postun -%systemd_reload +#%systemd_postun %{name}.service +%systemd_postun_with_restart %{name}.service +%endif + +%if %{with systemd_user_service} +%post +%systemd_user_post %{name}.service + +%preun +%systemd_user_preun %{name}.service %endif %files @@ -215,6 +227,10 @@ fi %{systemdunitdir}/%{name}.service %endif +%if %{with systemd_user_service} +%{systemduserunitdir}/%{name}.service +%endif + #%{_examplesdir}/%{name}-%{version} %if %{with subpackage} -- 2.44.0