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