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