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