Name: opsview-check-jitter Version: {{VERSION}} Release: 1%{?dist} Summary: A monitoring plugin that measures network jitter License: ISC URL: https://github.com/johanthoren/check_jitter Source0: %{name}-%{version}.tar.gz Requires: libcap selinux-policy infrastructure-agent %description A monitoring plugin that measures network jitter. %define _agentdir /opt/itrs/infrastructure-agent %define _plugindir %{_agentdir}/plugins %define _cfgdir %{_agentdir}/cfg/custom %define _bin check_jitter %prep %setup -q %build # Build steps are already handled outside the spec file. %install mkdir -p %{buildroot}%{_plugindir} install -D -m 0550 {{RELEASE_DIR}}/%{_bin} %{buildroot}%{_plugindir}/%{_bin} mkdir -p %{buildroot}%{_cfgdir} install -D -m 0440 {{CFG_DIR}}/custom/check_jitter.yml %{buildroot}%{_cfgdir}/check_jitter.yml %post # Set the capabilities on the binary setcap cap_net_raw+ep "%{_plugindir}/%{_bin}" # Restart the infrastructure-agent service after install or upgrade if [ $1 -eq 1 ] || [ $1 -eq 2 ] ; then systemctl restart infrastructure-agent.service fi %postun if [ $1 -eq 0 ]; then # Remove the capabilities from the binary setcap -r "%{_plugindir}/%{_bin}" fi # Restart the infrastructure-agent service after removal if [ $1 -ge 1 ] ; then systemctl restart infrastructure-agent.service fi %files %attr(0550, root, root) %{_plugindir}/%{_bin} %attr(0440, root, root) %{_cfgdir}/check_jitter.yml