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