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