forked from naemon/naemon-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnaemon.spec
More file actions
758 lines (661 loc) · 25 KB
/
Copy pathnaemon.spec
File metadata and controls
758 lines (661 loc) · 25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
%define logmsg logger -t %{name}/rpm
%if %{defined suse_version}
%define apacheuser wwwrun
%define apachegroup www
%define apachedir apache2
%else
%define apacheuser apache
%define apachegroup apache
%define apachedir httpd
%endif
# Setup some debugging options in case we build with --with debug
%if %{defined _with_debug}
%define mycflags -O0 -pg -ggdb3
%else
%define mycflags %{nil}
%endif
Summary: Open Source Host, Service And Network Monitoring Program
Name: naemon
Version: 1.0.3
Release: 1%{?dist}
License: GPLv2
Group: Applications/System
URL: http://www.naemon.org/
Packager: Naemon Core Development Team <naemon-dev@monitoring-lists.org>
Vendor: Naemon Core Development Team
Source0: http://labs.consol.de/naemon/download/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
BuildRequires: gd-devel > 1.8
BuildRequires: zlib-devel
BuildRequires: libpng-devel
BuildRequires: libjpeg-devel
BuildRequires: mysql-devel
BuildRequires: gperf
BuildRequires: perl
BuildRequires: logrotate
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: gcc-c++
BuildRequires: help2man
BuildRequires: rsync
BuildRequires: libicu-devel
# sles / rhel specific requirements
%if %{defined suse_version}
BuildRequires: libexpat-devel
%else
BuildRequires: expat-devel
%endif
# rhel6 specific requirements
%if 0%{?el6}
BuildRequires: perl-ExtUtils-MakeMaker
BuildRequires: perl-Module-Install
%endif
%if 0%{?el7}%{?fc20}%{?fc21}%{?fc22}
BuildRequires: perl-autodie
BuildRequires: systemd
BuildRequires: chrpath
%endif
%if %{defined suse_version}
%if 0%{suse_version} < 1230
Requires(pre): pwdutils
%else
Requires(pre): shadow
%endif
Requires(pre): shadow-utils
%endif
Requires: %{name}-core = %{version}-%{release}
Requires: %{name}-tools = %{version}-%{release}
Requires: %{name}-livestatus = %{version}-%{release}
Requires: %{name}-thruk = %{version}-%{release}
Requires: %{name}-thruk-reporting = %{version}-%{release}
# https://fedoraproject.org/wiki/Packaging:DistTag
# http://stackoverflow.com/questions/5135502/rpmbuild-dist-not-defined-on-centos-5-5
%description
Naemon is an application, system and network monitoring application.
It can escalate problems by email, pager or any other medium. It is
also useful for incident or SLA reporting. It is originally a fork
of Nagios, but with extended functionality, stability and performance.
It is written in C and is designed as a background process,
intermittently running checks on various services that you specify.
The actual service checks are performed by separate "plugin" programs
which return the status of the checks to Naemon. The plugins are
compatible with Nagios, and can be found in the monitoring-plugins package.
Naemon ships the Thruk gui with extended reporting and dashboard features.
# disable binary striping
%global __os_install_post %{nil}
%package core
Summary: Naemon Monitoring Core
Group: Applications/System
Requires: logrotate
%description core
contains the %{name} core.
%package tools
Summary: Naemon Monitoring Tools
Group: Applications/System
Requires: libnaemon = %{version}-%{release}
%description tools
contains tools for %{name}.
- naemonstats: display statistics
- oconfsplit: divide configurations by groups
- shadownaemon: shadow a remote naemon core over livestatus
%package core-dbg
Summary: Naemon Monitoring Debug Core
Group: Applications/System
%description core-dbg
contains the %{name} core with debug symbols.
%package livestatus
Summary: Naemon Livestatus Eventbroker Module
Group: Applications/System
%description livestatus
contains the %{name} livestatus eventbroker module.
%package thruk
Summary: Thruk Gui For Naemon
Group: Applications/System
Requires: %{name}-thruk-libs = %{version}-%{release}
Requires(preun): %{name}-thruk-libs = %{version}-%{release}
Requires(post): %{name}-thruk-libs = %{version}-%{release}
Requires: perl logrotate gd wget
Conflicts: thruk
AutoReqProv: no
%if %{defined suse_version}
Requires: apache2 apache2-mod_fcgid cron
%else
Requires: httpd mod_fcgid
%endif
%description thruk
This package contains the thruk gui for %{name}.
%package thruk-libs
Summary: Perl Librarys For Naemons Thruk Gui
Group: Applications/System
AutoReqProv: no
Requires: %{name}-thruk = %{version}-%{release}
Conflicts: thruk
%description thruk-libs
This package contains the library files for the thruk gui.
%package thruk-reporting
Summary: Thruk Gui For Naemon Reporting Addon
Group: Applications/System
Requires: %{name}-thruk = %{version}-%{release}
%if %{defined suse_version}
Requires: xorg-x11-server-extra
%else
%if 0%{?el6}%{?el7}%{?fc20}%{?fc21}%{?fc22}
# >rhel6
Requires: xorg-x11-server-Xvfb libXext dejavu-fonts-common
%else
# rhel5 (there is no el5 rpm macro)
Requires: xorg-x11-server-Xvfb libXext dejavu-lgc-fonts
%endif
%endif
AutoReqProv: no
%description thruk-reporting
This package contains the reporting addon for naemons thruk gui useful for sla
and event reporting.
%package devel
Summary: Development Files For Naemon
Group: Development/Libraries
%description devel
This package contains the header files, static libraries for %{name}.
If you are a NEB-module author or wish to write addons for Naemon
using Naemons own APIs, you should install this package.
%package -n libnaemon
Summary: Shared Library for Naemon and NEB modules
Group: Development/Libraries
%description -n libnaemon
libnaemon contains the shared library for building NEB modules or addons for
Naemon.
%prep
%setup -q
%build
CFLAGS="%{mycflags}" LDFLAGS="$CFLAGS" %configure \
--datadir="%{_datadir}/%{name}" \
--libdir="%{_libdir}/%{name}" \
--localstatedir="%{_localstatedir}/lib/%{name}" \
--sysconfdir="%{_sysconfdir}/%{name}" \
--with-pkgconfdir="%{_sysconfdir}/%{name}" \
--enable-event-broker \
--with-pluginsdir="%{_libdir}/%{name}/plugins" \
--with-tempdir="%{_localstatedir}/cache/%{name}" \
--with-checkresultdir="%{_localstatedir}/cache/%{name}/checkresults" \
--with-logdir="%{_localstatedir}/log/%{name}" \
--with-initdir="%{_initrddir}" \
--with-logrotatedir="%{_sysconfdir}/logrotate.d" \
--with-naemon-user="naemon" \
--with-naemon-group="naemon" \
--with-lockfile="%{_localstatedir}/run/%{name}/%{name}.pid" \
--with-thruk-user="%{apacheuser}" \
--with-thruk-group="naemon" \
--with-thruk-libs="%{_libdir}/%{name}/perl5" \
--with-thruk-tempdir="%{_localstatedir}/cache/%{name}/thruk" \
--with-thruk-vardir="%{_localstatedir}/lib/%{name}/thruk" \
--with-httpd-conf="%{_sysconfdir}/%{apachedir}/conf.d" \
--with-htmlurl="/naemon"
%{__make} %{?_smp_mflags} -j 1 all
%install
%{__rm} -rf %{buildroot}
%{__make} install \
DESTDIR="%{buildroot}" \
INSTALL_OPTS="" \
COMMAND_OPTS="" \
INIT_OPTS=""
# because we globally disabled binary striping, we have to do this manually for some files
%{__cp} -p %{buildroot}%{_bindir}/%{name} %{buildroot}%{_bindir}/%{name}-dbg
%{__strip} %{buildroot}%{_bindir}/%{name}
%{__strip} %{buildroot}%{_bindir}/naemonstats
%{__strip} %{buildroot}%{_bindir}/oconfsplit
%{__strip} %{buildroot}%{_bindir}/shadownaemon
%{__strip} %{buildroot}%{_bindir}/%{name}-unixcat
%{__strip} %{buildroot}%{_libdir}/%{name}/libnaemon.so.0.0.0
%{__strip} %{buildroot}%{_libdir}/%{name}/%{name}-livestatus/livestatus.so
%{__mv} %{buildroot}%{_sysconfdir}/logrotate.d/thruk %{buildroot}%{_sysconfdir}/logrotate.d/%{name}-thruk
%{__mv} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}-core
%{__mv} %{buildroot}%{_libdir}/%{name}/pkgconfig %{buildroot}%{_libdir}/pkgconfig
# Put the new RC sysconfig in place
%{__install} -d -m 0755 %{buildroot}/%{_sysconfdir}/sysconfig/
%{__install} -m 0644 %{name}-core/sample-config/%{name}.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/%{name}
# Make sure the default run directory exists
mkdir -p -m 0755 %{buildroot}%{_localstatedir}/run/%{name}
%{__mkdir_p} -m 0755 %{buildroot}%{_libdir}/%{name}/
%{__ln_s} %{_libdir}/nagios/plugins %{buildroot}%{_libdir}/%{name}/plugins
# We don't really want to distribute this
rm -f %{buildroot}%{_libdir}/%{name}/%{name}-livestatus/livestatus.la
%if 0%{?el7}%{?fc20}%{?fc21}%{?fc22}
# Install systemd entry
%{__install} -D -m 0644 -p %{name}-core/daemon-systemd %{buildroot}%{_unitdir}/%{name}.service
%{__install} -D -m 0644 -p %{name}-core/%{name}.tmpfiles.conf %{buildroot}%{_tmpfilesdir}/%{name}.conf
%{__install} -d -m 0755 %{buildroot}/%{_localstatedir}/run/%{name}/
# Move SystemV init-script
%{__mv} -f %{buildroot}%{_initrddir}/%{name} %{buildroot}/%{_bindir}/%{name}-ctl
# Cleanup rpath errors in perl modules
chrpath --delete %{buildroot}%{_libdir}/%{name}/perl5/%{_arch}-linux-thread-multi/auto/GD/GD.so
chrpath --delete %{buildroot}%{_libdir}/%{name}/perl5/%{_arch}-linux-thread-multi/auto/DBD/mysql/mysql.so
chrpath --delete %{buildroot}%{_libdir}/%{name}/perl5/%{_arch}-linux-thread-multi/auto/Time/HiRes/HiRes.so
chrpath --delete %{buildroot}%{_libdir}/%{name}/perl5/%{_arch}-linux-thread-multi/auto/XML/Parser/Expat/Expat.so
%endif
%clean
%{__rm} -rf %{buildroot}
%pre core
if ! /usr/bin/id naemon &>/dev/null; then
/usr/sbin/useradd -r -d %{_localstatedir}/lib/%{name} -s /bin/sh -c "naemon" naemon || \
%logmsg "Unexpected error adding user \"naemon\". Aborting installation."
fi
if ! /usr/bin/getent group naemon &>/dev/null; then
/usr/sbin/groupadd naemon &>/dev/null || \
%logmsg "Unexpected error adding group \"naemon\". Aborting installation."
fi
%post core
case "$*" in
2)
# Upgrading so try and restart if already running
# For systemctl systems we need to reload the configs
# becaues it'll complain if we just installed a new
# init script
%if 0%{?el7}%{?fc20}%{?fc21}%{?fc22}
systemctl daemon-reload
systemctl condrestart %{name}.service
%else
/etc/init.d/%{name} condrestart &>/dev/null || true
%endif
;;
1)
%if 0%{?el7}%{?fc20}%{?fc21}%{?fc22}
%systemd_post %{name}.service
%else
chkconfig --add %{name}
%endif
# enable livestatus if its installed. It happens that rpm install order is mixed up and the livestatus module
# get installed first and is therfore not enabled in its post script because there is no naemon.cfg yet.
if [ -e /usr/lib*/%{name}/%{name}-livestatus/livestatus.so ]; then
sed -i /etc/%{name}/%{name}.cfg -e 's~#\(broker_module=/usr/lib[0-9]*/%{name}/%{name}-livestatus/livestatus.so.*\)~\1~'
fi
;;
*) echo case "$*" not handled in post
esac
if /usr/bin/id %{apacheuser} &>/dev/null; then
if ! /usr/bin/id -Gn %{apacheuser} 2>/dev/null | grep -q naemon ; then
%if %{defined suse_version}
%if 0%{?suse_version} < 1230
/usr/sbin/groupmod -A %{apacheuser} naemon >/dev/null
%else
/usr/sbin/usermod -a -G naemon %{apacheuser} >/dev/null
%endif
%else
/usr/sbin/usermod -a -G naemon %{apacheuser} >/dev/null
%endif
fi
fi
touch /var/log/%{name}/%{name}.log
chmod 0664 /var/log/%{name}/%{name}.log
chown naemon:naemon /var/log/%{name}/%{name}.log
%preun core
case "$*" in
1)
# Upgrade, don't do anything
;;
0)
# Uninstall, go ahead and stop before removing
%if 0%{?el7}%{?fc20}%{?fc21}%{?fc22}
%systemd_preun %{name}.service
%else
/etc/init.d/naemon stop >/dev/null 2>&1 || :
service %{name} stop >/dev/null 2>&1 || :
chkconfig --del %{name} || :
%endif
rm -f /var/lib/naemon/status.dat
rm -f /var/lib/naemon/naemon.qh
rm -f /var/lib/naemon/naemon.tmp*
;;
*) echo case "$*" not handled in preun
esac
exit 0
%postun core
case "$*" in
0)
# POSTUN
rm -f /var/cache/%{name}/%{name}.configtest \
/var/lib/%{name}/objects.cache \
/var/lib/%{name}/objects.precache \
/var/lib/%{name}/retention.dat \
/var/log/%{name}/%{name}.log \
/var/log/%{name}/archives \
/var/run/%{name} \
/var/lib/%{name}/%{name}.cmd
%{insserv_cleanup}
chkconfig --del %{name} >/dev/null 2>&1 || :
systemctl try-restart %{name}.service >/dev/null 2>&1 || :
;;
1)
# POSTUPDATE
;;
*) echo case "$*" not handled in postun
esac
exit 0
%post livestatus
case "$*" in
2)
# Upgrading so try and restart if already running
%if 0%{?el7}%{?fc20}%{?fc21}%{?fc22}
systemctl condrestart %{name}.service
%else
/etc/init.d/%{name} condrestart &>/dev/null || :
%endif
# change broker path to new location
if [ -e /etc/%{name}/%{name}.cfg ]; then
sed -i /etc/%{name}/%{name}.cfg -e 's#/%{name}/livestatus.o#/%{name}/%{name}-livestatus/livestatus.so#'
fi
;;
1)
# New install, enable module
if [ -e /etc/%{name}/%{name}.cfg ]; then
sed -i /etc/%{name}/%{name}.cfg -e 's~#\(broker_module=/usr/lib[0-9]*/%{name}/%{name}-livestatus/livestatus.so.*\)~\1~'
fi
;;
*) echo case "$*" not handled in postun
esac
exit 0
%preun livestatus
case "$*" in
0)
# POSTUN
rm -f /var/log/%{name}/livestatus.log
;;
1)
# POSTUPDATE
;;
*) echo case "$*" not handled in postun
esac
exit 0
%postun livestatus
case "$*" in
0)
# POSTUN
if [ -e /etc/%{name}/%{name}.cfg ]; then
sed -i /etc/%{name}/%{name}.cfg -e 's~^\s*\(broker_module=/usr/lib[0-9]*/%{name}/%{name}-livestatus/livestatus.so.*\)~#\1~'
fi
;;
1)
# POSTUPDATE
;;
*) echo case "$*" not handled in postun
esac
exit 0
%pre thruk
if ! /usr/bin/id naemon &>/dev/null; then
/usr/sbin/useradd -r -d %{_localstatedir}/lib/%{name} -s /bin/sh -c "naemon" naemon || \
%logmsg "Unexpected error adding user \"naemon\". Aborting installation."
fi
if ! /usr/bin/getent group naemon &>/dev/null; then
/usr/sbin/groupadd naemon &>/dev/null || \
%logmsg "Unexpected error adding group \"naemon\". Aborting installation."
fi
# save themes, plugins so we don't reenable them on every update
rm -rf /var/cache/%{name}/thruk_update
if [ -d /etc/%{name}/themes/themes-enabled/. ]; then
mkdir -p /var/cache/%{name}/thruk_update/themes
cp -rp /etc/%{name}/themes/themes-enabled/* /var/cache/%{name}/thruk_update/themes/ 2>/dev/null
fi
if [ -d /etc/%{name}/plugins/plugins-enabled/. ]; then
mkdir -p /var/cache/%{name}/thruk_update/plugins
cp -rp /etc/%{name}/plugins/plugins-enabled/* /var/cache/%{name}/thruk_update/plugins/ 2>/dev/null
fi
exit 0
%post thruk
chkconfig --add thruk
mkdir -p /var/lib/%{name}/thruk /var/cache/%{name}/thruk /etc/%{name}/bp /var/log/%{name} /etc/%{name}/conf.d
touch /var/log/%{name}/thruk.log
chown -R %{apacheuser}:%{apachegroup} /var/cache/%{name}/thruk /var/log/%{name}/thruk.log /etc/%{name}/plugins/plugins-enabled /etc/%{name}/thruk_local.conf /etc/%{name}/bp /var/lib/%{name}/thruk
/usr/bin/crontab -l -u %{apacheuser} 2>/dev/null | /usr/bin/crontab -u %{apacheuser} -
# add webserver user to group naemon
if /usr/bin/id %{apacheuser} &>/dev/null; then
if ! /usr/bin/id -Gn %{apacheuser} 2>/dev/null | grep -q naemon ; then
%if %{defined suse_version}
%if 0%{?suse_version} < 1230
/usr/sbin/groupmod -A %{apacheuser} naemon >/dev/null
%else
/usr/sbin/usermod -a -G naemon %{apacheuser} >/dev/null
%endif
%else
/usr/sbin/usermod -a -G naemon %{apacheuser} >/dev/null
%endif
fi
else
%logmsg "User \"%{apacheuser}\" does not exist and is not added to group \"naemon\". Sending commands to naemon from the CGIs is not possible."
fi
%if %{defined suse_version}
a2enmod alias
a2enmod fcgid
a2enmod auth_basic
a2enmod rewrite
/etc/init.d/apache2 try-restart
%else
service httpd condrestart
if [ "$(getenforce 2>/dev/null)" = "Enforcing" ]; then
echo "******************************************";
echo "Thruk will not work when SELinux is enabled";
echo "SELinux: "$(getenforce);
echo "******************************************";
fi
%endif
if [ -d %{_libdir}/%{name}/perl5 ]; then
/usr/bin/thruk -a clearcache,installcron --local > /dev/null
fi
echo "Naemon/Thruk have been configured for http://$(hostname)/naemon/."
echo "The default user is 'admin' with password 'admin'. You can usually change that by 'htpasswd /etc/naemon/htpasswd admin'. And you really should change that!"
exit 0
%posttrans thruk
# restore themes and plugins
if [ -d /var/cache/%{name}/thruk_update/themes/. ]; then
rm -f /etc/%{name}/themes/themes-enabled/*
cp -rp /var/cache/%{name}/thruk_update/themes/* /etc/%{name}/themes/themes-enabled/ 2>/dev/null # might fail if no themes are enabled
fi
if [ -d /var/cache/%{name}/thruk_update/plugins/. ]; then
rm -f /etc/%{name}/plugins/plugins-enabled/*
cp -rp /var/cache/%{name}/thruk_update/plugins/* /etc/%{name}/plugins/plugins-enabled/ 2>/dev/null # might fail if no plugins are enabled
fi
echo "thruk plugins enabled:" $(ls /etc/%{name}/plugins/plugins-enabled/)
rm -rf /var/cache/%{name}/thruk_update
%preun thruk
if [ $1 = 0 ]; then
# last version will be deinstalled
if [ -d %{_libdir}/%{name}/perl5 ]; then
/usr/bin/thruk -a uninstallcron --local
fi
fi
/etc/init.d/thruk stop
chkconfig --del thruk >/dev/null 2>&1
exit 0
%postun thruk
case "$*" in
0)
# POSTUN
rm -rf /var/cache/%{name}/thruk \
%{_datadir}/%{name}/root/thruk/plugins \
/var/lib/%{name}/thruk
# try to clean some empty folders
rmdir /etc/%{name}/plugins/plugins-available 2>/dev/null
rmdir /etc/%{name}/plugins/plugins-enabled 2>/dev/null
rmdir /etc/%{name}/plugins 2>/dev/null
rmdir /etc/%{name}/bp 2>/dev/null
rmdir /etc/%{name} 2>/dev/null
%{insserv_cleanup}
;;
1)
# POSTUPDATE
rm -rf /var/cache/%{name}/thruk/*
mkdir -p /var/cache/%{name}/thruk/reports
chown -R %{apacheuser}:%{apachegroup} /var/cache/%{name}/thruk
;;
*) echo case "$*" not handled in postun
esac
exit 0
%preun thruk-libs
if [ $1 = 0 ]; then
# last version will be deinstalled
if [ -e /usr/bin/thruk ]; then
/usr/bin/thruk -a uninstallcron --local
fi
fi
exit 0
%post thruk-libs
if [ -e /usr/bin/thruk ]; then
/usr/bin/thruk -a clearcache,installcron --local > /dev/null
fi
exit 0
%post thruk-reporting
rm -f /etc/%{name}/plugins/plugins-enabled/reports2
ln -s ../plugins-available/reports2 /etc/%{name}/plugins/plugins-enabled/reports2
/etc/init.d/thruk condrestart &>/dev/null || :
exit 0
%preun thruk-reporting
rm -f /etc/%{name}/plugins/plugins-enabled/reports2
/etc/init.d/thruk condrestart &>/dev/null || :
exit 0
%postun thruk-reporting
case "$*" in
0)
# POSTUN
# try to clean some empty folders
rmdir /etc/%{name}/plugins/plugins-available 2>/dev/null
rmdir /etc/%{name}/plugins/plugins-enabled 2>/dev/null
rmdir /etc/%{name}/plugins 2>/dev/null
rmdir /etc/%{name} 2>/dev/null
;;
1)
# POSTUPDATE
;;
*) echo case "$*" not handled in postun
esac
exit 0
%files
%files core
%doc README.md naemon.rpmlintrc
%doc naemon-core/AUTHORS naemon-core/COPYING
%doc naemon-core/ChangeLog naemon-core/INSTALL naemon-core/LEGAL
%doc naemon-core/NEWS naemon-core/README naemon-core/THANKS
%doc naemon-core/UPGRADING
%attr(0755,root,root) %{_bindir}/%{name}
%if 0%{?el7}%{?fc20}%{?fc21}%{?fc22}
%attr(0644,root,root) %{_unitdir}/%{name}.service
%attr(0644,root,root) %{_tmpfilesdir}/%{name}.conf
%attr(0755,root,root) %{_bindir}/%{name}-ctl
%else
%attr(0755,root,root) %{_initrddir}/naemon
%endif
%attr(0755,naemon,naemon) %dir %{_localstatedir}/run/%{name}
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}-core
%attr(0755,root,root) %dir %{_sysconfdir}/%{name}/
%attr(2775,naemon,naemon) %dir %{_sysconfdir}/%{name}/conf.d
%attr(0644,naemon,naemon) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.cfg
%attr(0640,naemon,naemon) %config(noreplace) %{_sysconfdir}/%{name}/resource.cfg
%attr(0664,naemon,naemon) %config(noreplace) %{_sysconfdir}/%{name}/conf.d/*.cfg
%attr(0664,naemon,naemon) %config(noreplace) %{_sysconfdir}/%{name}/conf.d/templates/*.cfg
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%attr(2775,naemon,%{apachegroup}) %dir %{_localstatedir}/cache/%{name}/checkresults
%attr(2775,naemon,naemon) %dir %{_localstatedir}/cache/%{name}
%attr(0755,naemon,naemon) %dir %{_localstatedir}/lib/%{name}
%attr(0755,naemon,naemon) %dir %{_localstatedir}/log/%{name}
%attr(0755,naemon,naemon) %dir %{_localstatedir}/log/%{name}/archives
%attr(-,root,root) %{_libdir}/%{name}/plugins
%{_mandir}/man8/naemon.8*
%files tools
%attr(0755,root,root) %{_bindir}/naemonstats
%attr(0755,root,root) %{_bindir}/oconfsplit
%attr(0755,root,root) %{_bindir}/shadownaemon
%{_mandir}/man8/naemonstats.8*
%{_mandir}/man8/oconfsplit.8*
%{_mandir}/man8/shadownaemon.8*
%files -n libnaemon
%attr(-,root,root) %{_libdir}/%{name}/libnaemon.so*
%{_mandir}/man8/naemonstats.8*
%{_mandir}/man8/oconfsplit.8*
%{_mandir}/man8/shadownaemon.8*
%files core-dbg
%attr(0755,root,root) %{_bindir}/%{name}-dbg
%files devel
%attr(-,root,root) %{_includedir}/%{name}/
%attr(-,root,root) %{_libdir}/%{name}/libnaemon.a
%attr(-,root,root) %{_libdir}/%{name}/libnaemon.la
%attr(-,root,root) %{_libdir}/pkgconfig/naemon.pc
%files livestatus
%attr(0755,root,root) %{_bindir}/%{name}-unixcat
%attr(0755,naemon,naemon) %dir %{_libdir}/%{name}/%{name}-livestatus
%attr(0644,root,root) %{_libdir}/%{name}/%{name}-livestatus/livestatus.so
%attr(0755,naemon,naemon) %dir %{_localstatedir}/log/%{name}
%files thruk
%attr(0755,root, root) %{_bindir}/thruk
%attr(0755,root, root) %{_bindir}/naglint
%attr(0755,root, root) %{_bindir}/nagexp
%attr(0755,root, root) %{_initrddir}/thruk
%config %{_sysconfdir}/%{name}/ssi
%config %{_sysconfdir}/%{name}/thruk.conf
%attr(0644,%{apacheuser},%{apachegroup}) %config(noreplace) %{_sysconfdir}/%{name}/thruk_local.conf
%attr(0644,%{apacheuser},%{apachegroup}) %config(noreplace) %{_sysconfdir}/%{name}/cgi.cfg
%attr(0644,%{apacheuser},%{apachegroup}) %config(noreplace) %{_sysconfdir}/%{name}/htpasswd
%attr(0755,%{apacheuser},%{apachegroup}) %dir %{_sysconfdir}/%{name}/bp
%config(noreplace) %{_sysconfdir}/%{name}/naglint.conf
%config(noreplace) %{_sysconfdir}/%{name}/log4perl.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}-thruk
%config(noreplace) %{_sysconfdir}/%{apachedir}/conf.d/thruk.conf
%config(noreplace) %{_sysconfdir}/%{apachedir}/conf.d/thruk_cookie_auth_vhost.conf
%config(noreplace) %{_sysconfdir}/%{name}/themes
%config(noreplace) %{_sysconfdir}/%{name}/menu_local.conf
%config(noreplace) %{_sysconfdir}/%{name}/usercontent
%config(noreplace) %{_sysconfdir}/%{name}/bp/bp_functions.pm
%attr(0755,root, root) %{_datadir}/%{name}/thruk_auth
%attr(0755,root, root) %{_datadir}/%{name}/script/thruk_fastcgi.pl
%attr(0755,%{apacheuser},%{apachegroup}) %dir %{_localstatedir}/cache/%{name}/thruk
%{_datadir}/%{name}/root
%{_datadir}/%{name}/templates
%{_datadir}/%{name}/themes
%{_datadir}/%{name}/plugins/plugins-available/business_process
%config %{_sysconfdir}/%{name}/plugins/plugins-enabled/business_process
%config %{_sysconfdir}/%{name}/plugins/plugins-available/business_process
%{_datadir}/%{name}/plugins/plugins-available/conf
%config %{_sysconfdir}/%{name}/plugins/plugins-enabled/conf
%config %{_sysconfdir}/%{name}/plugins/plugins-available/conf
%{_datadir}/%{name}/plugins/plugins-available/dashboard
%config %{_sysconfdir}/%{name}/plugins/plugins-available/dashboard
%{_datadir}/%{name}/plugins/plugins-available/minemap
%config %{_sysconfdir}/%{name}/plugins/plugins-enabled/minemap
%config %{_sysconfdir}/%{name}/plugins/plugins-available/minemap
%{_datadir}/%{name}/plugins/plugins-available/mobile
%config %{_sysconfdir}/%{name}/plugins/plugins-enabled/mobile
%config %{_sysconfdir}/%{name}/plugins/plugins-available/mobile
%{_datadir}/%{name}/plugins/plugins-available/panorama
%config %{_sysconfdir}/%{name}/plugins/plugins-enabled/panorama
%config %{_sysconfdir}/%{name}/plugins/plugins-available/panorama
%{_datadir}/%{name}/plugins/plugins-available/shinken_features
%config %{_sysconfdir}/%{name}/plugins/plugins-available/shinken_features
%{_datadir}/%{name}/plugins/plugins-available/statusmap
%config %{_sysconfdir}/%{name}/plugins/plugins-enabled/statusmap
%config %{_sysconfdir}/%{name}/plugins/plugins-available/statusmap
%{_datadir}/%{name}/plugins/plugins-available/wml
%config %{_sysconfdir}/%{name}/plugins/plugins-available/wml
%{_datadir}/%{name}/lib
%{_datadir}/%{name}/Changes
%{_datadir}/%{name}/LICENSE
%{_datadir}/%{name}/menu.conf
%{_datadir}/%{name}/dist.ini
%{_datadir}/%{name}/thruk_cookie_auth.include
%{_datadir}/%{name}/%{name}-version
%attr(0755,root,root) %{_datadir}/%{name}/fcgid_env.sh
%{_mandir}/man3/nagexp.3*
%{_mandir}/man3/naglint.3*
%{_mandir}/man3/thruk.3*
%{_mandir}/man8/thruk.8*
%files thruk-libs
%attr(-,root,root) %{_libdir}/%{name}/perl5
%files thruk-reporting
%{_datadir}/%{name}/plugins/plugins-available/reports2
%{_sysconfdir}/%{name}/plugins/plugins-available/reports2
%{_sysconfdir}/%{name}/plugins/plugins-enabled/reports2
%changelog
* Sun Feb 23 2014 Daniel Wittenberg <dwittenberg2008@gmail.com> 0.8.0-2
- Add native and full systemctl control on el7
* Thu Feb 06 2014 Daniel Wittenberg <dwittenberg2008@gmail.com> 0.1.0-1
- Add reload for systemctl-based setups
* Thu Feb 06 2014 Sven Nierlein <sven.nierlein@consol.de> 0.1.0-1
- moved thruks reporting addon into seperate package
* Tue Nov 26 2013 Sven Nierlein <sven.nierlein@consol.de> 0.0.1-1
- initial naemon meta package