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