Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
RPM spec for packaging nsca-ng 1.6 tested on RHEL/CentOS 6 and 7
%if 0%{?fedora} > 17 || 0%{?rhel} > 6
%global systemd_support 1
%global systemd_support 0
Summary: A modern replacement for NSCA
Name: nsca-ng
Version: 1.6
Release: 1%{?dist}
License: BSD-2-Clause
Group: System/Monitoring
BuildRequires: gcc
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libconfuse-devel
BuildRequires: libev-devel
BuildRequires: openssl-devel >= 1.0.0
BuildRequires: pkgconfig
BuildRequires: nagios-common
%if %{systemd_support}
BuildRequires: systemd-units
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires(preun): /sbin/service, /sbin/chkconfig
Requires(post): /sbin/chkconfig
Requires(postun): /sbin/service
Requires: nagios
A client-server pair which makes the "Nagios command file" accessible to
remote systems. This allows for submitting passive check results, downtimes,
and many other commands to Nagios (or compatible monitoring solutions).
NSCA-ng supports TLS encryption and shared-secret authentication with
client-specific passwords (based on RFC 4279), as well as fine-grained
authorization control.
%package client
Summary: Client application for sending updates to a nsca server
Requires: nagios-common
Conflicts: nsca-client
Provides: nsca-client
%description client
Client application for sending updates to a nsca server
%setup -q
autoreconf -fi
export CFLAGS="%{optflags} -fno-strict-aliasing"
%configure --enable-server --disable-silent-rules --sysconfdir %{_sysconfdir}/nagios
make %{?_smp_mflags}
make install DESTDIR=%{buildroot} %{?_smp_mflags}
%if %{systemd_support}
install -D -m 0644 etc/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
install -D -m 0644 etc/%{name}.socket %{buildroot}%{_unitdir}/%{name}.socket
install -D -m 0755 contrib/%{name}.init %{buildroot}%{_initrddir}/%{name}
%config(noreplace) %attr(0640,root,nagios) %{_sysconfdir}/nagios/nsca-ng.cfg
%if %{systemd_support}
%files client
%config(noreplace) %attr(0640,root,nagios) %{_sysconfdir}/nagios/send_nsca.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment