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