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