~ubuntu-branches/ubuntu/karmic/nagios-nrpe/karmic

« back to all changes in this revision

Viewing changes to nrpe.spec

  • Committer: Bazaar Package Importer
  • Author(s): Jason Thomas
  • Date: 2004-05-15 12:02:35 UTC
  • Revision ID: james.westby@ubuntu.com-20040515120235-52bbrpj39ss7wlvu
Tags: upstream-2.0
ImportĀ upstreamĀ versionĀ 2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%define name nrpe
 
2
%define version 2.0
 
3
%define release 1
 
4
%define nsusr nagios
 
5
%define nsgrp nagios
 
6
%define nsport 5666
 
7
 
 
8
# Reserve option to override port setting with:
 
9
# rpm -ba|--rebuild --define 'nsport 5666'
 
10
%{?port:%define nsport %{port}}
 
11
 
 
12
# Macro that print mesages to syslog at package (un)install time
 
13
%define nnmmsg logger -t %{name}/rpm
 
14
 
 
15
Summary: Host/service/network monitoring agent for Nagios
 
16
URL: http://www.nagios.org
 
17
Name: %{name}
 
18
Version: %{version}
 
19
Release: %{release}
 
20
Copyright: GPL
 
21
Group: Application/System
 
22
Source0: %{name}-%{version}.tar.gz
 
23
BuildRoot: %{_tmppath}/%{name}-buildroot
 
24
Prefix: %{_prefix}
 
25
Prefix: /etc/init.d
 
26
Prefix: /etc/nagios
 
27
Requires: bash, grep, nagios-plugins
 
28
PreReq: /usr/bin/logger, chkconfig, sh-utils, shadow-utils, sed, initscripts, fileutils, mktemp
 
29
 
 
30
%description
 
31
Nrpe is a system daemon that will execute various Nagios plugins
 
32
locally on behalf of a remote (monitoring) host that uses the
 
33
check_nrpe plugin.  Various plugins that can be executed by the 
 
34
daemon are available at:
 
35
http://sourceforge.net/projects/nagiosplug
 
36
 
 
37
This package provides the core agent.
 
38
 
 
39
%package plugin
 
40
Group: Application/System
 
41
Summary: Provides nrpe plugin for Nagios.
 
42
Requires: nagios-plugins
 
43
 
 
44
%description plugin
 
45
Nrpe is a system daemon that will execute various Nagios plugins
 
46
locally on behalf of a remote (monitoring) host that uses the
 
47
check_nrpe plugin.  Various plugins that can be executed by the 
 
48
daemon are available at:
 
49
http://sourceforge.net/projects/nagiosplug
 
50
 
 
51
This package provides the nrpe plugin for Nagios-related applications.
 
52
 
 
53
%prep
 
54
%setup -q
 
55
 
 
56
 
 
57
%pre
 
58
# Create `nagios' user on the system if necessary
 
59
if id %{nsusr} ; then
 
60
        : # user already exists
 
61
else
 
62
        /usr/sbin/useradd -r -d /var/log/nagios -s /bin/sh -c "%{nsusr}" -g %{nsgrp} %{nsusr} || \
 
63
                %nnmmsg Unexpected error adding user "%{nsusr}". Aborting install process.
 
64
fi
 
65
 
 
66
# if LSB standard /etc/init.d does not exist,
 
67
# create it as a symlink to the first match we find
 
68
if [ -d /etc/init.d -o -L /etc/init.d ]; then
 
69
  : # we're done
 
70
elif [ -d /etc/rc.d/init.d ]; then
 
71
  ln -s /etc/rc.d/init.d /etc/init.d
 
72
elif [ -d /usr/local/etc/rc.d ]; then
 
73
  ln -s  /usr/local/etc/rc.d /etc/init.d
 
74
elif [ -d /sbin/init.d ]; then
 
75
  ln -s /sbin/init.d /etc/init.d
 
76
fi
 
77
 
 
78
 
 
79
%preun
 
80
if [ "$1" = 0 ]; then
 
81
        /sbin/service nrpe stop > /dev/null 2>&1
 
82
        /sbin/chkconfig --del nrpe
 
83
fi
 
84
 
 
85
%postun
 
86
if [ "$1" -ge "1" ]; then
 
87
        /sbin/service nrpe condrestart >/dev/null 2>&1 || :
 
88
fi
 
89
 
 
90
%build
 
91
export PATH=$PATH:/usr/sbin
 
92
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \
 
93
./configure \
 
94
        --with-init-dir=/etc/init.d \
 
95
        --with-nrpe-port=%{nsport} \
 
96
        --with-nrpe-user=%{nsusr} \
 
97
        --with-nrpe-grp=%{nsgrp} \
 
98
        --prefix=%{_prefix} \
 
99
        --exec-prefix=%{_prefix}/sbin \
 
100
        --bindir=%{_prefix}/sbin \
 
101
        --sbindir=%{_prefix}/lib/nagios/cgi \
 
102
        --libexecdir=%{_prefix}/lib/nagios/plugins \
 
103
        --datadir=%{_prefix}/share/nagios \
 
104
        --sysconfdir=/etc/nagios \
 
105
        --localstatedir=/var/log/nagios 
 
106
 
 
107
make all
 
108
 
 
109
%install
 
110
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
 
111
install -d -m 0755 ${RPM_BUILD_ROOT}/etc/init.d
 
112
install -d -m 0755 ${RPM_BUILD_ROOT}/etc/nagios
 
113
install -d -m 0755 ${RPM_BUILD_ROOT}/usr/sbin
 
114
install -d -m 0755 ${RPM_BUILD_ROOT}/usr/lib/nagios/plugins
 
115
 
 
116
# install templated configuration files
 
117
cp nrpe.cfg ${RPM_BUILD_ROOT}/etc/nagios/nrpe.cfg
 
118
cp init-script ${RPM_BUILD_ROOT}/etc/init.d/nrpe
 
119
cp src/nrpe ${RPM_BUILD_ROOT}/usr/sbin
 
120
cp src/check_nrpe ${RPM_BUILD_ROOT}/usr/lib/nagios/plugins
 
121
 
 
122
%clean
 
123
rm -rf $RPM_BUILD_ROOT
 
124
 
 
125
 
 
126
%files
 
127
%defattr(755,root,root)
 
128
/etc/init.d/nrpe
 
129
%{_prefix}/sbin/nrpe
 
130
%dir /etc/nagios
 
131
%defattr(644,root,root)
 
132
%config(noreplace) /etc/nagios/*.cfg
 
133
%defattr(755,%{nsusr},%{nsgrp})
 
134
%doc Changelog LEGAL README 
 
135
 
 
136
%files plugin
 
137
%defattr(755,root,root)
 
138
%{_prefix}/lib/nagios/plugins
 
139
%defattr(755,%{nsusr},%{nsgrp})
 
140
%doc Changelog LEGAL README
 
141
 
 
142
%changelog
 
143
* Tue Jan 07 2003 James 'Showkilr' Peterson <showkilr@showkilr.com>
 
144
- Removed the lines which removed the nagios user and group from the system
 
145
- changed the patch release version from 3 to 1
 
146
 
 
147
* Mon Jan 06 2003 James 'Showkilr' Peterson <showkilr@showkilr.com>
 
148
- Removed patch files required for nrpe 1.5
 
149
- Update spec file for version 1.6 (1.6-1)
 
150
 
 
151
* Sat Dec 28 2002 James 'Showkilr' Peterson <showkilr@showkilr.com>
 
152
- First RPM build (1.5-1)