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