Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > e8cfcc056dc78dfcc0ea13e783b7bc22 > files > 6

ndoutils-1.4-0.b7.5mdv2008.0.src.rpm

%define nsusr nagios
%define nsgrp nagios
%define beta  b7

Summary:	Nagios Data Output Utilities
Name:		ndoutils
Version:	1.4
Release:	%mkrel 0.%{beta}.5
Group:		System/Servers
License:	GPL
URL:		http://www.nagios.org/
Source0:	http://downloads.sourceforge.net/nagios/ndoutils-%{version}%{beta}.tar.gz
Source1:	ndo2db.init
Patch0:		ndoutils-mdv_conf.diff
Patch1:		ndoutils-pgsql_includes_fix.diff
Patch2:		ndoutils-1.4b7-no-database-prefix.patch
Requires:       nagios >= 3.0
Requires(post): rpm-helper
Requires(preun): rpm-helper
Requires(pre): rpm-helper
Requires(postun): rpm-helper
BuildRequires:	mysql-devel
BuildRequires:	postgresql-devel
BuildRequires:	nagios-devel
BuildRequires:	tcp_wrappers-devel
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root

%description
The NDOUTILS (Nagios Data Output Utils) addon allows you to move status and
even information from Nagios to a database for later retrieval and processing.

%prep
%setup -q -n ndoutils-%{version}%{beta}
%patch0 -p1
%patch1 -p0
%patch2 -p1


# lib64 fix
perl -pi -e "s|/usr/lib/|%{_libdir}/|g" config/*

%build
%serverbuild

%configure2_5x \
    --with-mysql-lib=%{_libdir}/mysql \
    --with-pgsql-lib=%{_libdir} \
    --with-pgsql-inc=%{_includedir}/pgsql

make

%install
rm -rf %{buildroot}

install -d %{buildroot}%{_initrddir}
install -d %{buildroot}%{_sbindir}
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_libdir}/nagios/brokers
install -d %{buildroot}%{_sysconfdir}/nagios
install -d %{buildroot}%{_localstatedir}/ndo

install -m0755 src/ndo2db-3x %{buildroot}%{_sbindir}/ndo2db
install -m0755 src/file2sock %{buildroot}%{_bindir}/file2sock
install -m0755 src/log2ndo %{buildroot}%{_bindir}/log2ndo
install -m0755 src/sockdebug %{buildroot}%{_bindir}/sockdebug
install -m0755 src/ndomod-3x.o %{buildroot}%{_libdir}/nagios/brokers/ndomod.o
install -m0644 config/ndomod.cfg %{buildroot}%{_sysconfdir}/nagios/ndomod.cfg
install -m0644 config/ndo2db.cfg %{buildroot}%{_sysconfdir}/nagios/ndo2db.cfg
install -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/ndo2db

cat > README.urpmi <<EOF
Mandriva RPM specific notes

setup
-----
The mysql database creation script has been modified to not enforce a table name
prefix by default

post-installation
-----------------
You have to:
- create a MySQL database
- create an user with at least SELECT, INSERT, UPDATE, DELETE privileges on it
- run %{_docdir}/db/mysql.sql script
EOF


%post
%_post_service ndo2db

%preun
%_preun_service ndo2db

%pre
%_pre_useradd %{nsusr} /var/log/nagios /bin/sh

%postun
%_postun_userdel %{nsusr}

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc db docs/* Changelog README REQUIREMENTS TODO UPGRADING
%doc config/misccommands.cfg config/nagios.cfg README.urpmi
%{_initrddir}/ndo2db 
%config(noreplace) %{_sysconfdir}/nagios/ndomod.cfg
%config(noreplace) %{_sysconfdir}/nagios/ndo2db.cfg
%{_bindir}/file2sock
%{_bindir}/log2ndo
%{_bindir}/sockdebug
%{_sbindir}/ndo2db
%{_libdir}/nagios/brokers/ndomod.o
%attr(-,%{nsusr},%{nsgrp}) %{_localstatedir}/ndo



%changelog
* Thu May 15 2008 Guillaume Rousse <guillomovitch@mandriva.org> 1.4-0.b7.5mdv2008.0
+ Revision: 207542
- delete stale socket if present when starting
- LSB headers in initscript

* Thu Feb 14 2008 Oden Eriksson <oeriksson@mandriva.com> 1.4-0.b7.4mdv2008.1
+ Revision: 168650
- try to build it without the %%make macro
- rebuild

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

* Wed Dec 19 2007 Guillaume Rousse <guillomovitch@mandriva.org> 1.4-0.b7.3mdv2008.1
+ Revision: 133918
- no duplication of file perms in %%file section
- avoid useless intermediate copy of additional sources
- patch2: don't use prefix by default for database table names
  add README.urpmi

  + Thierry Vignaud <tvignaud@mandriva.com>
    - kill re-definition of %%buildroot on Pixel's request

* Mon Dec 17 2007 Guillaume Rousse <guillomovitch@mandriva.org> 1.4-0.b7.2mdv2008.1
+ Revision: 124217
- rediff configuration patch to fix log file location

* Mon Dec 17 2007 Guillaume Rousse <guillomovitch@mandriva.org> 1.4-0.b7.1mdv2008.1
+ Revision: 121724
- new version

* Fri Oct 12 2007 Oden Eriksson <oeriksson@mandriva.com> 1.4-0.b6.1mdv2008.1
+ Revision: 97496
- import ndoutils


* Fri Oct 12 2007 Oden Eriksson <oeriksson@mandriva.com> 1.4-0.b6.1mdv2008.0
- initial Mandriva package