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