]>
Commit | Line | Data |
---|---|---|
03d5d122 ER |
1 | # TODO |
2 | # - /var/log/nagios/archives -> /var/log/archive/nagios | |
c2fe0fab | 3 | # |
b21411a3 | 4 | # Conditional build: |
e1f9e4d5 | 5 | %bcond_without gd # without statusmap and trends, which require gd library |
5ddc91b8 | 6 | %bcond_without epn # without Embedded Perl |
8c8f3904 AM |
7 | # reeenable when http://tracker.nagios.org/view.php?id=51 is fixed |
8 | %bcond_with tests | |
03d5d122 | 9 | |
1b3d1540 | 10 | Summary: Host/service/network monitoring program |
a02dfee5 ER |
11 | Summary(pl.UTF-8): Program do monitorowania serwerów/usług/sieci |
12 | Summary(pt_BR.UTF-8): Programa para monitoração de máquinas e serviços | |
1b3d1540 | 13 | Name: nagios |
0d02e51c | 14 | Version: 3.3.1 |
8ca4beff | 15 | Release: 5 |
ab40d60f | 16 | License: GPL v2+ |
1b3d1540 | 17 | Group: Networking |
3392dafc | 18 | Source0: http://downloads.sourceforge.net/nagios/%{name}-%{version}.tar.gz |
0d02e51c | 19 | # Source0-md5: c935354ce0d78a63bfabc3055fa77ad5 |
1b3d1540 TO |
20 | Source1: %{name}-apache.conf |
21 | Source2: %{name}.init | |
156a07c5 | 22 | Source3: %{name}.sysconfig |
9c387eb0 ER |
23 | Source4: %{name}-config-20090914.tar.bz2 |
24 | # Source4-md5: 605f1cd28c00db961dad6f529d849f16 | |
25 | Source5: %{name}-lighttpd.conf | |
455492e8 ER |
26 | Source6: http://www.google.com/mapfiles/shadow50.png |
27 | # Source6-md5: eff99f302f21b95a900d321743fce72b | |
28 | Source7: http://www.google.com/mapfiles/marker.png | |
29 | # Source7-md5: edefef4bdfc29e1c953694651f05b466 | |
30 | Source8: googlemap.js | |
b24b4667 ER |
31 | Patch0: %{name}-resources.patch |
32 | Patch1: %{name}-iconv-in-libc.patch | |
19670bc2 | 33 | Patch2: %{name}-webapps.patch |
f29ace4f | 34 | Patch3: %{name}-cgi-http_charset.patch |
d39e610a | 35 | Patch4: %{name}-cmd-typo.patch |
4af19791 | 36 | Patch5: config.patch |
3392dafc | 37 | Patch6: %{name}-googlemap.patch |
27a9d69f ER |
38 | Patch7: %{name}-doc-usermacros.patch |
39 | Patch8: archivelog-timeformat.patch | |
0a16a9f0 | 40 | Patch9: %{name}-html-Makefile.in.patch |
1b3d1540 | 41 | URL: http://www.nagios.org/ |
14ddd08f JB |
42 | BuildRequires: autoconf |
43 | BuildRequires: automake | |
2f5235a6 ER |
44 | BuildRequires: rpmbuild(macros) >= 1.268 |
45 | BuildRequires: sed >= 4.0 | |
86522331 AG |
46 | %if %{with gd} |
47 | BuildRequires: gd-devel | |
48 | BuildRequires: libjpeg-devel | |
49 | BuildRequires: libpng-devel | |
50 | %endif | |
2f5235a6 ER |
51 | %if %{with tests} |
52 | BuildRequires: perl-HTML-Lint | |
53 | BuildRequires: perl-Test-WWW-Mechanize-CGI | |
54 | %endif | |
8a91cf36 | 55 | Requires(post,preun): /sbin/chkconfig |
bc56720c | 56 | Requires: %{name}-common = %{version}-%{release} |
d4363d96 ER |
57 | Requires: rc-scripts |
58 | Requires: sh-utils | |
f77e54ce | 59 | Suggests: nagios-notify >= 0.13 |
3392dafc ER |
60 | Suggests: nagios-plugin-check_load |
61 | Suggests: nagios-plugin-check_ping | |
62 | Suggests: nagios-plugins | |
f0724323 | 63 | Provides: nagios-core |
1b3d1540 | 64 | Obsoletes: netsaint |
d4363d96 | 65 | Conflicts: iputils-ping < 1:ss020124 |
56d92939 | 66 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
1b3d1540 | 67 | |
e1f9e4d5 | 68 | %define _sysconfdir /etc/%{name} |
708a261e ER |
69 | %define cgidir %{_libdir}/%{name}/cgi |
70 | %define htmldir %{_prefix}/share/%{name} | |
e1f9e4d5 | 71 | %define _localstatedir /var/lib/%{name} |
31f3ed2f ER |
72 | %define _webapps /etc/webapps |
73 | %define _webapp %{name} | |
a9824b3a | 74 | |
1b3d1540 TO |
75 | %description |
76 | Nagios is a program that will monitor hosts and services on your | |
77 | network. It has the ability to email or page you when a problem arises | |
0cf1a114 TO |
78 | and when a problem is resolved. Nagios is written in C and is designed |
79 | to run under Linux (and some other *NIX variants) as a background | |
80 | process, intermittently running checks on various services that you | |
81 | specify. | |
1b3d1540 TO |
82 | |
83 | The actual service checks are performed by separate "plugin" programs | |
84 | which return the status of the checks to Nagios. The plugins are | |
85 | available in nagios-plugins packages. | |
86 | ||
924840b9 TO |
87 | Nagios is successor to NetSaint. |
88 | ||
eb034f05 JR |
89 | %description -l pl.UTF-8 |
90 | Nagios to program, który monitoruje serwery oraz usługi w naszej | |
91 | sieci. Posiada on możliwość wysyłania informacji o wystąpieniu oraz | |
92 | rozwiązaniu problemu. Nagios został napisany w C oraz jest | |
93 | zaprojektowany do pracy pod Linuksem (i niektórymi innymi uniksami) | |
94 | jako proces pracujący w tle i bezustannie wykonujący pewne operacje | |
95 | sprawdzające. | |
1b3d1540 | 96 | |
eb034f05 JR |
97 | Właściwe sprawdzanie jest wykonywane przez osobne programy |
98 | ("wtyczki"), które zwracają informacje o statusie do Nagiosa. Wtyczki | |
99 | są dostępne na stronie w pakietach nagios-plugins. | |
1b3d1540 | 100 | |
eb034f05 | 101 | Nagios jest następcą NetSainta. |
924840b9 | 102 | |
eb034f05 JR |
103 | %description -l pt_BR.UTF-8 |
104 | O Nagios é um programa que monitora máquinas e serviços na sua rede. | |
1b3d1540 | 105 | Ele pode enviar um email ou um aviso de pager para o administrador |
eb034f05 | 106 | quando surgir um problema e quando ele for resolvido. Nagios é escrito |
0cf1a114 | 107 | em C e foi desenvolvido para rodar em plataformas Linux (e algumas |
eb034f05 JR |
108 | variações de *NIX) como um processo em segundo plano, periodicamente |
109 | executando checagens nos diversos serviços que forem especificados. | |
1b3d1540 | 110 | |
901d97df ER |
111 | %package common |
112 | Summary: Common files needed by both nagios and nrpe | |
a02dfee5 | 113 | Summary(pl.UTF-8): Wspólne pliki wymagane zarówno przez nagiosa jak i nrpe |
901d97df | 114 | Group: Networking |
d4363d96 ER |
115 | Requires(postun): /usr/sbin/groupdel |
116 | Requires(postun): /usr/sbin/userdel | |
901d97df | 117 | Requires(pre): /bin/id |
d4363d96 | 118 | Requires(pre): /usr/bin/getgid |
901d97df ER |
119 | Requires(pre): /usr/sbin/groupadd |
120 | Requires(pre): /usr/sbin/groupmod | |
121 | Requires(pre): /usr/sbin/useradd | |
122 | Requires(pre): /usr/sbin/usermod | |
7970ec44 | 123 | Provides: group(nagcmd) |
f77e54ce | 124 | Provides: group(nagios) |
d4363d96 | 125 | Provides: user(nagios) |
901d97df ER |
126 | |
127 | %description common | |
128 | Common files needed by both nagios and nrpe. | |
129 | ||
eb034f05 JR |
130 | %description common -l pl.UTF-8 |
131 | Wspólne pliki wymagane zarówno przez nagiosa jak i nrpe. | |
bee7c8ea | 132 | |
1b3d1540 TO |
133 | %package cgi |
134 | Summary: CGI webinterface for Nagios | |
a02dfee5 | 135 | Summary(pl.UTF-8): Interfejs WWW/CGI dla Nagiosa |
7c33b67a | 136 | Group: Applications/WWW |
bf60adae | 137 | # for dirs... and accessing local logs, nagios config |
4a3af0fb | 138 | Requires: %{name} = %{version}-%{release} |
1bbdd399 | 139 | Requires: %{name}-imagepaks |
20145354 | 140 | Requires: %{name}-theme |
156a07c5 | 141 | Requires: group(http) |
d4363d96 | 142 | Requires: webapps |
e785f9d9 | 143 | Requires: webserver |
111ce231 | 144 | Requires: webserver(access) |
e785f9d9 ER |
145 | Requires: webserver(alias) |
146 | Requires: webserver(auth) | |
147 | Requires: webserver(cgi) | |
148 | Requires: webserver(indexfile) | |
bf60adae | 149 | Suggests: %{name}-doc |
1b3d1540 TO |
150 | |
151 | %description cgi | |
0964d76f JB |
152 | CGI webinterface for Nagios. |
153 | ||
eb034f05 | 154 | %description cgi -l pl.UTF-8 |
0964d76f | 155 | Interfejs CGI dla Nagiosa. |
1b3d1540 | 156 | |
4f43d0aa ER |
157 | %package mrtggraphs |
158 | Summary: MRTG Graphs: Nagios Statistics | |
159 | Group: Applications/Networking | |
160 | Requires: %{name} = %{version}-%{release} | |
161 | Provides: mrtg-start | |
162 | ||
163 | %description mrtggraphs | |
164 | This pacakge graphs several Nagios statistics which can be useful for | |
165 | debugging and trending purposes. The nagiostats binary is used to | |
166 | generate the data. | |
167 | ||
bf60adae ER |
168 | %package doc |
169 | Summary: HTML Documentation for Nagios | |
170 | Group: Documentation | |
171 | # does not require base | |
172 | ||
173 | %description doc | |
174 | HTML Documentation for Nagios. | |
175 | ||
a10f2ff5 ER |
176 | %package theme-classicui |
177 | Summary: ClassicUI Nagios theme | |
7c33b67a | 178 | Group: Applications/WWW |
c80fbcb2 | 179 | Requires: %{name}-cgi = %{version}-%{release} |
fdea6415 | 180 | Requires: webserver(php) |
60238ce7 JB |
181 | Provides: nagios-theme |
182 | Obsoletes: nagios-theme | |
20145354 | 183 | |
a10f2ff5 | 184 | %description theme-classicui |
20145354 ER |
185 | Original theme from Nagios. |
186 | ||
a10f2ff5 | 187 | %description theme-classicui -l pl.UTF-8 |
60238ce7 JB |
188 | Oryginalny motyw z Nagiosa. |
189 | ||
a10f2ff5 ER |
190 | %package theme-default |
191 | Summary: Virtual package to handle Nagios theme migration | |
192 | Group: Applications/WWW | |
193 | Requires: nagios-theme | |
194 | Obsoletes: nagios-theme-default < 3.3.1-1.4 | |
195 | ||
196 | %description theme-default | |
197 | Virtual package to handle Nagios theme migration | |
198 | ||
1b3d1540 | 199 | %package devel |
e5fcc454 | 200 | Summary: Include files that Nagios-related applications may compile against |
a02dfee5 ER |
201 | Summary(pl.UTF-8): Pliki nagłówkowe, wykorzystywane przez aplikacje nagiosa |
202 | Summary(pt_BR.UTF-8): Arquivos de cabeçalho necessários para desenvolvimento de aplicativos para o Nagios | |
1b3d1540 | 203 | Group: Development/Libraries |
e1f9e4d5 | 204 | # doesn't require base |
1b3d1540 TO |
205 | |
206 | %description devel | |
e5fcc454 | 207 | This package provides include files that Nagios-related applications |
1b3d1540 TO |
208 | may compile against. |
209 | ||
eb034f05 JR |
210 | %description devel -l pl.UTF-8 |
211 | Ten pakiet dostarcza pliki nagłówkowe, które mogą być wykorzystywane | |
212 | przez aplikacje związane z nagiosem podczas kompilacji. | |
1b3d1540 | 213 | |
eb034f05 JR |
214 | %description devel -l pt_BR.UTF-8 |
215 | Este pacote contém arquivos de cabeçalho usados no desenvolvimento de | |
1b3d1540 TO |
216 | aplicativos para o Nagios. |
217 | ||
218 | %prep | |
bc80e8d5 | 219 | %setup -q -a4 -n %{name} |
0d02e51c | 220 | %undos cgi/*.c |
221 | %undos include/*.h | |
222 | %undos base/* | |
b24b4667 ER |
223 | %patch0 -p0 |
224 | %patch1 -p1 | |
4a3af0fb | 225 | %patch2 -p1 |
f29ace4f | 226 | %patch3 -p1 |
5ddc91b8 | 227 | #fixed |
0d02e51c | 228 | #%patch4 -p1 |
744a134f | 229 | %patch5 -p1 |
455492e8 | 230 | %patch6 -p1 |
7116ea37 | 231 | %patch7 -p1 |
27a9d69f | 232 | %patch8 -p1 |
0a16a9f0 | 233 | %patch9 -p1 |
156a07c5 | 234 | |
6e193622 | 235 | find -name .cvsignore -o -name .gitignore | xargs rm |
fdea6415 ER |
236 | |
237 | mv nagios-config-*/objects/*.cfg sample-config/template-object | |
238 | mv nagios-config-*/*.cfg sample-config | |
239 | ||
af765cf5 ER |
240 | # cleanup backups after patching |
241 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
242 | ||
156a07c5 | 243 | sed -i -e ' |
c80fbcb2 | 244 | s,".*/var/rw/%{name}.cmd,"%{_localstatedir}/rw/%{name}.cmd, |
156a07c5 ER |
245 | s,".*/libexec/eventhandlers,"%{_libdir}/%{name}/eventhandlers, |
246 | ' $(find contrib/eventhandlers -type f) | |
1b3d1540 | 247 | |
078e0b6e | 248 | sed -e 's,%{_prefix}/lib/,%{_libdir}/,' %{SOURCE1} > apache.conf |
9c387eb0 | 249 | sed -e 's,%{_prefix}/lib/,%{_libdir}/,' %{SOURCE5} > lighttpd.conf |
078e0b6e | 250 | |
744a134f ER |
251 | # fixup cgi config |
252 | %{__sed} -i -e ' | |
253 | # kill trailing spaces | |
254 | s, \+$,, | |
255 | # use real paths | |
c80fbcb2 | 256 | s,/usr/local/%{name}/share,@datadir@,g |
744a134f ER |
257 | # we want all authorized users have default access |
258 | s,=nagiosadmin,=*,g | |
4af19791 | 259 | ' sample-config/*.cfg.in |
744a134f | 260 | |
27a9d69f | 261 | # fixup paths in doc |
0d02e51c | 262 | #%{__sed} -i -e ' |
263 | # s,/usr/local/%{name}/var/archives/,/var/log/%{name}/archives/, | |
264 | #' html/docs/configmain.html | |
27a9d69f | 265 | |
2f5235a6 ER |
266 | #rm t/611cgistatus-hosturgencies.t |
267 | ||
1b3d1540 | 268 | %build |
156a07c5 | 269 | cp -f /usr/share/automake/config.sub . |
a9824b3a TO |
270 | %{__aclocal} |
271 | %{__autoconf} | |
2f5235a6 ER |
272 | %if %{with tests} |
273 | cd tap | |
274 | %{__libtoolize} | |
275 | %{__aclocal} | |
276 | %{__autoconf} | |
277 | cd .. | |
278 | %endif | |
a9824b3a | 279 | %configure \ |
b654dd87 | 280 | CFLAGS="%{rpmcflags} %{rpmcppflags}" \ |
708a261e ER |
281 | --bindir=%{_sbindir} \ |
282 | --sbindir=%{cgidir} \ | |
283 | --datadir=%{htmldir} \ | |
1b3d1540 TO |
284 | --with-nagios-user=%{name} \ |
285 | --with-nagios-grp=%{name} \ | |
156a07c5 ER |
286 | --with-command-user=%{name} \ |
287 | --with-command-grp=%{name} \ | |
288 | --with-lockfile=%{_localstatedir}/%{name}.pid \ | |
e56088ed | 289 | --with-checkresult-dir=%{_var}/spool/%{name}/checkresults \ |
0964d76f | 290 | --with-ping_command='/bin/ping -n %%s -c %%d' \ |
8c8f3904 AM |
291 | %{!?with_gd:--disable-statusmap --disable-trends} \ |
292 | %{?with_tests:--enable-libtap} \ | |
293 | --enable-event-broker | |
1b3d1540 TO |
294 | |
295 | %{__make} all | |
296 | ||
8c8f3904 AM |
297 | %{?with_tests:%{__make} test} |
298 | ||
1b3d1540 TO |
299 | %install |
300 | rm -rf $RPM_BUILD_ROOT | |
4a5ea7ae ER |
301 | install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_webapps}/%{_webapp}} \ |
302 | $RPM_BUILD_ROOT{%{_var}/log/%{name}/archives,%{_localstatedir}/rw} \ | |
fdea6415 | 303 | $RPM_BUILD_ROOT%{_sysconfdir}/{plugins,objects} \ |
fcd029a6 | 304 | $RPM_BUILD_ROOT%{_libdir}/%{name}/{eventhandlers,plugins,brokers} \ |
4a5ea7ae ER |
305 | %if "%{_lib}" != "lib" |
306 | $RPM_BUILD_ROOT%{_prefix}/lib/%{name}/{eventhandlers,plugins} \ | |
307 | %endif | |
1b3d1540 | 308 | |
4a5ea7ae | 309 | install -d $RPM_BUILD_ROOT%{_includedir}/%{name} |
4f43d0aa | 310 | cp -p include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name} |
1b3d1540 | 311 | |
aca04140 | 312 | %{__make} install-unstripped \ |
1b3d1540 TO |
313 | DESTDIR=$RPM_BUILD_ROOT \ |
314 | INSTALL_OPTS="" \ | |
315 | INIT_OPTS="" \ | |
316 | COMMAND_OPTS="" | |
317 | ||
6e193622 | 318 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
5ddc91b8 | 319 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name} |
156a07c5 ER |
320 | |
321 | # install templated configuration files | |
c80fbcb2 | 322 | for a in %{name}.cfg resource.cfg commands.cfg contactgroups.cfg contacts.cfg templates.cfg timeperiods.cfg; do |
5ddc91b8 | 323 | cp -p sample-config/$a $RPM_BUILD_ROOT%{_sysconfdir} |
fdea6415 | 324 | done |
c0350ebc | 325 | |
31f3ed2f | 326 | # webserver files |
5ddc91b8 ER |
327 | cp -p apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf |
328 | cp -p apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf | |
329 | cp -p lighttpd.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/lighttpd.conf | |
330 | cp -p sample-config/cgi.cfg $RPM_BUILD_ROOT%{_webapps}/%{_webapp} | |
331 | cp -p %{SOURCE6} $RPM_BUILD_ROOT%{htmldir}/images | |
332 | cp -p %{SOURCE7} $RPM_BUILD_ROOT%{htmldir}/images | |
333 | cp -p %{SOURCE8} $RPM_BUILD_ROOT%{htmldir}/images | |
31f3ed2f ER |
334 | > $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/passwd |
335 | echo 'nagios:' > $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/group | |
156a07c5 | 336 | |
fdea6415 | 337 | # install event handlers, sample config |
4a5ea7ae | 338 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
156a07c5 | 339 | cp -a contrib/eventhandlers $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
fdea6415 ER |
340 | cp -a sample-config $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
341 | find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name '*.in' | xargs rm | |
156a07c5 | 342 | |
4f43d0aa ER |
343 | # mrtg script |
344 | install -d $RPM_BUILD_ROOT/etc/mrtg/conf.d | |
345 | cp -a sample-config/mrtg.cfg $RPM_BUILD_ROOT/etc/mrtg/conf.d/%{name}.cfg | |
346 | ||
156a07c5 | 347 | # Object data/cache files |
e6b8c4d6 | 348 | for i in {objects.{cache,precache},{retention,status}.dat,%{name}.{tmp,pid}}; do |
156a07c5 | 349 | > $RPM_BUILD_ROOT%{_localstatedir}/$i |
b0a1a45f | 350 | done |
c80fbcb2 | 351 | > $RPM_BUILD_ROOT%{_localstatedir}/rw/%{name}.cmd |
e58661fb | 352 | |
bf60adae | 353 | install -d $RPM_BUILD_ROOT%{_docdir}/%{name} |
708a261e | 354 | mv $RPM_BUILD_ROOT{%{htmldir}/docs/*,%{_docdir}/%{name}} |
bf60adae | 355 | |
1b3d1540 TO |
356 | %clean |
357 | rm -rf $RPM_BUILD_ROOT | |
358 | ||
1b3d1540 | 359 | %post |
f9b2b5a9 | 360 | for i in %{_localstatedir}/{objects.{cache,precache},{retention,status}.dat}; do |
156a07c5 ER |
361 | [ ! -f $i ] && touch $i |
362 | chown root:nagios $i | |
363 | chmod 664 $i | |
364 | done | |
365 | ||
fe2307cb | 366 | /sbin/chkconfig --add %{name} |
09b7a682 | 367 | %service %{name} restart "Nagios service" |
fe2307cb | 368 | |
1b3d1540 TO |
369 | %preun |
370 | if [ "$1" = "0" ] ; then | |
fe2307cb | 371 | %service %{name} stop |
1b3d1540 TO |
372 | /sbin/chkconfig --del %{name} |
373 | fi | |
374 | ||
901d97df | 375 | %pre common |
7970ec44 | 376 | # rename group netsaint -> nagios |
3392dafc | 377 | if [ "$(getgid netsaint 2>/dev/null)" = "72" ]; then |
901d97df ER |
378 | /usr/sbin/groupmod -n nagios netsaint |
379 | fi | |
7970ec44 | 380 | # rename group nagios-data -> nagcmd |
3392dafc | 381 | if [ "$(getgid nagios-data 2>/dev/null)" = "147" ]; then |
7970ec44 ER |
382 | /usr/sbin/groupmod -n nagcmd nagios-data |
383 | fi | |
901d97df | 384 | %groupadd -g 72 nagios |
7970ec44 | 385 | %groupadd -g 147 -f nagcmd |
3392dafc | 386 | if [ -n "$(id -u netsaint 2>/dev/null)" ] && [ "$(id -u netsaint)" = "72" ]; then |
c80fbcb2 | 387 | /usr/sbin/usermod -d %{_libdir}/%{name} -l nagios -c "Nagios Daemon" -G nagcmd netsaint |
901d97df | 388 | fi |
c80fbcb2 | 389 | %useradd -u 72 -d %{_libdir}/%{name} -s /bin/false -c "Nagios Daemon" -g nagios -G nagcmd nagios |
901d97df ER |
390 | |
391 | %postun common | |
4b3055f2 | 392 | if [ "$1" = "0" ]; then |
56d92939 | 393 | %userremove nagios |
394 | %groupremove nagios | |
7970ec44 | 395 | %groupremove nagcmd |
4b3055f2 | 396 | fi |
397 | ||
7441a39b | 398 | %post cgi |
156a07c5 ER |
399 | if [ "$1" = 1 ]; then |
400 | %banner %{name} -e <<EOF | |
401 | NOTE: | |
31f3ed2f | 402 | You need to add user to %{_webapps}/%{_webapp}/passwd and |
fe2307cb | 403 | %{_webapps}/%{_webapp}/group to access Nagios via web. |
156a07c5 ER |
404 | |
405 | EOF | |
406 | fi | |
407 | ||
91b73a43 | 408 | %triggerin cgi -- apache1 < 1.3.37-3, apache1-base |
7970ec44 | 409 | %addusertogroup http nagcmd |
31f3ed2f | 410 | %webapp_register apache %{_webapp} |
26c807b6 | 411 | |
91b73a43 | 412 | %triggerun cgi -- apache1 < 1.3.37-3, apache1-base |
31f3ed2f | 413 | %webapp_unregister apache %{_webapp} |
26c807b6 | 414 | |
44abff38 | 415 | %triggerin cgi -- apache < 2.2.0, apache-base |
7970ec44 | 416 | %addusertogroup http nagcmd |
31f3ed2f | 417 | %webapp_register httpd %{_webapp} |
26c807b6 | 418 | |
44abff38 | 419 | %triggerun cgi -- apache < 2.2.0, apache-base |
31f3ed2f | 420 | %webapp_unregister httpd %{_webapp} |
156a07c5 | 421 | |
e785f9d9 | 422 | %triggerin cgi -- lighttpd |
7970ec44 | 423 | %addusertogroup lighttpd nagcmd |
e785f9d9 ER |
424 | %webapp_register lighttpd %{_webapp} |
425 | ||
426 | %triggerun cgi -- lighttpd | |
427 | %webapp_unregister lighttpd %{_webapp} | |
428 | ||
156a07c5 ER |
429 | %triggerpostun -- nagios-cgi < 2.0-0.b3.21 |
430 | chown root:http %{_sysconfdir}/cgi.cfg | |
431 | ||
e56088ed | 432 | %triggerpostun -- nagios < 3.1.2-4 |
fdea6415 | 433 | # restore lost files |
53326298 | 434 | for a in dependencies.cfg services.cfg serviceextinfo.cfg hosts.cfg hostgroups.cfg hostextinfo.cfg escalations.cfg checkcommands.cfg misccommands.cfg; do |
fdea6415 ER |
435 | if [ -f %{_sysconfdir}/$a.rpmsave -a ! -f %{_sysconfdir}/$a ]; then |
436 | mv -f %{_sysconfdir}/$a{.rpmsave,} | |
31f3ed2f ER |
437 | fi |
438 | done | |
c80fbcb2 | 439 | %{__sed} -i -e 's,^check_result_path=.*,check_result_path=%{_var}/spool/%{name}/checkresults,' %{_sysconfdir}/%{name}.cfg |
31f3ed2f | 440 | |
1b3d1540 TO |
441 | %files |
442 | %defattr(644,root,root,755) | |
156a07c5 | 443 | %doc Changelog README* UPGRADING INSTALLING LICENSE |
9ac20a2e | 444 | %attr(750,root,nagios) %dir %{_sysconfdir}/objects |
3392dafc ER |
445 | |
446 | # leave main nagios config readable for -cgi. | |
c80fbcb2 | 447 | %attr(640,root,nagcmd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.cfg |
3392dafc ER |
448 | |
449 | %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commands.cfg | |
450 | %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/contactgroups.cfg | |
451 | %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/contacts.cfg | |
452 | %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/resource.cfg | |
453 | %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/templates.cfg | |
454 | %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/timeperiods.cfg | |
156a07c5 | 455 | |
3f16fe73 | 456 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
156a07c5 ER |
457 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
458 | ||
708a261e ER |
459 | %attr(755,root,root) %{_sbindir}/%{name} |
460 | %attr(755,root,root) %{_sbindir}/nagiostats | |
fcd029a6 | 461 | %dir %{_libdir}/%{name}/brokers |
156a07c5 | 462 | |
7970ec44 ER |
463 | %attr(770,root,nagcmd) %dir %{_var}/log/%{name} |
464 | %attr(770,root,nagcmd) %dir %{_var}/log/%{name}/archives | |
156a07c5 | 465 | |
7970ec44 ER |
466 | %attr(770,root,nagcmd) %dir %{_localstatedir} |
467 | %attr(2770,root,nagcmd) %dir %{_localstatedir}/rw | |
c80fbcb2 | 468 | %attr(660,nagios,nagcmd) %ghost %{_localstatedir}/rw/%{name}.cmd |
3e125558 | 469 | %attr(664,root,nagios) %ghost %{_localstatedir}/objects.cache |
19cc8e59 | 470 | %attr(664,root,nagios) %ghost %{_localstatedir}/objects.precache |
3e125558 ER |
471 | %attr(664,root,nagios) %ghost %{_localstatedir}/*.dat |
472 | %attr(664,root,nagios) %ghost %{_localstatedir}/%{name}.tmp | |
e6b8c4d6 | 473 | %attr(664,root,nagios) %ghost %{_localstatedir}/%{name}.pid |
156a07c5 | 474 | |
7e556525 | 475 | %attr(770,root,nagcmd) %dir %{_var}/spool/%{name}/checkresults |
3d336594 | 476 | |
156a07c5 ER |
477 | %{_examplesdir}/%{name}-%{version} |
478 | ||
901d97df ER |
479 | %files common |
480 | %defattr(644,root,root,755) | |
7970ec44 | 481 | %attr(750,root,nagcmd) %dir %{_sysconfdir} |
1e0c0567 | 482 | %attr(750,root,nagios) %dir %{_sysconfdir}/plugins |
901d97df ER |
483 | %dir %{_libdir}/%{name} |
484 | %dir %{_libdir}/%{name}/plugins | |
156a07c5 | 485 | %dir %{_libdir}/%{name}/eventhandlers |
1b3d1540 | 486 | |
4a5ea7ae ER |
487 | %if "%{_lib}" != "lib" |
488 | %dir %{_prefix}/lib/%{name} | |
489 | %dir %{_prefix}/lib/%{name}/plugins | |
490 | %dir %{_prefix}/lib/%{name}/eventhandlers | |
491 | %endif | |
492 | ||
7e556525 | 493 | %attr(770,root,nagcmd) %dir %{_var}/spool/%{name} |
2ea9f2fa | 494 | |
4f43d0aa ER |
495 | %files mrtggraphs |
496 | %defattr(644,root,root,755) | |
497 | %config(noreplace) %verify(not md5 mtime size) /etc/mrtg/conf.d/%{name}.cfg | |
498 | ||
bf60adae ER |
499 | %files doc |
500 | %defattr(644,root,root,755) | |
501 | %{_docdir}/%{name} | |
502 | ||
1b3d1540 TO |
503 | %files cgi |
504 | %defattr(644,root,root,755) | |
31f3ed2f ER |
505 | %dir %attr(750,root,http) %{_webapps}/%{_webapp} |
506 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf | |
507 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf | |
e785f9d9 | 508 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/lighttpd.conf |
31f3ed2f ER |
509 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/cgi.cfg |
510 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/passwd | |
511 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/group | |
708a261e ER |
512 | %dir %{cgidir} |
513 | %attr(755,root,root) %{cgidir}/*.cgi | |
514 | ||
515 | %dir %{htmldir} | |
516 | %dir %{htmldir}/includes | |
517 | %dir %{htmldir}/images | |
518 | %dir %{htmldir}/stylesheets | |
519 | %{htmldir}/robots.txt | |
520 | %{htmldir}/contexthelp | |
521 | %{htmldir}/media | |
522 | %{htmldir}/ssi | |
523 | %{htmldir}/images/favicon.ico | |
524 | %{htmldir}/images/marker.png | |
525 | %{htmldir}/images/shadow50.png | |
20145354 | 526 | |
a10f2ff5 | 527 | %files theme-classicui |
20145354 | 528 | %defattr(644,root,root,755) |
708a261e ER |
529 | %{htmldir}/*.php |
530 | %{htmldir}/includes/* | |
531 | %{htmldir}/images/* | |
532 | %exclude %{htmldir}/images/favicon.ico | |
533 | %exclude %{htmldir}/images/marker.png | |
534 | %exclude %{htmldir}/images/shadow50.png | |
535 | %{htmldir}/stylesheets/* | |
1b3d1540 | 536 | |
a10f2ff5 ER |
537 | %files theme-default |
538 | %defattr(644,root,root,755) | |
539 | ||
1b3d1540 TO |
540 | %files devel |
541 | %defattr(644,root,root,755) | |
542 | %dir %{_includedir}/%{name} | |
543 | %{_includedir}/%{name}/*.h |