3 %bcond_without tests # do not perform "make test"
5 %include /usr/lib/rpm/macros.perl
6 %define plugin check_rbl
7 Summary: Nagios plugin to check if an server is blacklisted in RBL servers
8 Name: nagios-plugin-%{plugin}
13 Source0: https://trac.id.ethz.ch/projects/nagios_plugins/downloads/%{plugin}-%{version}.tar.gz
14 # Source0-md5: 630902d9d7b644a0ab6537030ec40f12
15 Source1: %{plugin}.cfg
16 Source2: %{plugin}.ini
17 URL: https://trac.id.ethz.ch/projects/nagios_plugins/wiki/check_rbl
18 BuildRequires: perl-ExtUtils-MakeMaker >= 6.42
19 BuildRequires: rpm-perlprov >= 4.1-13
20 BuildRequires: sed >= 4.0
22 BuildRequires: perl-Nagios-Plugin
23 BuildRequires: perl-Net-DNS
24 BuildRequires: perl-Parallel-Iterator
25 BuildRequires: perl-Readonly
27 Requires: nagios-common
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 %define _noautoreq 'perl(utils)'
33 %define _sysconfdir /etc/nagios/plugins
34 %define plugindir %{_prefix}/lib/nagios/plugins
37 Nagios plugin to check if an server is blacklisted in RBL servers.
40 %setup -q -n %{plugin}-%{version}
42 # https://trac.id.ethz.ch/projects/nagios_plugins/ticket/68
48 %{__perl} Makefile.PL \
49 INSTALLVENDORSCRIPT=%{plugindir} \
53 %{?with_tests:%{__make} test}
56 rm -rf $RPM_BUILD_ROOT
58 DESTDIR=$RPM_BUILD_ROOT
60 install -d $RPM_BUILD_ROOT%{_sysconfdir}
61 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg
62 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.ini
64 rm -f $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
65 rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/check_rbl/.packlist
66 rm -f $RPM_BUILD_ROOT%{perl_vendorlib}/check_rbl.pod
69 rm -rf $RPM_BUILD_ROOT
72 %defattr(644,root,root,755)
73 %doc AUTHORS Changes NEWS README INSTALL TODO VERSION
74 %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg
75 %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.ini
76 %attr(755,root,root) %{plugindir}/%{plugin}
77 %{_mandir}/man1/check_rbl.1*