Browse Source

icinga2 package update v2 2.12.4

Signed-off-by: monitorbuilder_pel7ppc64lebuilder0 <monitorbuilder@powerel.org>
master
monitorbuilder_pel7ppc64lebuilder0 3 years ago
parent
commit
d45898f00e
  1. 548
      SPECS/icinga2.spec

548
SPECS/icinga2.spec

@ -1,356 +1,466 @@
%define revision 1
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run %define _rundir %{_localstatedir}/run
%endif
%if ! %{defined _fillupdir}
%define _fillupdir %{_localstatedir}/adm/fillup-templates
%endif

%define _libexecdir %{_prefix}/lib/ %define _libexecdir %{_prefix}/lib/
%define plugindir %{_libdir}/nagios/plugins %define plugindir %{_libdir}/nagios/plugins

%define apachename httpd %define apachename httpd
%define apacheconfdir %{_sysconfdir}/httpd/conf.d %define apacheconfdir %{_sysconfdir}/httpd/conf.d
%define apacheuser apache %define apacheuser apache
%define apachegroup apache %define apachegroup apache
%define use_systemd 1 %define use_systemd 1
%define use_selinux 1
%define configure_systemd_limits 1 %define configure_systemd_limits 1

%define icinga_user icinga %define icinga_user icinga
%define icinga_group icinga %define icinga_group icinga
%define icingacmd_group icingacmd %define icingacmd_group icingacmd
%define icingaweb2name icingaweb2
%define icingaweb2version 2.0.0 %bcond_without unity_build

%bcond_with systemd_and_init
%bcond_without compat
%bcond_without livestatus
%bcond_without notification
%bcond_without perfdata
%bcond_without tests
%bcond_without mysql
%bcond_without pgsql

%define logmsg logger -t %{name}/rpm %define logmsg logger -t %{name}/rpm


Summary: Network monitoring application %define boost_min_version 1.66
Name: icinga2
Version: 2.11.9 Summary: Network monitoring application
Release: 1%{?dist} License: GPLv2+
License: GPL-2.0+ Group: System/Monitoring
URL: https://www.icinga.com/ Name: icinga2
Group: Applications/System Version: 2.12.4
Source: https://github.com/Icinga/%{name}/archive/v%{version}.tar.gz Release: %{revision}%{?dist}
Source1: icinga2.service.limits.conf Url: https://www.icinga.com/
BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: https://github.com/Icinga/%{name}/archive/v%{version}%{?src_version_suffix}.tar.gz
Requires: %{name}-bin = %{version}-%{release}


BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: %{name}-bin = %{version}-%{release}
Requires: %{name}-common = %{version}-%{release}

Conflicts: %{name}-common < %{version}-%{release}


%description %description
Meta package for Icinga 2 Core, DB IDO and Web. Meta package for Icinga 2 Core, DB IDO and Web.



%package bin %package bin
Summary: Icinga 2 binaries and libraries Summary: Icinga 2 binaries and libraries
Group: Applications/System Group: System/Monitoring
BuildRequires: libedit-devel
BuildRequires: ncurses-devel Requires: %{name}-bin = %{version}-%{release}
BuildRequires: gcc-c++
BuildRequires: libstdc++-devel BuildRequires: libedit-devel
BuildRequires: openssl-devel BuildRequires: ncurses-devel
BuildRequires: cmake BuildRequires: gcc-c++
BuildRequires: flex >= 2.5.35 BuildRequires: libstdc++-devel
BuildRequires: bison BuildRequires: openssl-devel
BuildRequires: make BuildRequires: bison
BuildRequires: boost-devel >= 1.48 BuildRequires: cmake
BuildRequires: systemd BuildRequires: flex >= 2.5.35
Requires: systemd BuildRequires: make
Requires: %{name}-libs = %{version}-%{release}
# default boost devel package
%define boost_devel_pkg boost-devel
%define boost_library boost169
%define boost_version 1.69
%define boost_devel_pkg boost169-devel

%if "%{?boost_devel_pkg}" != ""
BuildRequires: %{boost_devel_pkg} >= %{boost_min_version}
%endif # boost_devel_pkg

