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