Blob Blame History Raw
Summary:        Nagios Service Check Acceptor
Name:           nsca
Version:        2.7.2
Release:        7%{?dist}
License:        GPLv2+
Group:          Applications/System
URL:            http://www.nagios.org/
Source:         http://downloads.sourceforge.net/nagios/nsca-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Patch0:         nsca-2.7.2-initscript.patch
Patch1:         nsca-2.7.2-confpath.patch

BuildRequires:  libmcrypt-devel
Requires:       nagios
Requires(preun): /sbin/service, /sbin/chkconfig
Requires(post): /sbin/chkconfig
Requires(postun): /sbin/service


%description
The purpose of this addon is to allow you to execute Nagios/NetSaint
plugins on a remote host in as transparent a manner as possible.


%package client
Group:          Applications/System
Summary:        Client application for sending updates to a nsca server


%description client
Client application for sending updates to a nsca server.


%prep
%setup -q
%patch0 -p0 -b .initscript
%patch1 -p1 -b .confpath
# Change defaults in the config file to match the nagios package
sed -i -e "s|^command_file=.*|command_file=%{_localstatedir}/spool/nagios/cmd/nagios.cmd|" \
       -e "s|^alternate_dump_file=.*|alternate_dump_file=%{_localstatedir}/spool/nagios/cmd/nsca.dump|" \
       sample-config/nsca.cfg.in


%build
%configure \
        --sysconfdir="%{_sysconfdir}/nagios" \
        --localstatedir="%{_localstatedir}/log/nagios" \
        --with-nsca-user="nagios" \
        --with-nsca-grp="nagios" \
        --with-nsca-port="5667"
make %{?_smp_mflags} all


%install
rm -rf %{buildroot}
install -Dp -m 0755 src/nsca %{buildroot}%{_sbindir}/nsca
install -Dp -m 0755 src/send_nsca %{buildroot}%{_sbindir}/send_nsca
install -Dp -m 0644 sample-config/nsca.cfg %{buildroot}%{_sysconfdir}/nagios/nsca.cfg
install -Dp -m 0644 sample-config/send_nsca.cfg %{buildroot}%{_sysconfdir}/nagios/send_nsca.cfg
install -Dp -m 0755 init-script %{buildroot}%{_initrddir}/nsca


%post
/sbin/chkconfig --add nsca || :


%preun
if [ $1 -eq 0 ]; then
        /sbin/service nsca stop &>/dev/null
        /sbin/chkconfig --del nsca || :
fi


%postun
if [ "$1" -ge "1" ]; then
        /sbin/service nsca condrestart &>/dev/null || :
fi


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,0755)
%doc Changelog LEGAL README SECURITY
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/nagios/nsca.cfg
%{_initrddir}/nsca
%{_sbindir}/nsca


%files client
%defattr(-,root,root,-)
%doc Changelog LEGAL README SECURITY
%dir %{_sysconfdir}/nagios
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/nagios/send_nsca.cfg
%{_sbindir}/send_nsca


%changelog
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Mon Mar 31 2008 Wart <wart@kobold.org> - 2.7.2-6
- Change license to match sources

* Tue Mar 11 2008 Xavier Bachelot <xavier@bachelot.org> - 2.7.2-5
- Fix and rename initscript patch.
- Let client sub-package own %%{_sysconfdir}/nagios.

* Sun Mar 09 2008 Wart <wart@kobold.org> - 2.7.2-4
- Merge sed script for init script into the init script patch

* Mon Mar 03 2008 Xavier Bachelot <xavier@bachelot.org> - 2.7.2-3
- Sync with Wart's package (rhbz#433547).

* Thu Feb 07 2008 Xavier Bachelot <xavier@bachelot.org> - 2.7.2-2
- Split daemon and client.

* Wed Feb 02 2008 Xavier Bachelot <xavier@bachelot.org> - 2.7.2-1
- Update to 2.7.2.
- Clean up spec.

* Mon Dec 11 2006 Dag Wieers <dag@wieers.com> - 2.6-1
- Updated to release 2.6.

* Wed Feb 08 2006 Dag Wieers <dag@wieers.com> - 2.5-2
- Removed -s option in sysv script. (Rick Johnson)

* Wed Feb 08 2006 Dag Wieers <dag@wieers.com> - 2.5-1
- Updated to release 2.5.

* Tue Nov 11 2003 Dag Wieers <dag@wieers.com> - 2.4-2
- Fixed command_file and alternate_dump_file in nsca.cfg. (Johan Krisar)
- Removed the nagios dependency. (Johan Krisar)
- Added %%{_localstatedir}/spool/nagios/ as directoriy to filelist.

* Mon Oct 27 2003 Dag Wieers <dag@wieers.com> - 2.4-1
- Fixed default port and xinetd file. (Shad L. Lords)

* Mon Oct 06 2003 Dag Wieers <dag@wieers.com> - 2.4-0
- Initial package. (using DAR)