%if 0%{?use_systemd}
BuildRequires: systemd-devel
Requires: systemd
%endif

Obsoletes: %{name}-libs <= 2.10.0
Conflicts: %{name}-libs <= 2.10.0

%description bin %description bin
Icinga 2 is a general-purpose network monitoring application. Icinga 2 is a general-purpose network monitoring application.
Provides binaries for Icinga 2 Core. This subpackage provides the binaries for Icinga 2 Core.



%package common %package common
Summary: Common Icinga 2 configuration Summary: Common Icinga 2 configuration
Group: Applications/System Group: System/Monitoring
Requires(pre): shadow-utils Requires(pre): shadow-utils
Requires(post): shadow-utils Requires(post): shadow-utils
Requires(pre): coreutils BuildRequires: logrotate
Requires(post): coreutils
#BuildRequires: monitoring-plugins-common
#Requires: monitoring-plugins-common
%description common %description common
Provides common directories, uid and gid among Icinga 2 related This subpackage provides common directories, and the UID and GUID definitions
packages. among Icinga 2 related packages.




%package doc %package doc
Summary: Documentation for Icinga 2 Summary: Documentation for Icinga 2
Group: Applications/System Group: Documentation/Other
Requires: %{name} = %{version}-%{release}
%description doc %description doc
Provides documentation for Icinga 2. This subpackage provides documentation for Icinga 2.


%package libs
Summary: Libraries for Icinga 2
Group: Applications/System
Requires: %{name}-common = %{version}-%{release}
%description libs
Provides internal libraries for the daemon or studio.




%if %{with mysql}
%package ido-mysql %package ido-mysql
Summary: IDO MySQL database backend for Icinga 2 Summary: IDO MySQL database backend for Icinga 2
Group: Applications/System Group: System/Monitoring
BuildRequires: mysql-devel BuildRequires: mysql-devel
Requires: %{name} = %{version}-%{release} Requires: %{name}-bin = %{version}-%{release}
%description ido-mysql %description ido-mysql
Icinga 2 IDO mysql database backend. Compatible with Icinga 1.x Icinga 2 IDO mysql database backend. Compatible with Icinga 1.x
IDOUtils schema >= 1.12 IDOUtils schema >= 1.12
%endif




%if %{with pgsql}
%package ido-pgsql %package ido-pgsql
Summary: IDO PostgreSQL database backend for Icinga 2 Summary: IDO PostgreSQL database backend for Icinga 2
Group: Applications/System Group: System/Monitoring
BuildRequires: postgresql-devel BuildRequires: postgresql-devel
Requires: %{name} = %{version}-%{release} Requires: %{name}-bin = %{version}-%{release}

%description ido-pgsql %description ido-pgsql
Icinga 2 IDO PostgreSQL database backend. Compatible with Icinga 1.x Icinga 2 IDO PostgreSQL database backend. Compatible with Icinga 1.x
IDOUtils schema >= 1.12 IDOUtils schema >= 1.12
%endif


%if 0%{?use_selinux}
%global selinux_variants mls targeted %global selinux_variants mls targeted
%{!?_selinux_policy_version: %global _selinux_policy_version %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp 2>/dev/null)} %global selinux_modulename %{name}
%global modulename %{name}
%package selinux %package selinux
Summary: SELinux policy module supporting icinga2 Summary: SELinux policy module supporting icinga2
Group: System Environment/Base Group: System/Base
BuildRequires: checkpolicy, selinux-policy-devel, /usr/share/selinux/devel/policyhelp, hardlink BuildRequires: checkpolicy
Requires: selinux-policy >= %{_selinux_policy_version} BuildRequires: hardlink
Requires: %{name} = %{version}-%{release} BuildRequires: selinux-policy-devel
Requires: %{name}-bin = %{version}-%{release}
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
Requires(post): policycoreutils-python-utils
Requires(postun): policycoreutils-python-utils
%else
Requires(post): policycoreutils-python Requires(post): policycoreutils-python
Requires(postun): policycoreutils-python Requires(postun): policycoreutils-python
%description selinux %endif
SELinux policy module supporting icinga2




