1 |
# $Id: smeserver-nagios-nsca.spec,v 1.3 2008/04/02 15:03:58 slords Exp $ |
2 |
# Authority: mweinber |
3 |
# Name: Michael Weinberger |
4 |
|
5 |
Summary: Nagios nsca integration |
6 |
%define name smeserver-nagios-nsca |
7 |
Name: %{name} |
8 |
%define version 1.0.1 |
9 |
%define release 0 |
10 |
Version: %{version} |
11 |
Release: %{release}%{?dist} |
12 |
License: GPL |
13 |
Group: Applications/System |
14 |
Source: %{name}-%{version}.tar.gz |
15 |
BuildRoot: /var/tmp/%{name}-buildroot/ |
16 |
BuildArch: noarch |
17 |
Requires: smeserver-release >= 7.1.3 |
18 |
Requires: nagios-nsca >= 2.6 |
19 |
BuildRequires: e-smith-devtools |
20 |
AutoReq: no |
21 |
|
22 |
%changelog |
23 |
* Thu Oct 1 2007 Michael Weinberger <mweinber@neddix.de> |
24 |
- Initial release |
25 |
|
26 |
%description |
27 |
Nagios nsca integration |
28 |
|
29 |
Setting the TCP wrapper allowed hosts: |
30 |
config setprop nsca HostsAllow "127.0.0.1 10.203.104.0/255.255.252.0 172.22.32.0/255.255.240.0" |
31 |
expand-template /etc/hosts.allow |
32 |
|
33 |
|
34 |
%prep |
35 |
%setup -q -n %{name}-%{version} |
36 |
|
37 |
%build |
38 |
|
39 |
%install |
40 |
rm -rf $RPM_BUILD_ROOT |
41 |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
42 |
rm -f %{name}-%{version}-filelist |
43 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
44 |
>> %{name}-%{version}-filelist |
45 |
find $RPM_BUILD_ROOT -depth -type l -print |\ |
46 |
sed "s@^$RPM_BUILD_ROOT@@g" >> %{name}-%{version}-filelist |
47 |
|
48 |
%clean |
49 |
rm -rf $RPM_BUILD_ROOT |
50 |
|
51 |
%post |
52 |
/sbin/e-smith/config printtype nsca > /dev/null || /sbin/e-smith/config set nsca service |
53 |
if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then |
54 |
/sbin/e-smith/expand-template /etc/hosts.allow |
55 |
/sbin/e-smith/service nsca restart |
56 |
fi |
57 |
|
58 |
%preun |
59 |
if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then |
60 |
if [ $1 = 0 ] ; then # uninstall |
61 |
/sbin/e-smith/service nsca stop |
62 |
fi |
63 |
fi |
64 |
|
65 |
|
66 |
%postun |
67 |
if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then |
68 |
if [ $1 = 0 ] ; then # uninstall |
69 |
/sbin/e-smith/expand-template /etc/hosts.allow |
70 |
fi |
71 |
fi |
72 |
|
73 |
%files -f %{name}-%{version}-filelist |
74 |
%defattr(-,root,root) |