]> git.pld-linux.org Git - packages/nagios-nrpe.git/blob - nagios-nrpe.spec
- Obsoletes: netsaint-nrpe
[packages/nagios-nrpe.git] / nagios-nrpe.spec
1 Summary:        Nagios remote plugin execution service/plugin
2 Summary(pl):    Demon i wtyczka zdalnego wywo³ywania wtyczek Nagios
3 Name:           nagios-nrpe
4 Version:        2.0
5 Release:        1
6 License:        GPL v2
7 Group:          Networking
8 Source0:        http://dl.sourceforge.net/nagios/nrpe-%{version}.tar.gz
9 # Source0-md5:  70ef9502a3b7e49fa520dbceabfa04d0
10 Source1:        nrpe.init
11 URL:            http://www.nagios.org/
12 BuildRequires:  autoconf
13 BuildRequires:  automake
14 Requires(pre):  /usr/bin/getgid
15 Requires(pre):  /bin/id
16 Requires(pre):  /usr/sbin/groupadd
17 Requires(pre):  /usr/sbin/useradd
18 Requires(post,postun):  /sbin/chkconfig
19 Requires:       nagios-plugins
20 Obsoletes:      netsaint-nrpe
21 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
23 %define         _sysconfdir     /etc/nagios
24 %define         _datadir        %{_prefix}/share/%{name}
25 %define         _plugindir      %{_libdir}/nagios/plugins
26 %define         _localstatedir  %{_var}/log/nagios
27 %define         nsusr           nagios
28 %define         nsgrp           nagios
29 %define         nsport          5666
30
31 %description
32 Nagios nrpe allows you to remotely execute plugins on other hosts
33 and report the plugin output back to the monitoring host.
34
35 %description -l pl
36 Nagios npre pozwala zdalnie uruchamiaæ wtyczki na innych hostach,
37 a wynik ich dzia³ania zwracaæ spowrotem do hosta monitoruj±cego.
38
39 %package plugin
40 Summary:        check_nrpe plugin for Nagios
41 Summary(pl):    Wtyczka check_nrpe dla Nagiosa
42 Group:          Networking
43
44 %description plugin
45 check_nrpe plugin for Nagios. This plugin allows running plugins on
46 remote machines using nrpe service.
47
48 %description plugin -l pl
49 Wtyczka check_nrpe dla Nagiosa. Pozwala na zdalne uruchamianie
50 wtyczek na innych komputerach za pomoc± demona nrpe.
51
52 %prep
53 %setup -q -n nrpe-%{version}
54
55 %build
56 %{__aclocal}
57 %{__autoconf}
58
59 %configure \
60         --with-init-dir=/etc/rc.d/init.d \
61         --with-nrpe-port=%{nsport} \
62         --with-nrpe-user=%{nsusr} \
63         --with-nrpe-grp=%{nsgrp} \
64         --prefix=%{_prefix} \
65         --exec-prefix=%{_sbindir} \
66         --bindir=%{_sbindir} \
67         --libexecdir=%{_plugindir} \
68         --datadir=%{_prefix}/share/nagios \
69         --sysconfdir=%{_sysconfdir} \
70         --localstatedir=%{_localstatedir} 
71
72 %{__make} all
73
74 %install
75 rm -rf $RPM_BUILD_ROOT
76 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir},%{_libdir}/nagios/plugins,%{_sbindir}} \
77         $RPM_BUILD_ROOT%{_localstatedir}
78
79 install nrpe.cfg $RPM_BUILD_ROOT/etc/nagios/nrpe.cfg
80 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/nrpe
81 install src/nrpe $RPM_BUILD_ROOT%{_sbindir}
82 install src/check_nrpe $RPM_BUILD_ROOT%{_plugindir}
83
84 %clean
85 rm -rf $RPM_BUILD_ROOT
86
87 %pre
88 if [ -n "`getgid %{nsgrp}`" ]; then
89         if [ "`getgid %{nsgrp}`" != "72" ]; then
90                 echo "Error: group %{nsgrp} doesn't have gid=72. Correct this before installing %{name}." 1>&2
91                 exit 1
92         fi
93 else
94         /usr/sbin/groupadd -g 72 -f %{nsgrp}
95 fi
96 if [ -n "`id -u %{nsusr} 2>/dev/null`" ]; then
97         if [ "`id -u %{nsusr}`" != "72" ]; then
98                 echo "Error: user %{nsusr} doesn't have uid=72. Correct this before installing %{name}." 1>&2
99                 exit 1
100         fi
101 else
102         /usr/sbin/useradd -u 72 -d %{_libdir}/%{name} -s /bin/false -c "%{name} User" -g %{nsgrp} %{nsusr} 1>&2
103 fi
104
105 %post
106 /sbin/chkconfig --add %{name}
107 if [ -f /var/lock/subsys/%{name} ]; then
108         /etc/rc.d/init.d/%{name} restart 1>&2
109 fi
110
111 %preun
112 if [ "$1" = "0" ] ; then
113         if [ -f /var/lock/subsys/%{name} ]; then
114                 /etc/rc.d/init.d/%{name} stop 1>&2
115         fi
116         /sbin/chkconfig --del %{name}
117 fi
118
119 %postun
120 if [ "$1" = "0" ]; then
121         /usr/sbin/userdel %{nsusr}
122         /usr/sbin/groupdel %{nsgrp}
123 fi
124
125 %files
126 %defattr(644,root,root,755)
127 %doc Changelog LEGAL README* SECURITY
128 %attr(754,root,root) /etc/rc.d/init.d/%{name}
129 %attr(751,root,%{nsgrp}) %dir %{_sysconfdir}
130 %attr(644,root,%{nsgrp}) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/nrpe.cfg
131 %attr(755,root,root) %{_sbindir}/nrpe
132
133 %files plugin
134 %defattr(644,root,root,755)
135 %dir %{_plugindir}
136 %attr(755,root,root) %{_plugindir}/*
This page took 0.067911 seconds and 4 git commands to generate.