]> git.pld-linux.org Git - packages/nagios-notify.git/blob - nagios-notify.spec
9296b355412ca892359161a1dd8172e53ac22e24
[packages/nagios-notify.git] / nagios-notify.spec
1 Summary:        Nagios Notify Script
2 Summary(pl.UTF-8):      Skrypt powiadamiający dla Nagiosa
3 Name:           nagios-notify
4 Version:        0.14
5 Release:        2
6 License:        GPL v2
7 Group:          Applications
8 Source0:        %{name}-%{version}.tar.bz2
9 # Source0-md5:  47c06d14e2944f222fe08298a62ef607
10 Patch0:         headers.patch
11 URL:            http://glen.alkohol.ee/nagios-notify/
12 Requires:       awk
13 Requires:       nagios-common
14 # notify via emails
15 Suggests:       /usr/lib/sendmail
16 # notify via jabber
17 Suggests:       nagios-alert-jabber
18 # notify to eggdrop bot (irc)
19 Suggests:       t0xirc
20 BuildArch:      noarch
21 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
23 %define         _sysconfdir     /etc/nagios
24 %define         _sbindir        /usr/lib/nagios
25
26 %description
27 nagios-notify is template based notify script for Nagios.
28
29 You should use this script because:
30 - the templates are easily edited in text editor
31 - you won't be worried about if the command definition contains shell
32   syntax errors (which Nagios happily discards without any trace in logs
33   :/)
34 - you can change templates without restarting Nagios
35 - with advanced templates you can send richtext (even images!) over
36   jabber if you use nagios-notify-jabber
37 - minimal dependency (just coreutils and awk that you most likely
38   already have installed)
39
40 %description -l pl.UTF-8
41 nagios-notify to oparty na szablonach skrypt powiadamiający dla
42 Nagiosa.
43
44 Powody, dla których dobrze jest używać tego skryptu:
45 - szablony można łatwo modyfikować w edytorze tekstu,
46 - nie trzeba się zbytnio martwić jeśli definicje poleceń zawierają
47   błędy składni powłoki (które Nagios ucina bez żadnego śladu w logach)
48 - można zmieniać szablony bez restartu Nagiosa
49 - przy użyciu zaawansowanych szablonów można wysyłać tekst wzbogacony
50   (nawet z obrazkami) przez jabbera w przypadku używania pakietu
51   nagios-notify-jabber
52 - minimalne zależności (tylko coreutils i awk, które zwykle i tak są
53   zainstalowane)
54
55 %prep
56 %setup -q
57 %patch0 -p1
58
59 %install
60 rm -rf $RPM_BUILD_ROOT
61
62 %{__make} install \
63         DESTDIR=$RPM_BUILD_ROOT
64
65 %clean
66 rm -rf $RPM_BUILD_ROOT
67
68 %triggerpostun -- %{name} < 0.10
69 %{__sed} -i -e 's,/usr/sbin/%{name},%{_sbindir}/%{name},' %{_sysconfdir}/plugins/%{name}.cfg
70 if [ -f /etc/rc.d/init.d/nagios ]; then
71         %service -q nagios reload
72 fi
73
74 %triggerpostun -- %{name} < 0.12-0.7
75 # recover renamed configs
76 for a in %{_sysconfdir}/templates/*.rpmsave; do
77         [ -f $a ] || continue
78         f=${a%%.rpmsave}
79         [ -f $f ] && cp -f $f{,.rpmnew}
80         mv -f $f{.rpmsave,}
81 done
82 # copy from new files if originals weren't modified but removed by upgrade
83 for a in eggdrop jabber sms; do
84         o=%{_sysconfdir}/templates/host-notify-by-$a.tmpl
85         f=%{_sysconfdir}/templates/notify-host-by-$a.tmpl
86         if [ ! -f $o ]; then
87                 cp -a $f $o
88         fi
89 done
90 for a in eggdrop email jabber-embedimage jabber-richtext jabber sms; do
91         o=%{_sysconfdir}/templates/notify-by-$a.tmpl
92         f=%{_sysconfdir}/templates/notify-service-by-$a.tmpl
93         if [ ! -f $o ]; then
94                 cp -a $f $o
95         fi
96 done
97 %banner -e %{name}-0.12 <<'EOF'
98 Templates have been renamed to follow Nagios 3.0 naming.
99
100 They have been recovered by rpm trigger, but if you want to use new style
101 naming these commands might help you out quickly:
102
103 # grep -r host-notify-by- /etc/nagios -l | xargs sed -i -e 's,host-notify-by-,notify-host-by-,g'
104 # grep -r notify-by- /etc/nagios -l | xargs sed -i -e 's,notify-by-,notify-service-by-,g'
105
106 EOF
107
108 %files
109 %defattr(644,root,root,755)
110 %doc ChangeLog
111 %dir %{_sysconfdir}/templates
112 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/templates/*
113 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plugins/%{name}.cfg
114 %attr(755,root,root) %{_sbindir}/nagios-notify
This page took 0.058841 seconds and 2 git commands to generate.