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