SHA256
1
0
forked from pool/pgbadger
pgbadger/pgbadger.spec
Emiliano Langella 28423a5bac Accepting request 1130189 from home:lrupp:branches:server:database:postgresql
Move the cron and systemd files out into the documentation directory and 
include an extended README.SUSE to show how to work with them.


- update to 12.3
  This is a maintenance release of pgBadger that fixes issues reported by
  users since last release. It also adds some new features:
  * Add option --include-pid to only report events related to a session
    pid (%p). Can be used multiple time. Thanks to Henrietta Dombrovskaya
    for the feature request.
  * Add option --include-session to only report events related to the
    session id (%c). Can be used multiple time. Thanks to Henrietta Dombrovskaya
    for the feature request.
  * Add option --dump-raw-csv to only parse the log and dump the information
    into CSV format. No further processing is done, no report is generated.
    Thanks to Henrietta Dombrovskaya for the feature request.
  Here is the complete list of changes and acknowledgments:
  * Update pgFormatter to version 5.5
  * Fix end date of parsing with jsonlog format. Thanks to jw1u1 for the report.
  * Fix typo in "Sessions per application". Thanks to fairyfar for the patch.
  * Fix "INSERT/UPDATE/DELETE Traffic" chart bug. Thanks to fairyfar for the
    patch.
  * Fix parsing of orphan lines with bind queries. Thanks to youxq for the
    report.
  * Fix Analyze per table report with new PG versions. Thanks to Jean-Christophe
    Arnu for the patch.
  * Fix syslog entry parser when the syslog timestamp contains milliseconds.
    Thanks to Pavel Rabel for the report.
- add systemd timer examples: beside the existing cron job example, this 
  allows people to get an idea how to automate the generation of reports
- introduce local cron macro: only recommend cron on older distributions 
  and leave the cron example file where it was historically (but place it 
  into the examples folder on newer distributions).
- get rid of old suse_version 11.3 check

OBS-URL: https://build.opensuse.org/request/show/1130189
OBS-URL: https://build.opensuse.org/package/show/server:database:postgresql/pgbadger?expand=0&rev=4
2023-12-07 08:21:48 +00:00

147 lines
4.6 KiB
RPMSpec

#
# spec file for package pgbadger
#
# Copyright (c) 2013-2015 Lars Vogdt
#
# 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/
#
%if 0%{?is_opensuse}
%bcond_without jsonxs
%else
%bcond_with jsonxs
%endif
%if 0%{?suse_version} > 01510
%bcond_without cron
%else
%bcond_with cron
%endif
Name: pgbadger
Version: 12.3
Release: 0
License: MIT
Summary: A fast PostgreSQL log analyzer
Url: https://pgbadger.darold.net/
Group: System/Monitoring
Source0: https://github.com/darold/%{name}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: %{name}-cron
Source2: %{name}-rpmlintrc
Source3: %{name}.timer
Source4: %{name}.service
Source5: README.SUSE
BuildRequires: cron
BuildRequires: perl
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(IO::File)
BuildRequires: perl(Pod::Markdown)
BuildRequires: perl(Benchmark)
BuildRequires: perl(File::Basename)
BuildRequires: perl(Time::Local)
BuildRequires: perl(Text::CSV_XS)
%if %{with jsonxs}
BuildRequires: perl(JSON::XS)
%endif
BuildRequires: sed
Requires: perl(Getopt::Long)
Requires: perl(IO::File)
Requires: perl(Benchmark)
Requires: perl(File::Basename)
Requires: perl(Storable)
Requires: perl(File::Spec)
Requires: perl(File::Temp)
Requires: perl(IO::Handle)
Requires: perl(IO::Pipe)
Requires: perl(FileHandle)
Requires: perl(Socket)
Requires: perl(Encode)
Requires: perl(Text::Wrap)
Requires: perl(Time::Local)
Requires: perl = %{perl_version}
%if %{with cron}
Recommends: cron
%endif
# handle package rename at 2023-11-27:
Obsoletes: PgBadger < %{version}
Provides: PgBadger = %{version}-%{release}
#
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
pgBadger is a PostgreSQL log analyzer build for speed with fully detailed
reports from your PostgreSQL log file. It's a single and small Perl script that
aims to replace and outperform the old php script pgFouine.
By the way, we would like to thank Guillaume Smet for all the work he has done
on this really nice tool. We've been using it a long time, it was a really
great tool!
pgBadger is written in pure Perl language. It uses a javascript library to draw
graphs so that you don't need additional Perl modules or any other package to
install. Furthermore, this library gives us more features such as zooming.
pgBadger is able to autodetect your log file format (syslog, stderr or csvlog).
It is designed to parse huge log files as well as gzip compressed file.
%prep
%autosetup -p1
sed -i "s|/usr/bin/env perl|%{_bindir}/perl|g" pgbadger tools/pgbadger_tools
chmod -x tools/pgbadger_tools
%build
perl Makefile.PL
make %{?_smp_mflags}
%if %{with jsonxs}
%check
make test
%endif
%install
%perl_make_install
%perl_process_packlist
rmdir %{buildroot}%{perl_vendorarch} || :
# prepare docdir and install examples and documentation files
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}/examples/
mv tools %{buildroot}%{_defaultdocdir}/%{name}/
mv ChangeLog README* %{buildroot}%{_defaultdocdir}/%{name}/
%if %{with cron}
# keep the old behavior for now and install the cron job example into the cron directory:
install -Dm 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/cron.d/%{name}
%else
install -m 0644 %{SOURCE1} %{buildroot}%{_defaultdocdir}/%{name}/examples/pgbadger-cron.sh
%endif
# install systemd-timer examples into the documentation directory: leave it to our
# customers to decide, if and how they want to use them
install -m 0644 %{SOURCE3} %{buildroot}%{_defaultdocdir}/%{name}/examples/
install -m 0644 %{SOURCE4} %{buildroot}%{_defaultdocdir}/%{name}/examples/
install -m 0644 %{SOURCE5} %{buildroot}%{_defaultdocdir}/%{name}/
%perl_gen_filelist
%files -f %{name}.files
%license LICENSE
%defattr(-, root, root, -)
%dir %{_defaultdocdir}/%{name}
%dir %{_defaultdocdir}/%{name}/tools
%dir %{_defaultdocdir}/%{name}/examples
%{_defaultdocdir}/%{name}/*
%{_bindir}/pgbadger
%{_mandir}/man1/pgbadger.1*
%if %{with cron}
%config(noreplace) %{_sysconfdir}/cron.d/%{name}
%endif
%changelog