Name: obmon Version: 1.3.1 Release: 2%{?dist} Summary: Obmon - Monitoring tools Group: System Environment/Libraries License: LGPL v3+ Source0: %{name}-%{version}.tar.gz BuildRequires: gcc, gcc-c++, cmake, spdlog-devel, jsoncpp-devel, czmq-devel, pstreams-devel BuildRequires: libgtop2-devel, nvml-devel, doxygen %global debug_package %{nil} %if 0%{?rhel} == 6 || 0%{?el6} == 1 %else Requires(post): systemd Requires(preun): systemd Requires(postun): systemd BuildRequires: systemd %endif %description Monitoring tool %package devel Summary: Development files for the obmon package Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel This package contains files needed to develop applications using obmon. %prep %setup -q %build mkdir build cd build cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_DOCUMENTATION=on make %{?_smp_mflags} cd ../ %install rm -rf %{buildroot} cd build make install DESTDIR=%{buildroot} cd ../ %if 0%{?rhel} == 6 || 0%{?el6} == 1 rm -f %{buildroot}/usr/lib/systemd/system/%{name}-sensor.service rm -f %{buildroot}/usr/lib/systemd/system/%{name}-broker.service %else rm -f %{buildroot}/%{_sysconfdir}/init.d/%{name}-sensor rm -f %{buildroot}/%{_sysconfdir}/init.d/%{name}-broker %endif %if 0%{?rhel} == 6 || 0%{?el6} == 1 rm -f %{buildroot}/usr/lib/systemd/system/%{name}.service %else rm -f %{buildroot}/%{_sysconfdir}/init.d/%{name} %endif %post %if 0%{?rhel} == 6 || 0%{?el6} == 1 %else %systemd_post %{name}-broker.service %systemd_post %{name}-sensor.service %endif %preun %if 0%{?rhel} == 6 || 0%{?el6} == 1 %else %systemd_preun %{name}-broker.service %systemd_preun %{name}-sensor.service %endif # Restarting %{name}.service (maybe we don't want it) %postun %if 0%{?rhel} == 6 || 0%{?el6} == 1 %else %systemd_postun_with_restart %{name}-broker.service %systemd_postun_with_restart %{name}-sensor.service %endif %files %{_bindir}/* %{_libdir}/* %doc /usr/share/doc/%{name}/ %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %if 0%{?rhel} == 6 || 0%{?el6} == 1 %attr(0755, root, root) %{_sysconfdir}/init.d/%{name} %else %{_unitdir}/%{name}-broker.service %{_unitdir}/%{name}-sensor.service %endif %files devel %{_includedir}/* %changelog