]> git.pld-linux.org Git - packages/nagios.git/blob - nagios.spec
- added 'reload' in nagios.init
[packages/nagios.git] / nagios.spec
1 #
2 # Conditional build:
3 %bcond_with     pgsql   # enable pgsql support
4 %bcond_with     mysql   # enable mysql support
5 %bcond_without  gd      # without statusmap and trends, which require gd library
6 #
7 # TODO:
8 # - remove *-sample from /etc - move it to %doc or place without "-sample" suffix
9 Summary:        Host/service/network monitoring program
10 Summary(pl):    Program do monitorowania serwerów/us³ug/sieci
11 Summary(pt_BR): Programa para monitoração de máquinas e serviços
12 Name:           nagios
13 Version:        1.2
14 Release:        2
15 License:        GPL v2
16 Group:          Networking
17 Source0:        http://dl.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
18 # Source0-md5:  414d70e5269d5b8d7c21bf3ee129309f
19 Source1:        %{name}-apache.conf
20 Source2:        %{name}.init
21 Patch0:         %{name}-pgsql.patch
22 URL:            http://www.nagios.org/
23 BuildRequires:  autoconf
24 BuildRequires:  automake
25 %{?with_gd:BuildRequires:       gd-devel}
26 %{?with_mysql:BuildRequires:    mysql-devel}
27 %{?with_pgsql:BuildRequires:    postgresql-devel}
28 PreReq:         rc-scripts
29 PreReq:         sh-utils
30 Requires(pre):  /usr/bin/getgid
31 Requires(pre):  /bin/id
32 Requires(pre):  /usr/sbin/groupadd
33 Requires(pre):  /usr/sbin/useradd
34 Requires(post,postun):  /sbin/chkconfig
35 Conflicts:      iputils-ping < 1:ss020124
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 Obsoletes:      netsaint
38
39 %define         _sysconfdir     /etc/%{name}
40 %define         _bindir         %{_prefix}/sbin
41 %define         _sbindir        %{_libdir}/%{name}/cgi
42 %define         _datadir        %{_prefix}/share/%{name}
43 %define         _localstatedir  /var/lib/%{name}
44
45 %description
46 Nagios is a program that will monitor hosts and services on your
47 network. It has the ability to email or page you when a problem arises
48 and when a problem is resolved. Nagios is written in C and is designed
49 to run under Linux (and some other *NIX variants) as a background
50 process, intermittently running checks on various services that you
51 specify.
52
53 The actual service checks are performed by separate "plugin" programs
54 which return the status of the checks to Nagios. The plugins are
55 available in nagios-plugins packages.
56
57 Nagios is successor to NetSaint.
58
59 %description -l pl
60 Nagios to program, który monitoruje serwery oraz us³ugi w naszej
61 sieci. Posiada on mo¿liwo¶æ wysy³ania informacji o wyst±pieniu oraz
62 rozwi±zaniu problemu. Nagios zosta³ napisany w C oraz jest
63 zaprojektowany do pracy pod Linuksem (i niektórymi innymi uniksami)
64 jako proces pracuj±cy w tle i bezustannie wykonuj±cy pewne operacje
65 sprawdzaj±ce.
66
67 W³a¶ciwe sprawdzanie jest wykonywane przez osobne programy
68 ("wtyczki"), które zwracaj± informacje o statusie do Nagiosa. Wtyczki
69 s± dostêpne na stronie w pakietach nagios-plugins.
70
71 Nagios jest nastêpc± NetSainta.
72
73 %description -l pt_BR
74 O Nagios é um programa que monitora máquinas e serviços na sua rede.
75 Ele pode enviar um email ou um aviso de pager para o administrador
76 quando surgir um problema e quando ele for resolvido. Nagios é escrito
77 em C e foi desenvolvido para rodar em plataformas Linux (e algumas
78 variações de *NIX) como um processo em segundo plano, periodicamente
79 executando checagens nos diversos serviços que forem especificados.
80
81 %package cgi
82 Summary:        CGI webinterface for Nagios
83 Summary(pl):    Interfejs WWW/CGI dla Nagiosa
84 Group:          Networking
85 # for dirs... and accessing local logs(?)
86 Requires:       %{name} = %{version}
87 Requires:       apache
88
89 %description cgi
90 CGI webinterface for Nagios.
91
92 %description cgi -l pl
93 Interfejs CGI dla Nagiosa.
94
95 %package devel
96 Summary:        Include files that Netsaint-related applications may compile against
97 Summary(pl):    Pliki nag³ówkowe, wykorzystywane przez aplikacje nagiosa
98 Summary(pt_BR): Arquivos de cabeçalho necessários para desenvolvimento de aplicativos para o Nagios
99 Group:          Development/Libraries
100 # doesn't require base
101
102 %description devel
103 This package provides include files that Netsaint-related applications
104 may compile against.
105
106 %description devel -l pl
107 Ten pakiet dostarcza pliki nag³ówkowe, które mog± byæ wykorzystywane
108 przez aplikacje zwi±zane z nagiosem podczas kompilacji.
109
110 %description devel -l pt_BR
111 Este pacote contém arquivos de cabeçalho usados no desenvolvimento de
112 aplicativos para o Nagios.
113
114 %prep
115 %setup -q
116 %{?with_pgsql:%patch -p1}
117
118 %build
119 %{__aclocal}
120 %{__autoconf}
121 %configure \
122         --with-nagios-user=%{name} \
123         --with-nagios-grp=%{name} \
124         --with-command-user=nobody \
125         --with-command-grp=nobody \
126         --with-lockfile=/var/run/%{name}.pid \
127         --with-ping_command='/bin/ping -n %%s -c %%d' \
128         %{?with_mysql:--with-mysql-xdata --with-mysql-status --with-mysql-comments --with-mysql-extinfo --with-mysql-retention --with-mysql-downtime --with-mysql-lib=%{_libdir} --with-mysql-inc=%{_includedir}/mysql} \
129         %{?with_pgsql:--with-pgsql-xdata --with-pgsql-status --with-pgsql-comments --with-pgsql-extinfo --with-pgsql-retention --with-pgsql-downtime--with-pgsql-lib=%{_libdir} --with-pgsql-inc=%{_includedir}/postgresql} \
130         %{!?with_gd:--disable-statusmap --disable-trends}
131
132 %{__make} all
133
134 %install
135 rm -rf $RPM_BUILD_ROOT
136 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,httpd},%{_includedir}/%{name},%{_libdir}/%{name}/plugins} \
137         $RPM_BUILD_ROOT{%{_var}/log/%{name},%{_localstatedir}}
138
139 install common/locations.h      $RPM_BUILD_ROOT%{_includedir}/%{name}
140
141 %{__make} install install-html install-config install-init install-commandmode fullinstall \
142         DESTDIR=$RPM_BUILD_ROOT \
143         INSTALL_OPTS="" \
144         INIT_OPTS="" \
145         COMMAND_OPTS=""
146
147 install %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
148 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
149
150 %clean
151 rm -rf $RPM_BUILD_ROOT
152
153 %pre
154 if [ -n "`getgid %{name}`" ]; then
155        if [ "`getgid %{name}`" != "72" ]; then
156                echo "Error: group %{name} doesn't have gid=72. Correct this before installing %{name}." 1>&2
157                exit 1
158        fi
159 else
160        /usr/sbin/groupadd -g 72 -f %{name}
161 fi
162 if [ -n "`id -u %{name} 2>/dev/null`" ]; then
163        if [ "`id -u %{name}`" != "72" ]; then
164                echo "Error: user %{name} doesn't have uid=72. Correct this before installing %{name}." 1>&2
165                exit 1
166        fi
167 else
168        /usr/sbin/useradd -u 72 -d %{_libdir}/%{name} -s /bin/false -c "%{name} User" -g %{name} %{name} 1>&2
169 fi
170
171 %post
172 /sbin/chkconfig --add %{name}
173 if [ -f /var/lock/subsys/%{name} ]; then
174         /etc/rc.d/init.d/%{name} restart 1>&2
175 fi
176
177 %preun
178 if [ "$1" = "0" ] ; then
179         if [ -f /var/lock/subsys/%{name} ]; then
180                 /etc/rc.d/init.d/%{name} stop 1>&2
181         fi
182         /sbin/chkconfig --del %{name}
183 fi
184
185 %postun
186 if [ "$1" = "0" ]; then
187        /usr/sbin/userdel %{name}
188        /usr/sbin/groupdel %{name}
189 fi
190
191 %files
192 %defattr(644,root,root,755)
193 %doc Changelog README* UPGRADING contrib/database
194 %attr(754,root,root) /etc/rc.d/init.d/%{name}
195 %attr(751,root,nagios) %dir %{_sysconfdir}
196 %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/[!c]*
197 %attr(644,root,nagios) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/c[!g]*
198 %dir %{_libdir}/%{name}
199 %dir %{_libdir}/%{name}/plugins
200 %attr(755,root,root) %{_bindir}/%{name}
201 %attr(771,nagios,http) %{_var}/log/%{name}
202 %attr(775,nagios,nagios) %dir %{_localstatedir}
203 %attr(775,nagios,nagios) %dir %{_localstatedir}/archives
204 %attr(2775,nagios,http) %dir %{_localstatedir}/rw
205
206 %files cgi
207 %defattr(644,root,root,755)
208 %attr(640,root,http) %config(noreplace) %verify(not size mtime md5) /etc/httpd/%{name}.conf
209 %attr(644,root,http) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/cgi.cfg-sample
210 %dir %{_libdir}/%{name}/cgi
211 %attr(755,root,root) %{_libdir}/%{name}/cgi/*.cgi
212 %{_datadir}
213
214 %files devel
215 %defattr(644,root,root,755)
216 %dir %{_includedir}/%{name}
217 %{_includedir}/%{name}/*.h
This page took 0.054011 seconds and 3 git commands to generate.