]> granicus.if.org Git - icinga2/blob - icinga2.spec
Release version 2.5.2
[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.5.2
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 %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 %package -n vim-icinga2
250 Summary:      Vim syntax highlighting for icinga2
251 Group:        Applications/System
252 %if "%{_vendor}" == "suse"
253 Requires:     vim-data
254 %else
255 Requires:     vim-filesystem
256 %endif
257
258 %description -n vim-icinga2
259 Vim syntax highlighting for icinga2
260
261
262 %package -n nano-icinga2
263 Summary:      Nano syntax highlighting for icinga2
264 Group:        Applications/System
265 Requires:     nano
266
267 %description -n nano-icinga2
268 Nano syntax highlighting for icinga2
269
270 %prep
271 %setup -q -n %{name}-%{version}
272
273 %build
274 CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \
275          -DCMAKE_INSTALL_SYSCONFDIR=/etc \
276          -DCMAKE_INSTALL_LOCALSTATEDIR=/var \
277          -DCMAKE_BUILD_TYPE=RelWithDebInfo \
278          -DCMAKE_VERBOSE_MAKEFILE=ON \
279          -DBoost_NO_BOOST_CMAKE=ON \
280          -DICINGA2_RUNDIR=%{_rundir} \
281          -DICINGA2_USER=%{icinga_user} \
282          -DICINGA2_GROUP=%{icinga_group} \
283          -DICINGA2_COMMAND_GROUP=%{icingacmd_group}"
284 %if 0%{?fedora}
285 CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_STUDIO=true"
286 %endif
287 %if "%{_vendor}" == "redhat"
288 %if 0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6"
289 # Boost_VERSION 1.41.0 vs 101400 - disable build tests
290 # details in https://dev.icinga.org/issues/5033
291 CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost153 \
292  -DBOOST_INCLUDEDIR=/usr/include/boost153 \
293  -DBoost_ADDITIONAL_VERSIONS='1.53;1.53.0' \
294  -DBoost_NO_SYSTEM_PATHS=TRUE \
295  -DBUILD_TESTING=FALSE \
296  -DBoost_NO_BOOST_CMAKE=TRUE"
297 %endif
298 %if 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6"
299 CMAKE_OPTS="$CMAKE_OPTS -DBUILD_TESTING=FALSE"
300 %endif
301 %endif
302
303 %if "%{_vendor}" != "suse"
304 CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_PLUGINDIR=%{_libdir}/nagios/plugins"
305 %else
306 %if 0%{?suse_version} < 1310
307 CMAKE_OPTS="$CMAKE_OPTS -DBOOST_LIBRARYDIR=/usr/lib/boost153 \
308  -DBOOST_INCLUDEDIR=/usr/include/boost153 \
309  -DBoost_ADDITIONAL_VERSIONS='1.53;1.53.0' \
310  -DBoost_NO_SYSTEM_PATHS=TRUE \
311  -DBUILD_TESTING=FALSE \
312  -DBoost_NO_BOOST_CMAKE=TRUE"
313 %endif
314 CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_PLUGINDIR=%{_prefix}/lib/nagios/plugins"
315 %endif
316
317 %if 0%{?use_systemd}
318 CMAKE_OPTS="$CMAKE_OPTS -DUSE_SYSTEMD=ON"
319 %endif
320
321 cmake $CMAKE_OPTS -DCMAKE_C_FLAGS:STRING="%{optflags} %{?march_flag}" -DCMAKE_CXX_FLAGS:STRING="%{optflags} %{?march_flag}" .
322
323 make %{?_smp_mflags}
324
325 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
326 cd tools/selinux
327 for selinuxvariant in %{selinux_variants}
328 do
329   make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile
330   mv %{modulename}.pp %{modulename}.pp.${selinuxvariant}
331   make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean
332 done
333 cd -
334 %endif
335
336 %install
337 make install \
338         DESTDIR="%{buildroot}"
339
340 # install classicui config
341 install -D -m 0644 etc/icinga/icinga-classic.htpasswd %{buildroot}%{icingaclassicconfdir}/passwd
342 install -D -m 0644 etc/icinga/cgi.cfg %{buildroot}%{icingaclassicconfdir}/cgi.cfg
343 install -D -m 0644 etc/icinga/icinga-classic-apache.conf %{buildroot}%{apacheconfdir}/icinga.conf
344
345 # remove features-enabled symlinks
346 rm -f %{buildroot}/%{_sysconfdir}/%{name}/features-enabled/*.conf
347
348 # enable suse rc links
349 %if "%{_vendor}" == "suse"
350 %if 0%{?use_systemd}
351   ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
352 %else
353   ln -sf ../../%{_initrddir}/%{name} "%{buildroot}%{_sbindir}/rc%{name}"
354 %endif
355 mkdir -p "%{buildroot}%{_localstatedir}/adm/fillup-templates/"
356 mv "%{buildroot}%{_sysconfdir}/sysconfig/%{name}" "%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}"
357 %endif
358
359 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
360 cd tools/selinux
361 for selinuxvariant in %{selinux_variants}
362 do
363   install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
364   install -p -m 644 %{modulename}.pp.${selinuxvariant} \
365     %{buildroot}%{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp
366 done
367 cd -
368
369 /usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux
370 %endif
371
372 %if 0%{?fedora}
373 mkdir -p "%{buildroot}%{_datadir}/icinga2-studio"
374 install -p -m 644 icinga-studio/icinga.ico %{buildroot}%{_datadir}/icinga2-studio
375
376 mkdir -p "%{buildroot}%{_datadir}/applications"
377 echo "[Desktop Entry]
378 Name=Icinga 2 Studio
379 Comment=API viewer for Icinga 2
380 TryExec=icinga-studio
381 Exec=icinga-studio
382 Icon=/usr/share/icinga2-studio/icinga.ico
383 StartupNotify=true
384 Terminal=false
385 Type=Application
386 Categories=GTK;Utility;
387 Keywords=Monitoring;" > %{buildroot}%{_datadir}/applications/icinga2-studio.desktop
388 %endif
389
390 %if "%{_vendor}" == "suse"
391 %if 0%{?suse_version} >= 1310
392 install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vim74/syntax/%{name}.vim
393 install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vim74/ftdetect/%{name}.vim
394 %else
395 install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vim72/syntax/%{name}.vim
396 install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vim72/ftdetect/%{name}.vim
397 %endif
398 %else
399 install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/%{name}.vim
400 install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/%{name}.vim
401 %endif
402
403 install -D -m 0644 tools/syntax/nano/%{name}.nanorc %{buildroot}%{_datadir}/nano/%{name}.nanorc
404
405 %clean
406 [ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
407
408 %pre common
409 getent group %{icinga_group} >/dev/null || %{_sbindir}/groupadd -r %{icinga_group}
410 getent group %{icingacmd_group} >/dev/null || %{_sbindir}/groupadd -r %{icingacmd_group}
411 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}
412
413 %if "%{_vendor}" == "suse"
414 %if 0%{?use_systemd}
415   %service_add_pre %{name}.service
416 %endif
417 %endif
418
419 %if "%{_vendor}" == "suse"
420 %verifyscript bin
421 %verify_permissions -e %{_rundir}/%{name}/cmd
422 %endif
423
424 %post bin
425
426 # suse
427 %if "%{_vendor}" == "suse"
428
429 %if 0%{?suse_version} >= 1310
430 %set_permissions %{_rundir}/%{name}/cmd
431 %endif
432
433 %endif #suse/rhel
434
435 %post common
436 # suse
437 %if "%{_vendor}" == "suse"
438 %if 0%{?use_systemd}
439 %fillup_only  %{name}
440 %service_add_post %{name}.service
441 %else
442 %fillup_and_insserv %{name}
443 %endif
444
445 # initial installation, enable default features
446 for feature in checker notification mainlog; do
447         ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
448 done
449
450 exit 0
451
452 %else
453 # rhel
454
455 %if 0%{?use_systemd}
456 %systemd_post %{name}.service
457 %else
458 /sbin/chkconfig --add %{name}
459 %endif
460
461 if [ ${1:-0} -eq 1 ]
462 then
463         # initial installation, enable default features
464         for feature in checker notification mainlog; do
465                 ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
466         done
467 fi
468
469 exit 0
470
471 %endif
472 # suse/rhel
473
474 %postun common
475 # suse
476 %if "%{_vendor}" == "suse"
477 %if 0%{?using_systemd}
478   %service_del_postun %{name}.service
479 %else
480   %restart_on_update %{name}
481   %insserv_cleanup
482 %endif
483
484 %else
485 # rhel
486
487 %if 0%{?use_systemd}
488 %systemd_postun_with_restart %{name}.service
489 %else
490 if [ "$1" -ge  "1" ]; then
491         /sbin/service %{name} condrestart >/dev/null 2>&1 || :
492 fi
493 %endif
494
495 %endif
496 # suse / rhel
497
498 if [ "$1" = "0" ]; then
499         # deinstallation of the package - remove enabled features
500         rm -rf %{_sysconfdir}/%{name}/features-enabled
501 fi
502
503 exit 0
504
505 %preun common
506 # suse
507 %if "%{_vendor}" == "suse"
508
509 %if 0%{?use_systemd}
510   %service_del_preun %{name}.service
511 %else
512   %stop_on_removal %{name}
513 %endif
514
515 exit 0
516
517 %else
518 # rhel
519
520 %if 0%{?use_systemd}
521 %systemd_preun %{name}.service
522 %else
523 if [ "$1" = "0" ]; then
524         /sbin/service %{name} stop > /dev/null 2>&1 || :
525         /sbin/chkconfig --del %{name} || :
526 fi
527 %endif
528
529 exit 0
530
531 %endif
532 # suse / rhel
533
534 %post ido-mysql
535 if [ ${1:-0} -eq 1 ]
536 then
537         # initial installation, enable ido-mysql feature
538         ln -sf ../features-available/ido-mysql.conf %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
539 fi
540
541 exit 0
542
543 %postun ido-mysql
544 if [ "$1" = "0" ]; then
545         # deinstallation of the package - remove feature
546         rm -f %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
547 fi
548
549 exit 0
550
551 %post ido-pgsql
552 if [ ${1:-0} -eq 1 ]
553 then
554         # initial installation, enable ido-pgsql feature
555         ln -sf ../features-available/ido-pgsql.conf %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
556 fi
557
558 exit 0
559
560 %postun ido-pgsql
561 if [ "$1" = "0" ]; then
562         # deinstallation of the package - remove feature
563         rm -f %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
564 fi
565
566 exit 0
567
568 %post classicui-config
569 if [ ${1:-0} -eq 1 ]
570 then
571         # initial installation, enable features
572         for feature in statusdata compatlog command; do
573                 ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
574         done
575 fi
576
577 exit 0
578
579 %postun classicui-config
580 if [ "$1" = "0" ]; then
581         # deinstallation of the package - remove feature
582         for feature in statusdata compatlog command; do
583                 rm -f %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
584         done
585 fi
586
587 exit 0
588
589 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
590 %post selinux
591 for selinuxvariant in %{selinux_variants}
592 do
593   /usr/sbin/semodule -s ${selinuxvariant} -i \
594     %{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp &> /dev/null || :
595 done
596 /sbin/fixfiles -R icinga2-bin restore &> /dev/null || :
597 /sbin/fixfiles -R icinga2-common restore &> /dev/null || :
598 /sbin/semanage port -a -t icinga2_port_t -p tcp 5665 &> /dev/null || :
599
600 %postun selinux
601 if [ $1 -eq 0 ] ; then
602   /sbin/semanage port -d -t icinga2_port_t -p tcp 5665 &> /dev/null || :
603   for selinuxvariant in %{selinux_variants}
604   do
605      /usr/sbin/semodule -s ${selinuxvariant} -r %{modulename} &> /dev/null || :
606   done
607   /sbin/fixfiles -R icinga2-bin restore &> /dev/null || :
608   /sbin/fixfiles -R icinga2-common restore &> /dev/null || :
609 fi
610 %endif
611
612
613 %files
614 %defattr(-,root,root,-)
615 %doc COPYING
616
617 %files bin
618 %defattr(-,root,root,-)
619 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
620 %{_sbindir}/%{name}
621 %dir %{_libdir}/%{name}/sbin
622 %{_libdir}/%{name}/sbin/%{name}
623 %{_datadir}/%{name}
624 %exclude %{_datadir}/%{name}/include
625 %{_mandir}/man8/%{name}.8.gz
626
627 %attr(0750,%{icinga_user},%{icingacmd_group}) %{_localstatedir}/cache/%{name}
628 %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
629 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/crash
630 %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat
631 %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat/archives
632 %attr(0750,%{icinga_user},%{icinga_group}) %{_localstatedir}/lib/%{name}
633
634 %attr(0750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}
635 %attr(2750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}/cmd
636
637 %files libs
638 %defattr(-,root,root,-)
639 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
640 %exclude %{_libdir}/%{name}/libdb_ido_mysql*
641 %exclude %{_libdir}/%{name}/libdb_ido_pgsql*
642 %dir %{_libdir}/%{name}
643 %{_libdir}/%{name}/*.so*
644
645 %files common
646 %defattr(-,root,root,-)
647 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog tools/syntax
648 %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
649 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
650 %{_sysconfdir}/bash_completion.d/%{name}
651 %if 0%{?use_systemd}
652 %attr(644,root,root) %{_unitdir}/%{name}.service
653 %else
654 %attr(755,root,root) %{_sysconfdir}/init.d/%{name}
655 %endif
656 %if "%{_vendor}" == "suse"
657 %{_sbindir}/rc%{name}
658 %{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
659 %else
660 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
661 %endif
662 %attr(0750,root,%{icinga_group}) %dir %{_sysconfdir}/%{name}
663 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d
664 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-available
665 %exclude %{_sysconfdir}/%{name}/features-available/ido-*.conf
666 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-enabled
667 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/repository.d
668 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/scripts
669 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/repository.d
670 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/zones.d
671 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/%{name}.conf
672 %config(noreplace) %attr(0640,root,%{icinga_group}) %{_sysconfdir}/%{name}/init.conf
673 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/constants.conf
674 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.conf
675 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/*.conf
676 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/*.conf
677 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/repository.d/*
678 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.d/*
679 %config(noreplace) %{_sysconfdir}/%{name}/scripts/*
680 %dir %{_libexecdir}/%{name}
681 %{_libexecdir}/%{name}/prepare-dirs
682 %{_libexecdir}/%{name}/safe-reload
683 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}
684 %attr(0770,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/perfdata
685 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/tmp
686 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_datadir}/%{name}/include
687 %{_datadir}/%{name}/include
688
689 %files doc
690 %defattr(-,root,root,-)
691 %{_datadir}/doc/%{name}
692 %docdir %{_datadir}/doc/%{name}
693
694 %files ido-mysql
695 %defattr(-,root,root,-)
696 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
697 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-mysql.conf
698 %{_libdir}/%{name}/libdb_ido_mysql*
699 %{_datadir}/icinga2-ido-mysql
700
701 %files ido-pgsql
702 %defattr(-,root,root,-)
703 %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
704 %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-pgsql.conf
705 %{_libdir}/%{name}/libdb_ido_pgsql*
706 %{_datadir}/icinga2-ido-pgsql
707
708 %files classicui-config
709 %defattr(-,root,root,-)
710 %attr(0751,%{icinga_user},%{icinga_group}) %dir %{icingaclassicconfdir}
711 %config(noreplace) %{icingaclassicconfdir}/cgi.cfg
712 %config(noreplace) %{apacheconfdir}/icinga.conf
713 %config(noreplace) %attr(0640,root,%{apachegroup}) %{icingaclassicconfdir}/passwd
714
715 %if "%{_vendor}" == "redhat" && !(0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
716 %files selinux
717 %defattr(-,root,root,0755)
718 %doc tools/selinux/*
719 %{_datadir}/selinux/*/%{modulename}.pp
720 %endif
721
722 %if 0%{?fedora}
723 %files studio
724 %defattr(-,root,root,-)
725 %{_bindir}/icinga-studio
726 %{_datadir}/icinga2-studio
727 %{_datadir}/applications/icinga2-studio.desktop
728 %endif
729
730 %files -n vim-icinga2
731 %defattr(-,root,root,-)
732 %if "%{_vendor}" == "suse"
733 %if 0%{?suse_version} >= 1310
734 %{_datadir}/vim/vim74/syntax/%{name}.vim
735 %{_datadir}/vim/vim74/ftdetect/%{name}.vim
736 %else
737 %{_datadir}/vim/vim72/syntax/%{name}.vim
738 %{_datadir}/vim/vim72/ftdetect/%{name}.vim
739 %endif
740 %else
741 %{_datadir}/vim/vimfiles/syntax/%{name}.vim
742 %{_datadir}/vim/vimfiles/ftdetect/%{name}.vim
743 %endif
744
745 %files -n nano-icinga2
746 %defattr(-,root,root,-)
747 %{_datadir}/nano/%{name}.nanorc
748
749 %changelog