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