]>
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 | 8 | Name: nagios-plugin-%{plugin} |
eddba0c3 AG |
9 | Version: 1.2.2 |
10 | Release: 1 | |
6e4444f9 ER |
11 | License: GPL |
12 | Group: Networking | |
b62736fd | 13 | Source0: https://trac.id.ethz.ch/projects/nagios_plugins/downloads/%{plugin}-%{version}.tar.gz |
eddba0c3 | 14 | # Source0-md5: d8d7003a310c165c4238a549b56cc388 |
6e4444f9 | 15 | Source1: %{plugin}.cfg |
07d90841 | 16 | Source2: %{plugin}.ini |
6e4444f9 | 17 | URL: https://trac.id.ethz.ch/projects/nagios_plugins/wiki/check_rbl |
871773f7 ER |
18 | BuildRequires: perl-ExtUtils-MakeMaker >= 6.42 |
19 | BuildRequires: rpm-perlprov >= 4.1-13 | |
6e4444f9 | 20 | BuildRequires: sed >= 4.0 |
6e4444f9 ER |
21 | %if %{with tests} |
22 | BuildRequires: perl-Nagios-Plugin | |
23 | BuildRequires: perl-Net-DNS | |
24 | BuildRequires: perl-Parallel-Iterator | |
25 | BuildRequires: perl-Readonly | |
26 | %endif | |
871773f7 | 27 | Requires: nagios-common |
6e4444f9 ER |
28 | BuildArch: noarch |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %define _noautoreq 'perl(utils)' | |
32 | ||
33 | %define _sysconfdir /etc/nagios/plugins | |
34 | %define plugindir %{_prefix}/lib/nagios/plugins | |
35 | ||
36 | %description | |
ea66c793 | 37 | Nagios plugin to check if an server is blacklisted in RBL servers. |
6e4444f9 ER |
38 | |
39 | %prep | |
40 | %setup -q -n %{plugin}-%{version} | |
41 | ||
ea66c793 | 42 | # https://trac.id.ethz.ch/projects/nagios_plugins/ticket/68 |
6e4444f9 | 43 | %{__sed} -i -e ' |
4012ac6d | 44 | s/use version;\s*// |
6e4444f9 ER |
45 | ' %{plugin} |
46 | ||
47 | %build | |
48 | %{__perl} Makefile.PL \ | |
49 | INSTALLVENDORSCRIPT=%{plugindir} \ | |
50 | INSTALLDIRS=vendor | |
51 | ||
52 | %{__make} | |
53 | %{?with_tests:%{__make} test} | |
54 | ||
55 | %install | |
56 | rm -rf $RPM_BUILD_ROOT | |
57 | %{__make} install \ | |
58 | DESTDIR=$RPM_BUILD_ROOT | |
59 | ||
60 | install -d $RPM_BUILD_ROOT%{_sysconfdir} | |
61 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg | |
07d90841 | 62 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.ini |
6e4444f9 ER |
63 | |
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 | |
67 | ||
68 | %clean | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | ||
71 | %files | |
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 | |
07d90841 | 75 | %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.ini |
6e4444f9 | 76 | %attr(755,root,root) %{plugindir}/%{plugin} |
b9cbc94d | 77 | %{_mandir}/man1/check_rbl.1* |