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