]> granicus.if.org Git - icinga2/blob - icinga2.spec
Release version 2.4.9
[icinga2] / icinga2.spec
1 #/******************************************************************************
2 # * Icinga 2                                                                   *
3 # * Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/)  *
4 # *                                                                            *
5 # * This program is free software; you can redistribute it and/or              *
6 # * modify it under the terms of the GNU General Public License                *
7 # * as published by the Free Software Foundation; either version 2             *
8 # * of the License, or (at your option) any later version.                     *
9 # *                                                                            *
10 # * This program is distributed in the hope that it will be useful,            *
11 # * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
12 # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
13 # * GNU General Public License for more details.                               *
14 # *                                                                            *
15 # * You should have received a copy of the GNU General Public License          *
16 # * along with this program; if not, write to the Free Software Foundation     *
17 # * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
18 # ******************************************************************************/
19
20 %define revision 1
21
22 # make sure that _rundir is working on older systems
23 %if ! %{defined _rundir}
24 %define _rundir %{_localstatedir}/run
25 %endif
26
27 %define _libexecdir %{_prefix}/lib/
28
29 %if "%{_vendor}" == "redhat"
30 %define apachename httpd
31 %define apacheconfdir %{_sysconfdir}/httpd/conf.d
32 %define apacheuser apache
33 %define apachegroup apache
34 %if 0%{?el5}%{?el6}
35 %define use_systemd 0
36 %if %(uname -m) != "x86_64"
37 %define march_flag -march=i686
38 %endif
39 %else
40 # fedora and el>=7
41 %define use_systemd 1
42 %endif
43 %endif
44
45 %if "%{_vendor}" == "suse"
46 %define apachename apache2
47 %define apacheconfdir  %{_sysconfdir}/apache2/conf.d
48 %define apacheuser wwwrun
49 %define apachegroup www
50 %if 0%{?suse_version} >= 1310
51 %define use_systemd 1
52 %else
53 %define use_systemd 0
54 %endif
55 %endif
56
57 %define icinga_user icinga
58 %define icinga_group icinga
59 %define icingacmd_group icingacmd
60 %define icingaweb2name icingaweb2
61 %define icingaweb2version 2.0.0
62
63 %define icingaclassicconfdir %{_sysconfdir}/icinga
64
65 %define logmsg logger -t %{name}/rpm
66
67 Summary: Network monitoring application
68 Name: icinga2
69 Version: 2.4.9
70 Release: %{revision}%{?dist}
71 License: GPL-2.0+
72 Group: Applications/System
73 Source: https://github.com/Icinga/%{name}/archive/v%{version}.tar.gz
74 URL: https://www.icinga.org/
75 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
76 Requires: %{name}-bin = %{version}-%{release}
77
78 %description
79 Meta package for Icinga 2 Core, DB IDO and Web.
80
81 %package bin
82 Summary:      Icinga 2 binaries and libraries
83 Group:        Applications/System
84
85 %if "%{_vendor}" == "suse"
86 PreReq:        permissions
87 Provides:      monitoring_daemon
88 Recommends:    monitoring-plugins
89 %if 0%{?suse_version} >= 1310
90 BuildRequires: libyajl-devel
91 %endif
92 %endif
93 BuildRequires: libedit-devel
94 BuildRequires: ncurses-devel
95 %if "%{_vendor}" == "suse" && 0%{?suse_version} < 1210
96 BuildRequires: gcc48-c++
97 BuildRequires: libstdc++47-devel
98 BuildRequires: libopenssl1-devel
99 %else
100 BuildRequires: gcc-c++
101 BuildRequires: libstdc++-devel
102 BuildRequires: openssl-devel
103 %endif
104 BuildRequires: cmake
105 BuildRequires: flex >= 2.5.35
106 BuildRequires: bison
107 BuildRequires: make
108 %if 0%{?fedora}
109 BuildRequires: wxGTK3-devel
110 BuildRequires: firewalld-filesystem
111 Requires: firewalld-filesystem
112 Requires(post): firewalld-filesystem
113 %endif
114 %if 0%{?rhel} == 7
115 Requires: firewalld
116 Requires(post): firewalld
117 %endif
118
119 %if 0%{?build_icinga_org} && "%{_vendor}" == "redhat" && (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
120 # el5 and el6 require packages.icinga.org
121 BuildRequires: boost153-devel
122 %else
123 %if 0%{?build_icinga_org} && "%{_vendor}" == "suse" && 0%{?suse_version} < 1310
124 # sles 11 sp3 requires packages.icinga.org
125 BuildRequires: boost153-devel
126 %else
127 BuildRequires: boost-devel >= 1.41
128 %endif
129 %endif
130
131 %if 0%{?use_systemd}
132 BuildRequires: systemd
133 Requires: systemd
134 %endif
135
136 Requires: %{name}-libs = %{version}-%{release}
137
138 %description bin
139 Icinga 2 is a general-purpose network monitoring application.
140 Provides binaries for Icinga 2 Core.
141
142 %package common
143 Summary:      Common Icinga 2 configuration
144 Group:        Applications/System
145 %if "%{_vendor}" == "redhat"
146 Requires(pre): shadow-utils
147 Requires(post): shadow-utils
148 %endif
149 %if "%{_vendor}" == "suse"
150 Recommends:   logrotate
151 %endif
152
153 %description common
154 Provides common directories, uid and gid among Icinga 2 related
155 packages.
156
157
158 %package doc
159 Summary:      Documentation for Icinga 2
160 Group:        Applications/System
161 Requires:     %{name} = %{version}-%{release}
162
163 %description doc
164 Provides documentation for Icinga 2.
165
166
167 %package libs
168 Summary:      Libraries for Icinga 2
169 Group:        Applications/System
170 Requires:     %{name}-common = %{version}-%{release}
171
172 %description libs
173 Provides internal libraries for the daemon or studio.
174
175
176 %package ido-mysql
177 Summary:      IDO MySQL database backend for Icinga 2
178 Group:        Applications/System
179 %if "%{_vendor}" == "suse"
180 BuildRequires: libmysqlclient-devel
181 %if 0%{?suse_version} >= 1310
182 BuildRequires: mysql-devel
183 %endif
184
185 %else
186 BuildRequires: mysql-devel
187 %endif #suse
188
189 Requires: %{name} = %{version}-%{release}
190
191 %description ido-mysql
192 Icinga 2 IDO mysql database backend. Compatible with Icinga 1.x
193 IDOUtils schema >= 1.12
194
195
196 %package ido-pgsql
197 Summary:      IDO PostgreSQL database backend for Icinga 2
198 Group:        Applications/System
199 BuildRequires: postgresql-devel
200 Requires: %{name} = %{version}-%{release}
201
202 %description ido-pgsql
203 Icinga 2 IDO PostgreSQL database backend. Compatible with Icinga 1.x
204 IDOUtils schema >= 1.12
205
206
207 %package classicui-config
208 Summary:      Icinga 2 Classic UI Standalone configuration
209 Group:        Applications/System
210 BuildRequires: %{apachename}
211 Requires:     %{apachename}
212 Requires:     %{name} = %{version}-%{release}
213 %if "%{_vendor}" == "suse"
214 Recommends:   icinga-www
215 %endif
216 Provides:     icinga-classicui-config
217 Conflicts:    icinga-gui-config
218
219 %description classicui-config
220 Icinga 1.x Classic UI Standalone configuration with locations
221 for Icinga 2.
222
223 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
224 %global selinux_variants mls targeted
225 %{!?_selinux_policy_version: %global _selinux_policy_version %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp 2>/dev/null)}
226 %global modulename %{name}
227
228 %package selinux
229 Summary:        SELinux policy module supporting icinga2
230 Group:          System Environment/Base
231 BuildRequires:  checkpolicy, selinux-policy-devel, /usr/share/selinux/devel/policyhelp, hardlink
232 %if "%{_selinux_policy_version}" != ""
233 Requires:       selinux-policy >= %{_selinux_policy_version}
234 %endif
235 Requires:       %{name} = %{version}-%{release}
236 Requires(post):   /usr/sbin/semodule, /sbin/restorecon
237 Requires(postun): /usr/sbin/semodule, /sbin/restorecon
238
239 %description selinux
240 SELinux policy module supporting icinga2
241 %endif
242
243
244 %if 0%{?fedora}
245 %package studio
246 Summary:      Studio for Icinga 2
247 Group:        Applications/System
248 Requires:     %{name}-libs = %{version}-%{release}
249 Requires:     wxGTK3
250
251 %description studio
252 Provides a GUI for the Icinga 2 API.
253 %endif
254
255
256 %prep
257 %setup -q -n %{name}-%{version}
258
259 %build
260 CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \
261          -DCMAKE_INSTALL_SYSCONFDIR=/etc \
262          -DCMAKE_INSTALL_LOCALSTATEDIR=/var \
263          -DCMAKE_BUILD_TYPE=RelWithDebInfo \
264          -DCMAKE_VERBOSE_MAKEFILE=ON \
265          -DBoost_NO_BOOST_CMAKE=ON \
266          -DICINGA2_RUNDIR=%{_rundir} \
267          -DICINGA2_USER=%{icinga_user} \
268          -DICINGA2_GROUP=%{icinga_group} \
269          -DICINGA2_COMMAND_GROUP=%{icingacmd_group}"
270 %if 0%{?fedora}
271 CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_STUDIO=true"
272 %endif
273 %if "%{_vendor}" == "redhat"
274 %if 0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6"
275 # Boost_VERSION 1.41.0 vs 101400 - disable build tests
276 # details in https://dev.icinga.org/issues/5033
277 CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost153 \
278  -DBOOST_INCLUDEDIR=/usr/include/boost153 \
279  -DBoost_ADDITIONAL_VERSIONS='1.53;1.53.0' \
280  -DBoost_NO_SYSTEM_PATHS=TRUE \
281  -DBUILD_TESTING=FALSE \
282  -DBoost_NO_BOOST_CMAKE=TRUE"
283 %endif
284 %if 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6"
285 CMAKE_OPTS="$CMAKE_OPTS -DBUILD_TESTING=FALSE"
286 %endif
287 %endif
288
289 %if "%{_vendor}" != "suse"
290 CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_PLUGINDIR=%{_libdir}/nagios/plugins"
291 %else
292 %if 0%{?suse_version} < 1310
293 CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost153 \
294  -DBOOST_INCLUDEDIR=/usr/include/boost153 \
295  -DBoost_ADDITIONAL_VERSIONS='1.53;1.53.0' \
296  -DBoost_NO_SYSTEM_PATHS=TRUE \
297  -DBUILD_TESTING=FALSE \
298  -DBoost_NO_BOOST_CMAKE=TRUE"
299 %endif
300 CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_PLUGINDIR=%{_prefix}/lib/nagios/plugins"
301 %endif
302
303 %if 0%{?use_systemd}
304 CMAKE_OPTS="$CMAKE_OPTS -DUSE_SYSTEMD=ON"
305 %endif
306
307 cmake $CMAKE_OPTS -DCMAKE_C_FLAGS:STRING="%{optflags} %{?march_flag}" -DCMAKE_CXX_FLAGS:STRING="%{optflags} %{?march_flag}" .
308
309 make %{?_smp_mflags}
310
311 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
312 cd tools/selinux
313 for selinuxvariant in %{selinux_variants}
314 do
315   make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile
316   mv %{modulename}.pp %{modulename}.pp.${selinuxvariant}
317   make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean
318 done
319 cd -
320 %endif
321
322 %install
323 make install \
324         DESTDIR="%{buildroot}"
325
326 # install classicui config
327 install -D -m 0644 etc/icinga/icinga-classic.htpasswd %{buildroot}%{icingaclassicconfdir}/passwd
328 install -D -m 0644 etc/icinga/cgi.cfg %{buildroot}%{icingaclassicconfdir}/cgi.cfg
329 install -D -m 0644 etc/icinga/icinga-classic-apache.conf %{buildroot}%{apacheconfdir}/icinga.conf
330
331 # remove features-enabled symlinks
332 rm -f %{buildroot}/%{_sysconfdir}/%{name}/features-enabled/*.conf
333
334 # enable suse rc links
335 %if "%{_vendor}" == "suse"
336 %if 0%{?use_systemd}
337   ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
338 %else
339   ln -sf ../../%{_initrddir}/%{name} "%{buildroot}%{_sbindir}/rc%{name}"
340 %endif
341 mkdir -p "%{buildroot}%{_localstatedir}/adm/fillup-templates/"
342 mv "%{buildroot}%{_sysconfdir}/sysconfig/%{name}" "%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}"
343 %endif
344
345 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
346 cd tools/selinux
347 for selinuxvariant in %{selinux_variants}
348 do
349   install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
350   install -p -m 644 %{modulename}.pp.${selinuxvariant} \
351     %{buildroot}%{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp
352 done
353 cd -
354
355 /usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux
356 %endif
357
358 %if 0%{?fedora}
359 mkdir -p "%{buildroot}%{_datadir}/icinga2-studio"
360 install -p -m 644 icinga-studio/icinga.ico %{buildroot}%{_datadir}/icinga2-studio
361
362 mkdir -p "%{buildroot}%{_datadir}/applications"
363 echo "[Desktop Entry]
364 Name=Icinga 2 Studio
365 Comment=API viewer for Icinga 2
366 TryExec=icinga-studio
367 Exec=icinga-studio
368 Icon=/usr/share/icinga2-studio/icinga.ico
369 StartupNotify=true
370 Terminal=false
371 Type=Application
372 Categories=GTK;Utility;
373 Keywords=Monitoring;" > %{buildroot}%{_datadir}/applications/icinga2-studio.desktop
374 %endif
375
376 %if 0%{?fedora} || 0%{?rhel} == 7
377 mkdir -p %{buildroot}%{_prefix}/lib/firewalld/services
378 install -p -m 644 tools/firewalld/%{name}.xml %{buildroot}%{_prefix}/lib/firewalld/services
379 %endif
380
381 %clean
382 [ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
383
384 %pre common
385 getent group %{icinga_group} >/dev/null || %{_sbindir}/groupadd -r %{icinga_group}
386 getent group %{icingacmd_group} >/dev/null || %{_sbindir}/groupadd -r %{icingacmd_group}
387 getent passwd %{icinga_user} >/dev/null || %{_sbindir}/useradd -c "icinga" -s /sbin/nologin -r -d %{_localstatedir}/spool/%{name} -G %{icingacmd_group} -g %{icinga_group} %{icinga_user}
388
389 %if "%{_vendor}" == "suse"
390 %if 0%{?use_systemd}
391   %service_add_pre %{name}.service
392 %endif
393 %endif
394
395 %if "%{_vendor}" == "suse"
396 %verifyscript bin
397 %verify_permissions -e %{_rundir}/%{name}/cmd
398 %endif
399
400 %post bin
401
402 # suse
403 %if "%{_vendor}" == "suse"
404
405 %if 0%{?suse_version} >= 1310
406 %set_permissions %{_rundir}/%{name}/cmd
407 %endif
408
409 %endif #suse/rhel
410
411 %if 0%{?fedora}
412 %firewalld_reload
413 %endif
414 %if 0%{?rhel} == 7
415 test -f /usr/bin/firewall-cmd && firewall-cmd --reload --quiet || :
416 %endif
417
418
419 %post common
420 # suse
421 %if "%{_vendor}" == "suse"
422 %if 0%{?use_systemd}
423 %fillup_only  %{name}
424 %service_add_post %{name}.service
425 %else
426 %fillup_and_insserv %{name}
427 %endif
428
429 # initial installation, enable default features
430 for feature in checker notification mainlog; do
431         ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
432 done
433
434 exit 0
435
436 %else
437 # rhel
438
439 %if 0%{?use_systemd}
440 %systemd_post %{name}.service
441 %else
442 /sbin/chkconfig --add %{name}
443 %endif
444
445 if [ ${1:-0} -eq 1 ]
446 then
447         # initial installation, enable default features
448         for feature in checker notification mainlog; do
449                 ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
450         done
451 fi
452
453 exit 0
454
455 %endif
456 # suse/rhel
457
458 %postun common
459 # suse
460 %if "%{_vendor}" == "suse"
461 %if 0%{?using_systemd}
462   %service_del_postun %{name}.service
463 %else
464   %restart_on_update %{name}
465   %insserv_cleanup
466 %endif
467
468 %else
469 # rhel
470
471 %if 0%{?use_systemd}
472 %systemd_postun_with_restart %{name}.service
473 %else
474 if [ "$1" -ge  "1" ]; then
475         /sbin/service %{name} condrestart >/dev/null 2>&1 || :
476 fi
477 %endif
478
479 %endif
480 # suse / rhel
481
482 if [ "$1" = "0" ]; then
483         # deinstallation of the package - remove enabled features
484         rm -rf %{_sysconfdir}/%{name}/features-enabled
485 fi
486
487 exit 0
488
489 %preun common
490 # suse
491 %if "%{_vendor}" == "suse"
492
493 %if 0%{?use_systemd}
494   %service_del_preun %{name}.service
495 %else
496   %stop_on_removal %{name}
497 %endif
498
499 exit 0
500
501 %else
502 # rhel
503
504 %if 0%{?use_systemd}
505 %systemd_preun %{name}.service
506 %else
507 if [ "$1" = "0" ]; then
508         /sbin/service %{name} stop > /dev/null 2>&1 || :
509         /sbin/chkconfig --del %{name} || :
510 fi
511 %endif
512
513 exit 0
514
515 %endif
516 # suse / rhel
517
518 %post ido-mysql
519 if [ ${1:-0} -eq 1 ]
520 then
521         # initial installation, enable ido-mysql feature
522         ln -sf ../features-available/ido-mysql.conf %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
523 fi
524
525 exit 0
526
527 %postun ido-mysql
528 if [ "$1" = "0" ]; then
529         # deinstallation of the package - remove feature
530         rm -f %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
531 fi
532
533 exit 0
534
535 %post ido-pgsql
536 if [ ${1:-0} -eq 1 ]
537 then
538         # initial installation, enable ido-pgsql feature
539         ln -sf ../features-available/ido-pgsql.conf %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
540 fi
541
542 exit 0
543
544 %postun ido-pgsql
545 if [ "$1" = "0" ]; then
546         # deinstallation of the package - remove feature
547         rm -f %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
548 fi
549
550 exit 0
551
552 %post classicui-config
553 if [ ${1:-0} -eq 1 ]
554 then
555         # initial installation, enable features
556         for feature in statusdata compatlog command; do
557                 ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
558         done
559 fi
560
561 exit 0
562
563 %postun classicui-config
564 if [ "$1" = "0" ]; then
565         # deinstallation of the package - remove feature
566         for feature in statusdata compatlog command; do
567                 rm -f %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
568         done
569 fi
570
571 exit 0
572
573 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
574 %post selinux
575 for selinuxvariant in %{selinux_variants}
576 do
577   /usr/sbin/semodule -s ${selinuxvariant} -i \
578     %{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp &> /dev/null || :
579 done
580 /sbin/fixfiles -R icinga2-bin restore &> /dev/null || :
581 /sbin/fixfiles -R icinga2-common restore &> /dev/null || :
582 /sbin/semanage port -a -t icinga2_port_t -p tcp 5665 &> /dev/null || :
583
584 %postun selinux
585 if [ $1 -eq 0 ] ; then
586   /sbin/semanage port -d -t icinga2_port_t -p tcp 5665 &> /dev/null || :
587   for selinuxvariant in %{selinux_variants}
588   do
589      /usr/sbin/semodule -s ${selinuxvariant} -r %{modulename} &> /dev/null || :
590   done
591   /sbin/fixfiles -R icinga2-bin restore &> /dev/null || :
592   /sbin/fixfiles -R icinga2-common restore &> /dev/null || :
593 fi
594 %endif
595
596
597 %files
598 %defattr(-,root,root,-)
599 %doc COPYING
600
601 %files bin
602 %defattr(-,root,root,-)
603 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
604 %{_sbindir}/%{name}
605 %dir %{_libdir}/%{name}/sbin
606 %{_libdir}/%{name}/sbin/%{name}
607 %{_datadir}/%{name}
608 %exclude %{_datadir}/%{name}/include
609 %{_mandir}/man8/%{name}.8.gz
610
611 %attr(0750,%{icinga_user},%{icingacmd_group}) %{_localstatedir}/cache/%{name}
612 %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
613 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/crash
614 %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat
615 %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat/archives
616 %attr(0750,%{icinga_user},%{icinga_group}) %{_localstatedir}/lib/%{name}
617
618 %attr(0750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}
619 %attr(2750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}/cmd
620
621 %if 0%{?fedora} || 0%{?rhel} == 7
622 %{_prefix}/lib/firewalld/services/%{name}.xml
623 %endif
624
625 %files libs
626 %defattr(-,root,root,-)
627 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
628 %exclude %{_libdir}/%{name}/libdb_ido_mysql*
629 %exclude %{_libdir}/%{name}/libdb_ido_pgsql*
630 %dir %{_libdir}/%{name}
631 %{_libdir}/%{name}/*.so*
632
633 %files common
634 %defattr(-,root,root,-)
635 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog tools/syntax
636 %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
637 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
638 %{_sysconfdir}/bash_completion.d/%{name}
639 %if 0%{?use_systemd}
640 %attr(644,root,root) %{_unitdir}/%{name}.service
641 %else
642 %attr(755,root,root) %{_sysconfdir}/init.d/%{name}
643 %endif
644 %if "%{_vendor}" == "suse"
645 %{_sbindir}/rc%{name}
646 %{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
647 %else
648 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
649 %endif
650 %attr(0750,root,%{icinga_group}) %dir %{_sysconfdir}/%{name}
651 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d
652 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-available
653 %exclude %{_sysconfdir}/%{name}/features-available/ido-*.conf
654 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-enabled
655 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/repository.d
656 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/scripts
657 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/repository.d
658 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/zones.d
659 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/%{name}.conf
660 %config(noreplace) %attr(0640,root,%{icinga_group}) %{_sysconfdir}/%{name}/init.conf
661 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/constants.conf
662 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.conf
663 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/*.conf
664 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/*.conf
665 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/repository.d/*
666 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.d/*
667 %config(noreplace) %{_sysconfdir}/%{name}/scripts/*
668 %dir %{_libexecdir}/%{name}
669 %{_libexecdir}/%{name}/prepare-dirs
670 %{_libexecdir}/%{name}/safe-reload
671 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}
672 %attr(0770,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/perfdata
673 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/tmp
674 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_datadir}/%{name}/include
675 %{_datadir}/%{name}/include
676
677 %files doc
678 %defattr(-,root,root,-)
679 %{_datadir}/doc/%{name}
680 %docdir %{_datadir}/doc/%{name}
681
682 %files ido-mysql
683 %defattr(-,root,root,-)
684 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
685 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-mysql.conf
686 %{_libdir}/%{name}/libdb_ido_mysql*
687 %{_datadir}/icinga2-ido-mysql
688
689 %files ido-pgsql
690 %defattr(-,root,root,-)
691 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
692 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-pgsql.conf
693 %{_libdir}/%{name}/libdb_ido_pgsql*
694 %{_datadir}/icinga2-ido-pgsql
695
696 %files classicui-config
697 %defattr(-,root,root,-)
698 %attr(0751,%{icinga_user},%{icinga_group}) %dir %{icingaclassicconfdir}
699 %config(noreplace) %{icingaclassicconfdir}/cgi.cfg
700 %config(noreplace) %{apacheconfdir}/icinga.conf
701 %config(noreplace) %attr(0640,root,%{apachegroup}) %{icingaclassicconfdir}/passwd
702
703 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
704 %files selinux
705 %defattr(-,root,root,0755)
706 %doc tools/selinux/*
707 %{_datadir}/selinux/*/%{modulename}.pp
708 %endif
709
710 %if 0%{?fedora}
711 %files studio
712 %defattr(-,root,root,-)
713 %{_bindir}/icinga-studio
714 %{_datadir}/icinga2-studio
715 %{_datadir}/applications/icinga2-studio.desktop
716 %endif
717
718 %changelog