%package -n vim-icinga2 %description selinux
Summary: Vim syntax highlighting for icinga2 SELinux policy module supporting icinga2.
Group: Applications/System
%if "%{_vendor}" == "suse"
BuildRequires: vim
Requires: vim
%else
Requires: vim-filesystem
%endif %endif

%package -n vim-icinga2
Summary: Vim syntax highlighting for icinga2
Group: Productivity/Text/Editors
Requires: vim-filesystem
%description -n vim-icinga2 %description -n vim-icinga2
Vim syntax highlighting for icinga2 Provides Vim syntax highlighting for icinga2.




%package -n nano-icinga2 %package -n nano-icinga2
Summary: Nano syntax highlighting for icinga2 Summary: Nano syntax highlighting for icinga2
Group: Applications/System Group: Productivity/Text/Editors
Requires: nano Requires: nano
%description -n nano-icinga2
Nano syntax highlighting for icinga2


%description -n nano-icinga2
Provides Nano syntax highlighting for icinga2.


%prep %prep
%setup -q -n %{name}-%{version} %setup -q -n %{name}-%{version}%{?src_version_suffix}



%build %build
# set basedir to allow cache to hit between different builds
# this will make all paths below BUILD/icinga2-x.x.x relative for cache
export CCACHE_BASEDIR="${CCACHE_BASEDIR:-$(pwd)}"

CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \ CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_SYSCONFDIR=/etc \ -DCMAKE_INSTALL_SYSCONFDIR=/etc \
-DCMAKE_INSTALL_LOCALSTATEDIR=/var \ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DICINGA2_LTO_BUILD=ON \ -DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_VERBOSE_MAKEFILE=ON \ -DBoost_NO_BOOST_CMAKE=ON \
-DBoost_NO_BOOST_CMAKE=ON \ -DICINGA2_PLUGINDIR=%{plugindir} \
-DBoost_NO_SYSTEM_PATHS=TRUE \ -DICINGA2_RUNDIR=%{_rundir} \
-DBOOST_LIBRARYDIR=/usr/lib64/boost169 \ -DICINGA2_SYSCONFIGFILE=/etc/sysconfig/icinga2 \
-DBOOST_INCLUDEDIR=/usr/include/boost169 \ -DICINGA2_USER=%{icinga_user} \
-DBoost_ADDITIONAL_VERSIONS='1.69;1.69.0' \ -DICINGA2_GROUP=%{icinga_group} \
-DICINGA2_PLUGINDIR=%{plugindir} \ -DICINGA2_COMMAND_GROUP=%{icingacmd_group}"
-DICINGA2_RUNDIR=%{_rundir} \ %if 0%{?fedora}
-DICINGA2_USER=%{icinga_user} \ CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_STUDIO=true"
-DICINGA2_GROUP=%{icinga_group} \ %endif
-DICINGA2_COMMAND_GROUP=%{icingacmd_group} \
-DBUILD_TESTING=FALSE \ %if %{with unity_build}
-DUSE_SYSTEMD=ON \ CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_UNITY_BUILD=ON"
-DICINGA2_WITH_LIVESTATUS=ON \ %else
-DICINGA2_WITH_NOTIFICATION=ON \ CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_UNITY_BUILD=OFF"
-DICINGA2_WITH_PERFDATA=ON \ %endif
-DICINGA2_WITH_MYSQL=ON \
-DICINGA2_WITH_PGSQL=ON" # Disable LTO build, see https://github.com/Icinga/icinga2/issues/7149

# lto1: internal compiler error: in prune_unused_types_prune, at dwarf2out.c
#-DICINGA2_SYSCONFIGFILE=%{_sysconfigdir}/%{name} \ CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_LTO_BUILD=OFF"


