Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release-src > by-pkgid > 2517f6a3157a3be9a6bbdea7ed322b75 > files > 6

ndoutils-2.0.0-3.mga5.src.rpm

%define _disable_ld_no_undefined 1

%define nsusr nagios
%define nsgrp nagios

Summary:	Nagios Data Output Utilities
Name:		ndoutils
Version:	2.0.0
Release:	%mkrel 3
Group:		System/Servers
License:	GPL
URL:		http://www.nagios.org/
Source0:	http://downloads.sourceforge.net/nagios/ndoutils-%{version}.tar.gz
Source1:	ndo2db.service
Source2:	ndo2db.tmpfiles
Patch0:		ndoutils-2.0.0-mageia-config.patch
Patch1:		ndoutils-1.5.2-fix-format-errors.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

%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.

%package common
Summary:    The part common to client and server parts
Group:		System/Servers

%description common
This package contains the part common to client and server parts.

%package client
Summary:    The client part of %{name}
Group:		System/Servers
Requires:   %{name}-common = %{version}-%{release}

%description client
This package contains the client part of NDOUTILS (Nagios Data Output Utils).

%package server
Summary:    The server part of %{name}
Group:		System/Servers
Requires:   %{name}-common = %{version}-%{release}

%description server
This package contains the server part of NDOUTILS (Nagios Data Output Utils).

%prep
%setup -q
#patch0 -p1
%patch1 -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}

make

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

install -m 755 src/ndo2db-3x %{buildroot}%{_sbindir}/ndo2db
install -m 755 src/file2sock %{buildroot}%{_bindir}/file2sock
install -m 755 src/log2ndo %{buildroot}%{_bindir}/log2ndo
install -m 755 src/sockdebug %{buildroot}%{_bindir}/sockdebug
install -m 755 src/ndomod-3x.o %{buildroot}%{_libdir}/nagios/brokers/ndomod.o
install -m 644 config/ndomod.cfg-sample \
    %{buildroot}%{_sysconfdir}/nagios/ndomod.cfg
install -m 644 config/ndo2db.cfg-sample \
    %{buildroot}%{_sysconfdir}/nagios/ndo2db.cfg

install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/ndo2db.service
install -D -m 644 %{SOURCE2} %{buildroot}%{_prefix}/lib/tmpfiles.d/ndo2db.conf

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

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 server
%_post_service ndo2db

%preun server
%_preun_service ndo2db

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

%postun common
%_postun_userdel %{nsusr}

%files common
%doc db docs/* Changelog README REQUIREMENTS TODO UPGRADING
%doc config/misccommands.cfg config/nagios.cfg README.urpmi
%attr(-,%{nsusr},%{nsgrp}) %{_localstatedir}/lib/ndo

%files client
%{_bindir}/file2sock
%{_bindir}/log2ndo
%{_bindir}/sockdebug
%{_libdir}/nagios/brokers/ndomod.o
%config(noreplace) %{_sysconfdir}/nagios/ndomod.cfg

%files server
%{_unitdir}/ndo2db.service
%{_prefix}/lib/tmpfiles.d/ndo2db.conf
%config(noreplace) %{_sysconfdir}/nagios/ndo2db.cfg
%{_sbindir}/ndo2db


%changelog
* Wed Oct 15 2014 umeabot <umeabot> 2.0.0-3.mga5
+ Revision: 751197
- Second Mageia 5 Mass Rebuild

* Tue Sep 16 2014 umeabot <umeabot> 2.0.0-2.mga5
+ Revision: 682823
- Mageia 5 Mass Rebuild

* Tue Aug 05 2014 guillomovitch <guillomovitch> 2.0.0-1.mga5
+ Revision: 659759
- new version 2.0.0

* Fri Aug 01 2014 guillomovitch <guillomovitch> 1.5.2-1.mga5
+ Revision: 658902
- new version 1.5.2

* Fri Oct 18 2013 umeabot <umeabot> 1.5.1-4.mga4
+ Revision: 508258
- Mageia 4 Mass Rebuild
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Wed Sep 05 2012 guillomovitch <guillomovitch> 1.5.1-2.mga3
+ Revision: 288588
- use its own /run/ndo2db directory, instead of /run/nagios

* Tue Jun 05 2012 guillomovitch <guillomovitch> 1.5.1-1.mga3
+ Revision: 255982
- imported package ndoutils