diff --git a/podman.spec.rpkg b/podman.spec.rpkg index 882333dda559..e0efcc4f0f23 100644 --- a/podman.spec.rpkg +++ b/podman.spec.rpkg @@ -75,6 +75,7 @@ BuildRequires: shadow-utils-subid-devel BuildRequires: pkgconfig BuildRequires: make BuildRequires: ostree-devel +%{?systemd_requires} BuildRequires: systemd BuildRequires: systemd-devel Requires: conmon >= 2:2.0.30-2 @@ -221,6 +222,17 @@ for file in `find %{buildroot}%{_mandir}/man[15] -type f | sed "s,%{buildroot},, echo "$file*" >> podman.file-list done +%post +if [ $1 -eq 1 ]; then + %{_bindir}/systemctl enable --now %{name}-restart.service +fi + +%preun +%systemd_preun %{name}-restart.service + +%postun +%systemd_postun %{name}-restart.service + # This lists all the files that are included in the rpm package and that # are going to be installed into target system where the rpm is installed. %files -f %{name}.file-list