]> granicus.if.org Git - icinga2/blob - icinga2.spec
Release version v2.4.3
[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.3
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: gcc47-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 %endif
111
112 %if 0%{?build_icinga_org} && "%{_vendor}" == "redhat" && (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
113 # el5 and el6 require packages.icinga.org
114 BuildRequires: boost153-devel
115 %else
116 %if 0%{?build_icinga_org} && "%{_vendor}" == "suse" && 0%{?suse_version} < 1310
117 # sles 11 sp3 requires packages.icinga.org
118 BuildRequires: boost153-devel
119 %else
120 BuildRequires: boost-devel >= 1.41
121 %endif
122 %endif
123
124 %if 0%{?use_systemd}
125 BuildRequires: systemd
126 Requires: systemd
127 %endif
128
129 Requires: %{name}-libs = %{version}-%{release}
130
131 %description bin
132 Icinga 2 is a general-purpose network monitoring application.
133 Provides binaries for Icinga 2 Core.
134
135 %package common
136 Summary:      Common Icinga 2 configuration
137 Group:        Applications/System
138 %if "%{_vendor}" == "redhat"
139 Requires(pre): shadow-utils
140 Requires(post): shadow-utils
141 %endif
142 %if "%{_vendor}" == "suse"
143 Recommends:   logrotate
144 %endif
145
146 %description common
147 Provides common directories, uid and gid among Icinga 2 related
148 packages.
149
150
151 %package doc
152 Summary:      Documentation for Icinga 2
153 Group:        Applications/System
154 Requires:     %{name} = %{version}-%{release}
155
156 %description doc
157 Provides documentation for Icinga 2.
158
159
160 %package libs
161 Summary:      Libraries for Icinga 2
162 Group:        Applications/System
163 Requires:     %{name}-common = %{version}-%{release}
164
165 %description libs
166 Provides internal libraries for the daemon or studio.
167
168
169 %package ido-mysql
170 Summary:      IDO MySQL database backend for Icinga 2
171 Group:        Applications/System
172 %if "%{_vendor}" == "suse"
173 BuildRequires: libmysqlclient-devel
174 %if 0%{?suse_version} >= 1310
175 BuildRequires: mysql-devel
176 %endif
177
178 %else
179 BuildRequires: mysql-devel
180 %endif #suse
181
182 Requires: %{name} = %{version}-%{release}
183
184 %description ido-mysql
185 Icinga 2 IDO mysql database backend. Compatible with Icinga 1.x
186 IDOUtils schema >= 1.12
187
188
189 %package ido-pgsql
190 Summary:      IDO PostgreSQL database backend for Icinga 2
191 Group:        Applications/System
192 BuildRequires: postgresql-devel
193 Requires: %{name} = %{version}-%{release}
194
195 %description ido-pgsql
196 Icinga 2 IDO PostgreSQL database backend. Compatible with Icinga 1.x
197 IDOUtils schema >= 1.12
198
199
200 %package classicui-config
201 Summary:      Icinga 2 Classic UI Standalone configuration
202 Group:        Applications/System
203 BuildRequires: %{apachename}
204 Requires:     %{apachename}
205 Requires:     %{name} = %{version}-%{release}
206 %if "%{_vendor}" == "suse"
207 Recommends:   icinga-www
208 %endif
209 Provides:     icinga-classicui-config
210 Conflicts:    icinga-gui-config
211
212 %description classicui-config
213 Icinga 1.x Classic UI Standalone configuration with locations
214 for Icinga 2.
215
216 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
217 %global selinux_variants mls targeted
218 %{!?_selinux_policy_version: %global _selinux_policy_version %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp 2>/dev/null)}
219 %global modulename %{name}
220
221 %package selinux
222 Summary:        SELinux policy module supporting icinga2
223 Group:          System Environment/Base
224 BuildRequires:  checkpolicy, selinux-policy-devel, /usr/share/selinux/devel/policyhelp, hardlink
225 %if "%{_selinux_policy_version}" != ""
226 Requires:       selinux-policy >= %{_selinux_policy_version}
227 %endif
228 Requires:       %{name} = %{version}-%{release}
229 Requires(post):   /usr/sbin/semodule, /sbin/restorecon
230 Requires(postun): /usr/sbin/semodule, /sbin/restorecon
231
232 %description selinux
233 SELinux policy module supporting icinga2
234 %endif
235
236
237 %if 0%{?fedora}
238 %package studio
239 Summary:      Studio for Icinga 2
240 Group:        Applications/System
241 Requires:     %{name}-libs = %{version}-%{release}
242 Requires:     wxGTK3
243
244 %description studio
245 Provides a GUI for the Icinga 2 API.
246 %endif
247
248
249 %prep
250 %setup -q -n %{name}-%{version}
251
252 %build
253 CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \
254          -DCMAKE_INSTALL_SYSCONFDIR=/etc \
255          -DCMAKE_INSTALL_LOCALSTATEDIR=/var \
256          -DCMAKE_BUILD_TYPE=RelWithDebInfo \
257          -DCMAKE_VERBOSE_MAKEFILE=ON \
258          -DBoost_NO_BOOST_CMAKE=ON \
259          -DICINGA2_RUNDIR=%{_rundir} \
260          -DICINGA2_USER=%{icinga_user} \
261          -DICINGA2_GROUP=%{icinga_group} \
262          -DICINGA2_COMMAND_GROUP=%{icingacmd_group}"
263 %if 0%{?fedora}
264 CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_STUDIO=true"
265 %endif
266 %if "%{_vendor}" == "redhat"
267 %if 0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6"
268 # Boost_VERSION 1.41.0 vs 101400 - disable build tests
269 # details in https://dev.icinga.org/issues/5033
270 CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost153 \
271  -DBOOST_INCLUDEDIR=/usr/include/boost153 \
272  -DBoost_ADDITIONAL_VERSIONS='1.53;1.53.0' \
273  -DBoost_NO_SYSTEM_PATHS=TRUE \
274  -DBUILD_TESTING=FALSE \
275  -DBoost_NO_BOOST_CMAKE=TRUE"
276 %endif
277 %if 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6"
278 CMAKE_OPTS="$CMAKE_OPTS -DBUILD_TESTING=FALSE"
279 %endif
280 %endif
281
282 %if "%{_vendor}" != "suse"
283 CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_PLUGINDIR=%{_libdir}/nagios/plugins"
284 %else
285 %if 0%{?suse_version} < 1310
286 CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost153 \
287  -DBOOST_INCLUDEDIR=/usr/include/boost153 \
288  -DBoost_ADDITIONAL_VERSIONS='1.53;1.53.0' \
289  -DBoost_NO_SYSTEM_PATHS=TRUE \
290  -DBUILD_TESTING=FALSE \
291  -DBoost_NO_BOOST_CMAKE=TRUE"
292 %endif
293 CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_PLUGINDIR=%{_prefix}/lib/nagios/plugins"
294 %endif
295
296 %if 0%{?use_systemd}
297 CMAKE_OPTS="$CMAKE_OPTS -DUSE_SYSTEMD=ON"
298 %endif
299
300 cmake $CMAKE_OPTS -DCMAKE_C_FLAGS:STRING="%{optflags} %{?march_flag}" -DCMAKE_CXX_FLAGS:STRING="%{optflags} %{?march_flag}" .
301
302 make %{?_smp_mflags}
303
304 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
305 cd tools/selinux
306 for selinuxvariant in %{selinux_variants}
307 do
308   make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile
309   mv %{modulename}.pp %{modulename}.pp.${selinuxvariant}
310   make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean
311 done
312 cd -
313 %endif
314
315 %install
316 make install \
317         DESTDIR="%{buildroot}"
318
319 # install classicui config
320 install -D -m 0644 etc/icinga/icinga-classic.htpasswd %{buildroot}%{icingaclassicconfdir}/passwd
321 install -D -m 0644 etc/icinga/cgi.cfg %{buildroot}%{icingaclassicconfdir}/cgi.cfg
322 install -D -m 0644 etc/icinga/icinga-classic-apache.conf %{buildroot}%{apacheconfdir}/icinga.conf
323
324 # remove features-enabled symlinks
325 rm -f %{buildroot}/%{_sysconfdir}/%{name}/features-enabled/*.conf
326
327 # enable suse rc links
328 %if "%{_vendor}" == "suse"
329 %if 0%{?use_systemd}
330   ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
331 %else
332   ln -sf ../../%{_initrddir}/%{name} "%{buildroot}%{_sbindir}/rc%{name}"
333 %endif
334 mkdir -p "%{buildroot}%{_localstatedir}/adm/fillup-templates/"
335 mv "%{buildroot}%{_sysconfdir}/sysconfig/%{name}" "%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}"
336 %endif
337
338 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
339 cd tools/selinux
340 for selinuxvariant in %{selinux_variants}
341 do
342   install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
343   install -p -m 644 %{modulename}.pp.${selinuxvariant} \
344     %{buildroot}%{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp
345 done
346 cd -
347
348 /usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux
349 %endif
350
351 %if 0%{?fedora}
352 mkdir -p "%{buildroot}%{_datadir}/icinga2-studio"
353 install -p -m 644 icinga-studio/icinga.ico %{buildroot}%{_datadir}/icinga2-studio
354
355 mkdir -p "%{buildroot}%{_datadir}/applications"
356 echo "[Desktop Entry]
357 Name=Icinga 2 Studio
358 Comment=API viewer for Icinga 2
359 TryExec=icinga-studio
360 Exec=icinga-studio
361 Icon=/usr/share/icinga2-studio/icinga.ico
362 StartupNotify=true
363 Terminal=false
364 Type=Application
365 Categories=GTK;Utility;
366 Keywords=Monitoring;" > %{buildroot}%{_datadir}/applications/icinga2-studio.desktop
367 %endif
368
369 %clean
370 [ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
371
372 %pre common
373 getent group %{icinga_group} >/dev/null || %{_sbindir}/groupadd -r %{icinga_group}
374 getent group %{icingacmd_group} >/dev/null || %{_sbindir}/groupadd -r %{icingacmd_group}
375 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}
376
377 %if "%{_vendor}" == "suse"
378 %if 0%{?use_systemd}
379   %service_add_pre %{name}.service
380 %endif
381 %endif
382
383 %if "%{_vendor}" == "suse"
384 %verifyscript bin
385 %verify_permissions -e %{_rundir}/%{name}/cmd
386 %endif
387
388 %post bin
389
390 # suse
391 %if "%{_vendor}" == "suse"
392
393 %if 0%{?suse_version} >= 1310
394 %set_permissions %{_rundir}/%{name}/cmd
395 %endif
396
397 %endif #suse/rhel
398
399 %post common
400 # suse
401 %if "%{_vendor}" == "suse"
402 %if 0%{?use_systemd}
403 %fillup_only  %{name}
404 %service_add_post %{name}.service
405 %else
406 %fillup_and_insserv %{name}
407 %endif
408
409 # initial installation, enable default features
410 for feature in checker notification mainlog; do
411         ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
412 done
413
414 exit 0
415
416 %else
417 # rhel
418
419 %if 0%{?use_systemd}
420 %systemd_post %{name}.service
421 %else
422 /sbin/chkconfig --add %{name}
423 %endif
424
425 if [ ${1:-0} -eq 1 ]
426 then
427         # initial installation, enable default features
428         for feature in checker notification mainlog; do
429                 ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
430         done
431 fi
432
433 exit 0
434
435 %endif
436 # suse/rhel
437
438 %postun common
439 # suse
440 %if "%{_vendor}" == "suse"
441 %if 0%{?using_systemd}
442   %service_del_postun %{name}.service
443 %else
444   %restart_on_update %{name}
445   %insserv_cleanup
446 %endif
447
448 %else
449 # rhel
450
451 %if 0%{?use_systemd}
452 %systemd_postun_with_restart %{name}.service
453 %else
454 if [ "$1" -ge  "1" ]; then
455         /sbin/service %{name} condrestart >/dev/null 2>&1 || :
456 fi
457 %endif
458
459 %endif
460 # suse / rhel
461
462 if [ "$1" = "0" ]; then
463         # deinstallation of the package - remove enabled features
464         rm -rf %{_sysconfdir}/%{name}/features-enabled
465 fi
466
467 exit 0
468
469 %preun common
470 # suse
471 %if "%{_vendor}" == "suse"
472
473 %if 0%{?use_systemd}
474   %service_del_preun %{name}.service
475 %else
476   %stop_on_removal %{name}
477 %endif
478
479 exit 0
480
481 %else
482 # rhel
483
484 %if 0%{?use_systemd}
485 %systemd_preun %{name}.service
486 %else
487 if [ "$1" = "0" ]; then
488         /sbin/service %{name} stop > /dev/null 2>&1 || :
489         /sbin/chkconfig --del %{name} || :
490 fi
491 %endif
492
493 exit 0
494
495 %endif
496 # suse / rhel
497
498 %post ido-mysql
499 if [ ${1:-0} -eq 1 ]
500 then
501         # initial installation, enable ido-mysql feature
502         ln -sf ../features-available/ido-mysql.conf %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
503 fi
504
505 exit 0
506
507 %postun ido-mysql
508 if [ "$1" = "0" ]; then
509         # deinstallation of the package - remove feature
510         rm -f %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
511 fi
512
513 exit 0
514
515 %post ido-pgsql
516 if [ ${1:-0} -eq 1 ]
517 then
518         # initial installation, enable ido-pgsql feature
519         ln -sf ../features-available/ido-pgsql.conf %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
520 fi
521
522 exit 0
523
524 %postun ido-pgsql
525 if [ "$1" = "0" ]; then
526         # deinstallation of the package - remove feature
527         rm -f %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
528 fi
529
530 exit 0
531
532 %post classicui-config
533 if [ ${1:-0} -eq 1 ]
534 then
535         # initial installation, enable features
536         for feature in statusdata compatlog command; do
537                 ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
538         done
539 fi
540
541 exit 0
542
543 %postun classicui-config
544 if [ "$1" = "0" ]; then
545         # deinstallation of the package - remove feature
546         for feature in statusdata compatlog command; do
547                 rm -f %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
548         done
549 fi
550
551 exit 0
552
553 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
554 %post selinux
555 for selinuxvariant in %{selinux_variants}
556 do
557   /usr/sbin/semodule -s ${selinuxvariant} -i \
558     %{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp &> /dev/null || :
559 done
560 /sbin/fixfiles -R icinga2-bin restore &> /dev/null || :
561 /sbin/fixfiles -R icinga2-common restore &> /dev/null || :
562 /sbin/semanage port -a -t icinga2_port_t -p tcp 5665 &> /dev/null || :
563
564 %postun selinux
565 if [ $1 -eq 0 ] ; then
566   /sbin/semanage port -d -t icinga2_port_t -p tcp 5665 &> /dev/null || :
567   for selinuxvariant in %{selinux_variants}
568   do
569      /usr/sbin/semodule -s ${selinuxvariant} -r %{modulename} &> /dev/null || :
570   done
571   /sbin/fixfiles -R icinga2-bin restore &> /dev/null || :
572   /sbin/fixfiles -R icinga2-common restore &> /dev/null || :
573 fi
574 %endif
575
576
577 %files
578 %defattr(-,root,root,-)
579 %doc COPYING
580
581 %files bin
582 %defattr(-,root,root,-)
583 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
584 %{_sbindir}/%{name}
585 %dir %{_libdir}/%{name}/sbin
586 %{_libdir}/%{name}/sbin/%{name}
587 %{_datadir}/%{name}
588 %exclude %{_datadir}/%{name}/include
589 %{_mandir}/man8/%{name}.8.gz
590
591 %attr(0750,%{icinga_user},%{icingacmd_group}) %{_localstatedir}/cache/%{name}
592 %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
593 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/crash
594 %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat
595 %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat/archives
596 %attr(0750,%{icinga_user},%{icinga_group}) %{_localstatedir}/lib/%{name}
597
598 %attr(0750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}
599 %attr(2750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}/cmd
600
601 %files libs
602 %defattr(-,root,root,-)
603 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
604 %exclude %{_libdir}/%{name}/libdb_ido_mysql*
605 %exclude %{_libdir}/%{name}/libdb_ido_pgsql*
606 %dir %{_libdir}/%{name}
607 %{_libdir}/%{name}/*.so*
608
609 %files common
610 %defattr(-,root,root,-)
611 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog tools/syntax
612 %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
613 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
614 %{_sysconfdir}/bash_completion.d/%{name}
615 %if 0%{?use_systemd}
616 %attr(644,root,root) %{_unitdir}/%{name}.service
617 %else
618 %attr(755,root,root) %{_sysconfdir}/init.d/%{name}
619 %endif
620 %if "%{_vendor}" == "suse"
621 %{_sbindir}/rc%{name}
622 %{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
623 %else
624 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
625 %endif
626 %attr(0750,root,%{icinga_group}) %dir %{_sysconfdir}/%{name}
627 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d
628 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-available
629 %exclude %{_sysconfdir}/%{name}/features-available/ido-*.conf
630 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-enabled
631 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/repository.d
632 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/scripts
633 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/repository.d
634 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/zones.d
635 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/%{name}.conf
636 %config(noreplace) %attr(0640,root,%{icinga_group}) %{_sysconfdir}/%{name}/init.conf
637 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/constants.conf
638 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.conf
639 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/*.conf
640 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/*.conf
641 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/repository.d/*
642 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.d/*
643 %config(noreplace) %{_sysconfdir}/%{name}/scripts/*
644 %dir %{_libexecdir}/%{name}
645 %{_libexecdir}/%{name}/prepare-dirs
646 %{_libexecdir}/%{name}/safe-reload
647 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}
648 %attr(0770,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/perfdata
649 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/tmp
650 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_datadir}/%{name}/include
651 %{_datadir}/%{name}/include
652
653 %files doc
654 %defattr(-,root,root,-)
655 %{_datadir}/doc/%{name}
656 %docdir %{_datadir}/doc/%{name}
657
658 %files ido-mysql
659 %defattr(-,root,root,-)
660 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
661 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-mysql.conf
662 %{_libdir}/%{name}/libdb_ido_mysql*
663 %{_datadir}/icinga2-ido-mysql
664
665 %files ido-pgsql
666 %defattr(-,root,root,-)
667 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
668 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-pgsql.conf
669 %{_libdir}/%{name}/libdb_ido_pgsql*
670 %{_datadir}/icinga2-ido-pgsql
671
672 %files classicui-config
673 %defattr(-,root,root,-)
674 %attr(0751,%{icinga_user},%{icinga_group}) %dir %{icingaclassicconfdir}
675 %config(noreplace) %{icingaclassicconfdir}/cgi.cfg
676 %config(noreplace) %{apacheconfdir}/icinga.conf
677 %config(noreplace) %attr(0640,root,%{apachegroup}) %{icingaclassicconfdir}/passwd
678
679 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
680 %files selinux
681 %defattr(-,root,root,0755)
682 %doc tools/selinux/*
683 %{_datadir}/selinux/*/%{modulename}.pp
684 %endif
685
686 %if 0%{?fedora}
687 %files studio
688 %defattr(-,root,root,-)
689 %{_bindir}/icinga-studio
690 %{_datadir}/icinga2-studio
691 %{_datadir}/applications/icinga2-studio.desktop
692 %endif
693
694 %changelog