# # 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 Name: PgBadger Version: 12.2 Release: 0 License: MIT Summary: A fast PostgreSQL log analyzer Url: https://pgbadger.darold.net/ Group: System/Monitoring Source0: https://github.com/darold/pgbadger/archive/refs/tags/v%{version}.tar.gz#/pgbadger-%{version}.tar.gz Source1: pgbadger-cron 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} Recommends: cron 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 %setup -n pgbadger-%version 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} || : install -Dm 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/cron.d/%{name} %if 0%{?suse_version} >= 01130 %perl_gen_filelist %endif %if 0%{?suse_version} >= 01130 %files -f %{name}.files %defattr(-, root, root, -) %doc ChangeLog README* tools %license LICENSE %else %files %defattr(-, root, root, -) %doc ChangeLog README* LICENSE tools %{_bindir}/pgbadger %dir %{perl_vendorarch}/auto/pgBadger %{perl_vendorarch}/auto/pgBadger/.packlist %{_mandir}/man1/pgbadger.1* /var/adm/perl-modules/pgbadger %endif %config(noreplace) %{_sysconfdir}/cron.d/%{name} %changelog