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