forked from ripienaar/angelia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
angelia.spec
82 lines (68 loc) · 2.14 KB
/
angelia.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
%define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
%define release %{rpm_release}%{?dist}
Summary: Multi protocol nagios notifier
Name: angelia
Version: %{version}
Release: %{release}
Group: System Tools
License: Apache v2
URL: http://www.devco.net/
Source0: %{name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: ruby
BuildArch: noarch
Packager: R.I.Pienaar <rip@devco.net>
%description
System to send nagios alerts to multiple destinations such as Twitter and XMPP.
Features:
- Templates for each type of protocol and alert
- Simple integration into Nagios
- Supports Twitter and XMPP
%prep
%setup -q
%build
%install
rm -rf %{buildroot}
%{__install} -d -m0755 %{buildroot}/%{ruby_sitelib}/angelia
%{__install} -d -m0755 %{buildroot}/etc/angelia/templates
%{__install} -d -m0755 %{buildroot}/usr/sbin
%{__install} -d -m0755 %{buildroot}/var/spool/angelia
%{__install} -d -m0755 %{buildroot}/var/log/angelia
%{__install} -d -m0755 %{buildroot}/etc/init.d
%{__install} -m0755 angelia-nagios-send.rb %{buildroot}/usr/sbin/angelia-nagios-send
%{__install} -m0755 angelia-send.rb %{buildroot}/usr/sbin/angelia-send
%{__install} -m0755 angelia-spoold.rb %{buildroot}/usr/sbin/angelia-spoold
%{__install} -m0755 angelia.init %{buildroot}/etc/init.d/angelia
cp -R angelia.rb %{buildroot}/%{ruby_sitelib}/
cp -R angelia/* %{buildroot}/%{ruby_sitelib}/angelia/
cp -R templates/* %{buildroot}/etc/angelia/templates
cp angelia.cfg %{buildroot}/etc/angelia
%clean
rm -rf %{buildroot}
%post
/sbin/chkconfig --add angelia
%preun
if [ "$1" = 0 ]; then
/sbin/service angelia stop >/dev/null 2>&1 || :;
/sbin/chkconfig --del angelia || :;
fi
:;
%postun
if [ "$1" -ge 1 ]; then
/sbin/service angelia condrestart >/dev/null 2>&1 || :;
fi;
:;
%files
%{ruby_sitelib}/angelia.rb
%{ruby_sitelib}/angelia
%config(noreplace) /etc/angelia/angelia.cfg
%config /etc/angelia/templates
%config /etc/init.d/angelia
/var/spool/angelia
/var/log/angelia
/usr/sbin/angelia-nagios-send
/usr/sbin/angelia-send
/usr/sbin/angelia-spoold
%changelog
* Thu Jul 23 2009 R.I.Pienaar <rip@devco.net> - 0.1
- First release