check_postgres/check_postgres.spec
Lars Vogdt 6bb0a0f82d - Update to 2.23.0:
+ added support for PostgreSQL 10
  + Change table_size to use pg_table_size() on 9.0+
  + Connection errors are now always critical, not unknown
  + New action replication_slots checking if logical or physical 
    replication slots have accumulated too much data
  + Multiple same_schema improvements
  + Add Spanish message translations
  + Allow a wrapper function to run wal_files and archive_ready 
    actions as non-superuser
  + Add some defensive casting to the bloat query
  + Invoke psql with option -X
  + check_txn_idle: Don't fail when query contains 'disabled' word
  + check_txn_idle: Use state_change instead of query_start.
  + check_hot_standby_delay: Correct extra space in perfdata
  + Remove \r from psql output as it can confuse some regexes
  + Sort failed jobs in check_pgagent_jobs for stable output
- run spec cleaner
- use %%license for newer distributions

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/check_postgres?expand=0&rev=15
2018-03-21 12:32:29 +00:00

121 lines
3.8 KiB
RPMSpec

#
# spec file for package check_postgres
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: check_postgres
Version: 2.23.0
Release: 0
Summary: Postgres monitoring script
License: GPL-2.0+
Group: System/Monitoring
Url: http://bucardo.org/wiki/Check_postgres
# https://github.com/bucardo/check_postgres/releases
Source0: %{name}-%{version}.tar.gz
Source1: nagios-commands-postgres.cfg
Source2: create_manpage.pl
BuildRequires: nagios-rpm-macros
BuildRequires: perl-macros
BuildRequires: perl(Cwd)
BuildRequires: perl(DBD::Pg)
BuildRequires: perl(DBI)
BuildRequires: perl(Data::Dumper)
BuildRequires: perl(Date::Parse)
BuildRequires: perl(Digest::MD5)
BuildRequires: perl(File::Basename)
BuildRequires: perl(File::Temp)
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(Pod::Man)
BuildRequires: perl(Time::HiRes)
Requires: perl = %{perl_version}
Requires: postgresql
Requires: perl(Cwd)
Requires: perl(Data::Dumper)
Requires: perl(File::Basename)
Requires: perl(File::Temp)
Requires: perl(Getopt::Long)
Requires: perl(Time::HiRes)
Recommends: coreutils
Recommends: util-linux
Recommends: perl(Date::Parse)
Recommends: perl(Digest::MD5)
BuildArch: noarch
%description
check_postgres.pl is a Perl script that runs many different tests against one
or more Postgres databases. It uses the psql program to gather the information,
and outputs the results in one of three formats: Nagios, MRTG, or simple.
%package -n monitoring-plugins-postgres
Summary: Postgres monitoring script using check_postgres.pl
Group: System/Monitoring
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: %{name} = %{version}
Provides: nagios-plugins-postgres = %{version}-%{release}
Obsoletes: nagios-plugins-postgres < %{version}-%{release}
%description -n monitoring-plugins-postgres
This package contains the symlinks to execute special checks via the standard
monitoring plugins way.
%prep
%setup -q
install -m 0644 %{SOURCE1} nagios-commands-postgres.cfg
%build
perl Makefile.PL
make %{?_smp_mflags}
%install
# install the module
%perl_make_install
# do not perl_process_packlist (noarch)
# remove .packlist file
rm -rf %{buildroot}%{perl_vendorarch}
# remove perllocal.pod file
rm -rf %{buildroot}%{perl_archlib}
%perl_gen_filelist
# create symlinks for monitoring-plugins-postgres package
mkdir -p %{buildroot}%{nagios_plugindir}
pushd %{buildroot}%{nagios_plugindir}
%{buildroot}%{_bindir}/check_postgres.pl --symlinks
# fix symlinks, as they point to the buildroot
for link in *; do
rm "$link"
ln -s "%{_bindir}/check_postgres.pl" "$link"
done
popd
# create man page
mkdir -p %{buildroot}/%{_mandir}/man1
perl %{SOURCE2} "%{version}" "1" check_postgres.pl > %{buildroot}/%{_mandir}/man1/check_postgres.pl.1
%files -f %{name}.files
%doc MANIFEST README* TODO nagios-commands-postgres.cfg check_postgres.pl.html
%if 0%{?suse_version} > 1315
%license LICENSE
%else
%doc LICENSE
%endif
%{_mandir}/man1/check_postgres.pl.1*
%files -n monitoring-plugins-postgres
# avoid build dependecy of nagios - own the dirs
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%{nagios_plugindir}/*
%changelog