Skip to content

Commit

Permalink
Add pre and post sections to geopmd spec file
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher M. Cantalupo <[email protected]>
  • Loading branch information
cmcantalupo committed Feb 18, 2025
1 parent 8f11596 commit 6e16aa7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions geopmdpy/geopmd.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,32 @@ install -D -p -m 644 geopm.service %{buildroot}%{_unitdir}/geopm.service
pushd %{buildroot}%{python3_sitearch}
python3 -m unittest discover -p 'Test*.py' -v %{_builddir}/%{prj_name}-%{version}/test

%if 0%{?suse_version}
%pre -n geopm-service
%service_add_pre geopm.service
%endif

%post -n geopm-service
%if 0%{?rhel_version} || 0%{?centos_ver} || 0%{?rocky_ver} || 0%{?fedora}
%systemd_post geopm.service
%else
%service_add_post geopm.service
%endif

%preun -n geopm-service
%if 0%{?rhel_version} || 0%{?centos_ver} || 0%{?rocky_ver} || 0%{?fedora}
%systemd_preun geopm.service
%else
%service_del_preun geopm.service
%endif

%postun -n geopm-service
%if 0%{?rhel_version} || 0%{?centos_ver} || 0%{?rocky_ver} || 0%{?fedora}
%systemd_postun_with_restart geopm.service
%else
%service_del_postun geopm.service
%endif

%files
%license LICENSE-BSD-3-Clause
%doc README.md
Expand Down

0 comments on commit 6e16aa7

Please sign in to comment.