]>
Commit | Line | Data |
---|---|---|
6e4444f9 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | ||
5 | %include /usr/lib/rpm/macros.perl | |
6 | %define plugin check_rbl | |
ea66c793 | 7 | Summary: Nagios plugin to check if an server is blacklisted in RBL servers |
6e4444f9 ER |
8 | Name: nagios-plugin-%{plugin} |
9 | Version: 1.1.0 | |
4f375f16 | 10 | Release: 4 |
6e4444f9 ER |
11 | License: GPL |
12 | Group: Networking | |
b62736fd | 13 | Source0: https://trac.id.ethz.ch/projects/nagios_plugins/downloads/%{plugin}-%{version}.tar.gz |
6e4444f9 ER |
14 | # Source0-md5: 724cd353d48df3f4e9a98743146cfd0f |
15 | Source1: %{plugin}.cfg | |
ea66c793 | 16 | # https://trac.id.ethz.ch/projects/nagios_plugins/ticket/67 |
07d90841 | 17 | Source2: %{plugin}.ini |
ea66c793 | 18 | # https://trac.id.ethz.ch/projects/nagios_plugins/ticket/66 |
b62736fd | 19 | Patch0: verbose-reporting.patch |
65afeb12 | 20 | Patch1: mdns.patch |
6e4444f9 | 21 | URL: https://trac.id.ethz.ch/projects/nagios_plugins/wiki/check_rbl |
871773f7 ER |
22 | BuildRequires: perl-ExtUtils-MakeMaker >= 6.42 |
23 | BuildRequires: rpm-perlprov >= 4.1-13 | |
6e4444f9 | 24 | BuildRequires: sed >= 4.0 |
6e4444f9 ER |
25 | %if %{with tests} |
26 | BuildRequires: perl-Nagios-Plugin | |
27 | BuildRequires: perl-Net-DNS | |
28 | BuildRequires: perl-Parallel-Iterator | |
29 | BuildRequires: perl-Readonly | |
30 | %endif | |
871773f7 | 31 | Requires: nagios-common |
6e4444f9 ER |
32 | BuildArch: noarch |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %define _noautoreq 'perl(utils)' | |
36 | ||
37 | %define _sysconfdir /etc/nagios/plugins | |
38 | %define plugindir %{_prefix}/lib/nagios/plugins | |
39 | ||
40 | %description | |
ea66c793 | 41 | Nagios plugin to check if an server is blacklisted in RBL servers. |
6e4444f9 ER |
42 | |
43 | %prep | |
44 | %setup -q -n %{plugin}-%{version} | |
b62736fd | 45 | %patch0 -p1 |
6e4444f9 | 46 | |
ea66c793 | 47 | # https://trac.id.ethz.ch/projects/nagios_plugins/ticket/68 |
6e4444f9 ER |
48 | %{__sed} -i -e ' |
49 | # no need for debug dependency | |
50 | /use Data::Dumper;/d | |
51 | ||
52 | # not needed, so kill to avoid extra dep | |
53 | /use version;/d | |
54 | ' %{plugin} | |
55 | ||
6fdea355 ER |
56 | %patch1 -p1 |
57 | ||
6e4444f9 ER |
58 | %build |
59 | %{__perl} Makefile.PL \ | |
60 | INSTALLVENDORSCRIPT=%{plugindir} \ | |
61 | INSTALLDIRS=vendor | |
62 | ||
63 | %{__make} | |
64 | %{?with_tests:%{__make} test} | |
65 | ||
66 | %install | |
67 | rm -rf $RPM_BUILD_ROOT | |
68 | %{__make} install \ | |
69 | DESTDIR=$RPM_BUILD_ROOT | |
70 | ||
71 | install -d $RPM_BUILD_ROOT%{_sysconfdir} | |
72 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg | |
07d90841 | 73 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.ini |
6e4444f9 ER |
74 | |
75 | rm -f $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod | |
76 | rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/check_rbl/.packlist | |
77 | rm -f $RPM_BUILD_ROOT%{perl_vendorlib}/check_rbl.pod | |
78 | ||
79 | %clean | |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | ||
82 | %files | |
83 | %defattr(644,root,root,755) | |
84 | %doc AUTHORS Changes NEWS README INSTALL TODO VERSION | |
85 | %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg | |
07d90841 | 86 | %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.ini |
6e4444f9 ER |
87 | %attr(755,root,root) %{plugindir}/%{plugin} |
88 | %{_mandir}/man3/*.3pm* |