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