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