cmake $CMAKE_OPTS -DCMAKE_C_FLAGS:STRING="%{optflags} %{?march_flag}" -DCMAKE_CXX_FLAGS:STRING="%{optflags} %{?march_flag}" . %if %{with systemd_and_init}
CMAKE_OPTS="$CMAKE_OPTS -DINSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=ON"
%else
CMAKE_OPTS="$CMAKE_OPTS -DINSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=OFF"
%endif
%if %{with compat}
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_COMPAT=ON"
%else
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_COMPAT=OFF"
%endif
%if %{with livestatus}
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_LIVESTATUS=ON"
%else
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_LIVESTATUS=OFF"
%endif
%if %{with notification}
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_NOTIFICATION=ON"
%else
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_NOTIFICATION=OFF"
%endif
%if %{with perfdata}
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_PERFDATA=ON"
%else
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_PERFDATA=OFF"
%endif
%if %{with tests}
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_TESTS=ON"
%else
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_TESTS=OFF"
%endif
%if %{with mysql}
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_MYSQL=ON"
%else
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_MYSQL=OFF"
%endif
%if %{with pgsql}
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_PGSQL=ON"
%else
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_PGSQL=OFF"
%endif

%if "%{?boost_rpath}" != ""
CMAKE_OPTS="$CMAKE_OPTS -DCMAKE_INSTALL_RPATH=%{boost_rpath}"
%endif # boost_rpath

%if "%{?boost_library}" != ""
# Boost_NO_BOOST_CMAKE=ON - disable search for cmake
# Boost_NO_SYSTEM_PATHS=ON - only search in specified locations
CMAKE_OPTS="$CMAKE_OPTS
-DBoost_NO_BOOST_CMAKE=TRUE \
-DBoost_NO_SYSTEM_PATHS=TRUE \
-DBOOST_LIBRARYDIR=%{_libdir}/%{boost_library} \
-DBOOST_INCLUDEDIR=/usr/include/%{boost_library} \
-DBoost_ADDITIONAL_VERSIONS='%{boost_version};%{boost_version}.0'"
%endif # boost_library

%if 0%{?use_systemd}
CMAKE_OPTS="$CMAKE_OPTS -DUSE_SYSTEMD=ON"
%endif

%if "%{?_buildhost}" != ""
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_BUILD_HOST_NAME:STRING=%_buildhost"
%endif

cmake3 $CMAKE_OPTS -DCMAKE_C_FLAGS:STRING="%{optflags} %{?march_flag}" -DCMAKE_CXX_FLAGS:STRING="%{optflags} %{?march_flag}" .


make %{?_smp_mflags} make %{?_smp_mflags}


%if 0%{?use_selinux}
cd tools/selinux cd tools/selinux
for selinuxvariant in %{selinux_variants} for selinuxvariant in %{selinux_variants}
do do
make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile
mv %{modulename}.pp %{modulename}.pp.${selinuxvariant} mv %{selinux_modulename}.pp %{selinux_modulename}.pp.${selinuxvariant}
make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean
done done
cd - cd -
%endif


%install %install
make install \ make install DESTDIR="%{buildroot}"
DESTDIR="%{buildroot}"


install -D -m 0644 %{SOURCE1} %{buildroot}/etc/systemd/system/%{name}.service.d/limits.conf # install custom limits.conf for systemd
%if 0%{?configure_systemd_limits}
# for > 2.8 or > 2.7.2
install -D -m 0644 etc/initsystem/icinga2.service.limits.conf %{buildroot}/etc/systemd/system/%{name}.service.d/limits.conf
%endif


