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