Monitoring Plugin pkg added
This commit is contained in:
@@ -1,81 +1,74 @@
|
||||
#
|
||||
# spec file for package perl-Nagios-Plugin
|
||||
#
|
||||
|
||||
# You can easy replace the Nagios::Plugin entries in scripts:
|
||||
# sed -i -e 's/Nagios::Plugin/Monitoring::Plugin/g' *.pl
|
||||
|
||||
%define cpan_name Monitoring-Plugin
|
||||
|
||||
Name: perl-%cpan_name
|
||||
Summary: A family of perl modules to streamline writing Nagios plugins
|
||||
License: Artistic-1.0 ; GPL-2.0+
|
||||
Group: Development/Languages/Perl
|
||||
Version: 0.39
|
||||
Release: 1%{?dist}
|
||||
Url: http://search.cpan.org/dist/Monitoring-Plugin/
|
||||
Provides: %cpan_name = %{version}-%{release}
|
||||
Provides: Nagios-Plugin
|
||||
Obsoletes: perl-Nagios-Plugin
|
||||
Requires: perl-Class-Accessor
|
||||
Requires: perl-Config-Tiny
|
||||
Requires: perl-Math-Calc-Units
|
||||
Requires: perl-Params-Validate
|
||||
BuildRequires: perl
|
||||
BuildRequires: perl-Module-Install
|
||||
BuildRequires: perl-Class-Accessor
|
||||
BuildRequires: perl-Config-Tiny
|
||||
BuildRequires: perl-Params-Validate
|
||||
BuildRequires: perl-ExtUtils-MakeMaker
|
||||
BuildRequires: perl-macros
|
||||
Source: %cpan_name-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Name: perl-Monitoring-Plugin
|
||||
Version: 0.40
|
||||
Release: 4%{?dist}
|
||||
Summary: Family of modules to streamline writing plugins for various monitoring systems
|
||||
License: GPL+ or Artistic
|
||||
URL: https://metacpan.org/release/Monitoring-Plugin
|
||||
Source0: https://cpan.metacpan.org/authors/id/N/NI/NIERLEIN/Monitoring-Plugin-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
# Build
|
||||
BuildRequires: coreutils
|
||||
BuildRequires: make
|
||||
BuildRequires: perl-interpreter
|
||||
BuildRequires: perl-generators
|
||||
BuildRequires: perl(inc::Module::Install)
|
||||
BuildRequires: perl(Module::Install::Metadata)
|
||||
BuildRequires: perl(Module::Install::WriteAll)
|
||||
BuildRequires: sed
|
||||
# Runtime
|
||||
BuildRequires: perl(base)
|
||||
BuildRequires: perl(Carp)
|
||||
BuildRequires: perl(Class::Accessor)
|
||||
BuildRequires: perl(Class::Accessor::Fast)
|
||||
BuildRequires: perl(Config::Tiny)
|
||||
BuildRequires: perl(constant)
|
||||
BuildRequires: perl(Exporter)
|
||||
BuildRequires: perl(File::Basename)
|
||||
BuildRequires: perl(File::Spec)
|
||||
BuildRequires: perl(Getopt::Long)
|
||||
BuildRequires: perl(Math::Calc::Units)
|
||||
BuildRequires: perl(overload)
|
||||
BuildRequires: perl(Params::Validate)
|
||||
BuildRequires: perl(strict)
|
||||
BuildRequires: perl(warnings)
|
||||
# Tests only
|
||||
BuildRequires: perl(Data::Dumper)
|
||||
BuildRequires: perl(IO::File)
|
||||
BuildRequires: perl(Test::More)
|
||||
BuildRequires: perl(vars)
|
||||
Requires: perl(:MODULE_COMPAT_%(eval "$(perl -V:version)"; echo $version))
|
||||
|
||||
%description
|
||||
Monitoring::Plugin and its associated Monitoring::Plugin::* modules are a family of
|
||||
perl modules to streamline writing Monitoring plugins. The main end user modules
|
||||
are Monitoring::Plugin, providing an object-oriented interface to the entire
|
||||
Monitoring::Plugin::* collection, and Monitoring::Plugin::Functions, providing a
|
||||
simpler functional interface to a useful subset of the available functionality.
|
||||
|
||||
The purpose of the collection is to make it as simple as possible for
|
||||
developers to create plugins that conform the Monitoring Plugin guidelines
|
||||
(http://nagiosplug.sourceforge.net/developer-guidelines.html).
|
||||
Monitoring::Plugin and its associated Monitoring::Plugin::* modules are a
|
||||
family of perl modules to streamline writing Monitoring plugins. The main
|
||||
end user modules are Monitoring::Plugin, providing an object-oriented
|
||||
interface to the entire Monitoring::Plugin::* collection, and
|
||||
Monitoring::Plugin::Functions, providing a simpler functional interface to
|
||||
a useful subset of the available functionality.
|
||||
|
||||
%prep
|
||||
%setup -q -n %cpan_name-%{version}
|
||||
%setup -q -n Monitoring-Plugin-%{version}
|
||||
# Remove bundled modules
|
||||
rm -r ./inc/*
|
||||
sed -i -e '/^inc\//d' MANIFEST
|
||||
|
||||
%build
|
||||
perl Makefile.PL OPTIMIZE="%{optflags} -Wall"
|
||||
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%if 0%{?fedora} > 18 && 0%{?rhel} >= 6 && 0%{?suse_version} >= 1010
|
||||
%install
|
||||
make pure_install DESTDIR=%{buildroot}
|
||||
%{_fixperms} %{buildroot}/*
|
||||
|
||||
%check
|
||||
make test
|
||||
%endif
|
||||
|
||||
%install
|
||||
%perl_make_install
|
||||
%perl_process_packlist
|
||||
|
||||
%post
|
||||
# only execute the replacement, if it is an update!
|
||||
if [ -d "/usr/lib64/nagios/plugins" ]; then
|
||||
cd /usr/lib64/nagios/plugins && \
|
||||
for f in `grep -l 'Nagios::Plugin' *`; do sed -i -e 's/Nagios::Plugin/Monitoring::Plugin/g' $f; done
|
||||
elif [ -d "/usr/lib/nagios/plugins" ]; then
|
||||
cd /usr/lib/nagios/plugins && \
|
||||
for f in `grep -l 'Nagios::Plugin' *`; do sed -i -e 's/Nagios::Plugin/Monitoring::Plugin/g' $f; done
|
||||
fi
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc Changes MANIFEST README
|
||||
%doc %{_mandir}/man?/*
|
||||
%{perl_vendorlib}/Monitoring
|
||||
%{perl_vendorarch}/auto/Monitoring
|
||||
|
||||
%doc Changes notes README
|
||||
%{perl_vendorlib}/*
|
||||
%{_mandir}/man3/*
|
||||
|
||||
%changelog
|
||||
* Fri Mar 25 2016 <elpito@bluewin.ch>
|
||||
- New initial package, but is forked of perl-Nagios-Plugin.
|
||||
* Fri Dec 13 2019 Daniel Steiner <daniel.steiner@dsteiner.ch>
|
||||
- Initial packaging
|
||||
|
||||
Reference in New Issue
Block a user