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