# remove features-enabled symlinks # remove features-enabled symlinks
rm -f %{buildroot}/%{_sysconfdir}/%{name}/features-enabled/*.conf rm -f %{buildroot}/%{_sysconfdir}/%{name}/features-enabled/*.conf


%if 0%{?use_selinux}
cd tools/selinux cd tools/selinux
for selinuxvariant in %{selinux_variants} for selinuxvariant in %{selinux_variants}
do do
install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant} install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
install -p -m 644 %{modulename}.pp.${selinuxvariant} \ install -p -m 644 %{selinux_modulename}.pp.${selinuxvariant} \
%{buildroot}%{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp %{buildroot}%{_datadir}/selinux/${selinuxvariant}/%{selinux_modulename}.pp
done done
cd -


# TODO: Fix build problems on Icinga, see https://github.com/Icinga/puppet-icinga_build/issues/11 # TODO: Fix build problems on Icinga, see https://github.com/Icinga/puppet-icinga_build/issues/11
#/usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux #/usr/sbin/hardlink -cv %%{buildroot}%%{_datadir}/selinux

%endif
#install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/%{name}.vim
#install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/%{name}.vim

#install -D -m 0644 tools/syntax/nano/%{name}.nanorc %{buildroot}%{_datadir}/nano/%{name}.nanorc



%clean install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/%{name}.vim
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot} install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/%{name}.vim


install -D -m 0644 tools/syntax/nano/%{name}.nanorc %{buildroot}%{_datadir}/nano/%{name}.nanorc


%pre common %check
getent group %{icinga_group} >/dev/null || %{_sbindir}/groupadd -r %{icinga_group} export CTEST_OUTPUT_ON_FAILURE=1
getent group %{icingacmd_group} >/dev/null || %{_sbindir}/groupadd -r %{icingacmd_group} make test
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}




%post common %post
%if 0%{?use_systemd}
%systemd_post %{name}.service %systemd_post %{name}.service
%else
/sbin/chkconfig --add %{name}
%endif

if [ ${1:-0} -eq 1 ] if [ ${1:-0} -eq 1 ]
then then
# initial installation, enable default features # initial installation, enable default features
for feature in checker notification mainlog; do for feature in checker notification mainlog; do
ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf ln -sf ../features-available/${feature}.conf %{_sysconfdir}/%{name}/features-enabled/${feature}.conf
done done
fi fi

exit 0 exit 0




%postun common %preun
%systemd_postun_with_restart %{name}.service %if 0%{?use_systemd}
%systemd_preun %{name}.service
%else
if [ "$1" = "0" ]; then if [ "$1" = "0" ]; then
# deinstallation of the package - remove enabled features /sbin/service %{name} stop > /dev/null 2>&1 || :
rm -rf %{_sysconfdir}/%{name}/features-enabled /sbin/chkconfig --del %{name} || :
fi fi
%endif

exit 0 exit 0


%preun common
%systemd_preun %{name}.service %postun
%if 0%{?use_systemd}
%systemd_postun_with_restart %{name}.service
%else
if [ "$1" -ge "1" ]; then
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi
%endif

if [ "$1" = "0" ]; then
# deinstallation of the package - remove enabled features
rm -rf %{_sysconfdir}/%{name}/features-enabled
fi

exit 0 exit 0


%pre common
getent group %{icinga_group} >/dev/null || %{_sbindir}/groupadd -r %{icinga_group}
getent group %{icingacmd_group} >/dev/null || %{_sbindir}/groupadd -r %{icingacmd_group}
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}



%post ido-mysql %post ido-mysql
if [ ${1:-0} -eq 1 ] if [ ${1:-0} -eq 1 ] && [ -e %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf ]
then then
# initial installation, enable ido-mysql feature # initial installation, enable ido-mysql feature
ln -sf ../features-available/ido-mysql.conf %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf ln -sf ../features-available/ido-mysql.conf %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
fi fi

exit 0 exit 0


%postun ido-mysql %postun ido-mysql
if [ "$1" = "0" ]; then if [ "$1" = "0" ]; then
# deinstallation of the package - remove feature # deinstallation of the package - remove feature
rm -f %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf rm -f %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf
fi fi

exit 0 exit 0


%post ido-pgsql %post ido-pgsql
if [ ${1:-0} -eq 1 ] if [ ${1:-0} -eq 1 ] && [ -e %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf ]
then then
# initial installation, enable ido-pgsql feature # initial installation, enable ido-pgsql feature
ln -sf ../features-available/ido-pgsql.conf %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf ln -sf ../features-available/ido-pgsql.conf %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
fi fi

exit 0 exit 0


%postun ido-pgsql %postun ido-pgsql
if [ "$1" = "0" ]; then if [ "$1" = "0" ]; then
# deinstallation of the package - remove feature # deinstallation of the package - remove feature
rm -f %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf rm -f %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf
fi fi

exit 0 exit 0


%if 0%{?use_selinux}
%post selinux %post selinux
for selinuxvariant in %{selinux_variants} for selinuxvariant in %{selinux_variants}
do do
/usr/sbin/semodule -s ${selinuxvariant} -i \ /usr/sbin/semodule -s ${selinuxvariant} -i \
%{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp &> /dev/null || : %{_datadir}/selinux/${selinuxvariant}/%{selinux_modulename}.pp &> /dev/null || :
done done
/sbin/fixfiles -R icinga2 restore &> /dev/null || :
/sbin/fixfiles -R icinga2-bin restore &> /dev/null || : /sbin/fixfiles -R icinga2-bin restore &> /dev/null || :
/sbin/fixfiles -R icinga2-common restore &> /dev/null || : /sbin/fixfiles -R icinga2-common restore &> /dev/null || :
/sbin/semanage port -a -t icinga2_port_t -p tcp 5665 &> /dev/null || : /sbin/semanage port -a -t icinga2_port_t -p tcp 5665 &> /dev/null || :



%postun selinux %postun selinux
if [ $1 -eq 0 ] ; then if [ $1 -eq 0 ] ; then
/sbin/semanage port -d -t icinga2_port_t -p tcp 5665 &> /dev/null || : /sbin/semanage port -d -t icinga2_port_t -p tcp 5665 &> /dev/null || :
for selinuxvariant in %{selinux_variants} for selinuxvariant in %{selinux_variants}
do do
/usr/sbin/semodule -s ${selinuxvariant} -r %{modulename} &> /dev/null || : /usr/sbin/semodule -s ${selinuxvariant} -r %{selinux_modulename} &> /dev/null || :
done done
/sbin/fixfiles -R icinga2 restore &> /dev/null || :
/sbin/fixfiles -R icinga2-bin restore &> /dev/null || : /sbin/fixfiles -R icinga2-bin restore &> /dev/null || :
/sbin/fixfiles -R icinga2-common restore &> /dev/null || : /sbin/fixfiles -R icinga2-common restore &> /dev/null || :
fi fi
%endif




%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc COPYING %doc COPYING



%files bin
%defattr(-,root,root,-)
%doc COPYING README.md NEWS AUTHORS CHANGELOG.md
%{_sbindir}/%{name}
%dir %{_libdir}/%{name}/sbin
%{_libdir}/%{name}/sbin/%{name}
%{plugindir}/check_nscp_api
%{_datadir}/%{name}
%exclude %{_datadir}/%{name}/include
%{_mandir}/man8/%{name}.8.gz

%attr(0750,%{icinga_user},%{icingacmd_group}) %{_localstatedir}/cache/%{name}
%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/crash
%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat
%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat/archives
%attr(0750,%{icinga_user},%{icinga_group}) %{_localstatedir}/lib/%{name}

%attr(0750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}
%attr(2750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}/cmd


%files libs
%defattr(-,root,root,-)
%doc COPYING README.md NEWS AUTHORS CHANGELOG.md
%exclude %{_libdir}/%{name}/libdb_ido_mysql*
%exclude %{_libdir}/%{name}/libdb_ido_pgsql*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/*.so*


%files common
%defattr(-,root,root,-)
%doc COPYING README.md NEWS AUTHORS CHANGELOG.md tools/syntax
%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%{_sysconfdir}/bash_completion.d/%{name}
%if 0%{?use_systemd} %if 0%{?use_systemd}
%attr(644,root,root) %{_unitdir}/%{name}.service %attr(644,root,root) %{_unitdir}/%{name}.service
%if 0%{?configure_systemd_limits} %if 0%{?configure_systemd_limits}
%attr(644,root,root) /etc/systemd/system/%{name}.service.d/limits.conf %dir /etc/systemd/system/%{name}.service.d
%attr(644,root,root) %config(noreplace) /etc/systemd/system/%{name}.service.d/limits.conf
%endif %endif
%else %else
%attr(755,root,root) %{_sysconfdir}/init.d/%{name} %attr(755,root,root) %config(noreplace) %{_sysconfdir}/init.d/%{name}
%endif %endif
%if "%{_vendor}" == "suse"
%{_sbindir}/rc%{name}
%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
%else
%config(noreplace) %{_sysconfdir}/sysconfig/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%endif
%attr(0750,root,%{icinga_group}) %dir %{_sysconfdir}/%{name} %{_sbindir}/%{name}

%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/prepare-dirs
%{_libexecdir}/%{name}/safe-reload

%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/conf.d
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-available %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/features-available
%exclude %{_sysconfdir}/%{name}/features-available/ido-*.conf %exclude %{_sysconfdir}/%{name}/features-available/ido-*.conf
@ -358,21 +468,44 @@ fi
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/scripts %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/scripts
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/zones.d %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/zones.d
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/%{name}.conf %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/%{name}.conf
#%config(noreplace) %attr(0640,root,%{icinga_group}) %{_sysconfdir}/%{name}/init.conf
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/constants.conf %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/constants.conf
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.conf %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.conf
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/*.conf %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/*.conf
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/*.conf %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/*.conf
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.d/* %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.d/*
%config(noreplace) %{_sysconfdir}/%{name}/scripts/* %config(noreplace) %{_sysconfdir}/%{name}/scripts/*
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/prepare-dirs %attr(0750,%{icinga_user},%{icingacmd_group}) %{_localstatedir}/cache/%{name}
%{_libexecdir}/%{name}/safe-reload %attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/log/%{name}/crash
%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat
%attr(0750,%{icinga_user},%{icingacmd_group}) %dir %{_localstatedir}/log/%{name}/compat/archives
%attr(0750,%{icinga_user},%{icinga_group}) %{_localstatedir}/lib/%{name}
%attr(0750,%{icinga_user},%{icingacmd_group}) %ghost %dir %{_rundir}/%{name}
%attr(2750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}/cmd
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name} %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}
%attr(0770,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/perfdata %attr(0770,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/perfdata
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/tmp %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/tmp


%files bin
%defattr(-,root,root,-)
%doc COPYING README.md NEWS AUTHORS CHANGELOG.md
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/sbin
%{_libdir}/%{name}/sbin/%{name}
%{plugindir}/check_nscp_api
%{_datadir}/%{name}
%exclude %{_datadir}/%{name}/include
%{_mandir}/man8/%{name}.8.gz


%files common
%defattr(-,root,root,-)
%doc COPYING README.md NEWS AUTHORS CHANGELOG.md tools/syntax
%{_sysconfdir}/bash_completion.d/%{name}
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_datadir}/%{name}/include %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_datadir}/%{name}/include
%{_datadir}/%{name}/include %{_datadir}/%{name}/include/*




%files doc %files doc
@ -381,26 +514,32 @@ fi
%docdir %{_datadir}/doc/%{name} %docdir %{_datadir}/doc/%{name}




%if %{with mysql}
%files ido-mysql %files ido-mysql
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc COPYING README.md NEWS AUTHORS CHANGELOG.md %doc COPYING README.md NEWS AUTHORS CHANGELOG.md
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-mysql.conf %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-mysql.conf
%{_libdir}/%{name}/libdb_ido_mysql* %{_libdir}/%{name}/libmysql_shim*
%{_datadir}/icinga2-ido-mysql %{_datadir}/icinga2-ido-mysql
%endif




%if %{with pgsql}
%files ido-pgsql %files ido-pgsql
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc COPYING README.md NEWS AUTHORS CHANGELOG.md %doc COPYING README.md NEWS AUTHORS CHANGELOG.md
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-pgsql.conf %config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/features-available/ido-pgsql.conf
%{_libdir}/%{name}/libdb_ido_pgsql* %{_libdir}/%{name}/libpgsql_shim*
%{_datadir}/icinga2-ido-pgsql %{_datadir}/icinga2-ido-pgsql
%endif




%if 0%{?use_selinux}
%files selinux %files selinux
%defattr(-,root,root,0755) %defattr(-,root,root,0755)
%doc tools/selinux/* %doc tools/selinux/*
%{_datadir}/selinux/*/%{modulename}.pp %{_datadir}/selinux/*/%{selinux_modulename}.pp
%endif




%files -n vim-icinga2 %files -n vim-icinga2
@ -411,7 +550,6 @@ fi


%files -n nano-icinga2 %files -n nano-icinga2
%defattr(-,root,root,-) %defattr(-,root,root,-)
%dir %{_datadir}/nano
%{_datadir}/nano/%{name}.nanorc %{_datadir}/nano/%{name}.nanorc





Loading…
Cancel
Save