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