From 69ea06ff5ddc17c20ce26883e8bdf05b5a49666a Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Tue, 14 Nov 2017 15:16:05 +0100 Subject: [PATCH] install hwloc-dump-hwdata.service --- hwloc.spec | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/hwloc.spec b/hwloc.spec index c089dcf..5aef4d7 100644 --- a/hwloc.spec +++ b/hwloc.spec @@ -26,6 +26,10 @@ BuildRequires: numactl-devel %ifnarch %{arm} BuildRequires: rdma-core-devel %endif +%ifarch %{ix86} x86_64 +%{?systemd_requires} +BuildRequires: systemd +%endif %description The Portable Hardware Locality (hwloc) software package provides @@ -107,11 +111,27 @@ ln %{buildroot}%{_mandir}/man1/lstopo-no-graphics.1 %{buildroot}%{_mandir}/man1/ # Deal with service file # https://github.com/open-mpi/hwloc/issues/221 +%ifarch %{ix86} x86_64 +mkdir -p %{buildroot}%{_unitdir} +mv %{buildroot}%{_datadir}/%{name}/hwloc-dump-hwdata.service %{buildroot}%{_unitdir}/ +%else rm %{buildroot}%{_datadir}/%{name}/hwloc-dump-hwdata.service +%endif %check LD_LIBRARY_PATH=$PWD/src/.libs make check +%ifarch %{ix86} x86_64 +%post +%systemd_post hwloc-dump-hwdata.service + +%preun +%systemd_preun hwloc-dump-hwdata.service + +%postun +%systemd_postun_with_restart hwloc-dump-hwdata.service +%endif + %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig @@ -123,6 +143,7 @@ LD_LIBRARY_PATH=$PWD/src/.libs make check %{_mandir}/man1/lstopo-no-graphics* %ifarch %{ix86} x86_64 %{_sbindir}/hwloc-dump-hwdata +%{_unitdir}/hwloc-dump-hwdata.service %endif %files devel @@ -149,7 +170,8 @@ LD_LIBRARY_PATH=$PWD/src/.libs make check %{_datadir}/applications/lstopo.desktop %files plugins -%{_libdir}/hwloc* +%dir %{_libdir}/%{name} +%{_libdir}/%{name}/hwloc* %changelog * Thu Nov 02 2017 Michal Schmidt - 1.11.8-2